From 7334a463c804a9182ebd3948ac3d486dde088c0b Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Sun, 8 Apr 2018 20:33:22 +1000 Subject: [PATCH 1/3] Added Fungus Priority Signals Intended to allow fungus to notify the outside world that it is doing something of priority so the outside world can pause -Tests -Commands --- Assets/Fungus/Scripts/Commands/Priority.meta | 10 ++ .../Priority/FungusPrirorityCurrentCount.cs | 32 +++++++ .../FungusPrirorityCurrentCount.cs.meta | 13 +++ .../Priority/FungusPrirorityDecrease.cs | 22 +++++ .../Priority/FungusPrirorityDecrease.cs.meta | 13 +++ .../Priority/FungusPrirorityIncrease.cs | 22 +++++ .../Priority/FungusPrirorityIncrease.cs.meta | 13 +++ .../Commands/Priority/FungusPrirorityReset.cs | 21 ++++ .../Priority/FungusPrirorityReset.cs.meta | 13 +++ .../Scripts/Signals/FungusActiveSignals.cs | 96 +++++++++++++++++++ .../Signals/FungusActiveSignals.cs.meta | 13 +++ Assets/Tests/Signals/Editor.meta | 10 ++ .../Editor/FungusPrioritySignalsTest.cs | 89 +++++++++++++++++ .../Editor/FungusPrioritySignalsTest.cs.meta | 13 +++ 14 files changed, 380 insertions(+) create mode 100644 Assets/Fungus/Scripts/Commands/Priority.meta create mode 100644 Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs create mode 100644 Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs.meta create mode 100644 Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs create mode 100644 Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs.meta create mode 100644 Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs create mode 100644 Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs.meta create mode 100644 Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs create mode 100644 Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs.meta create mode 100644 Assets/Fungus/Scripts/Signals/FungusActiveSignals.cs create mode 100644 Assets/Fungus/Scripts/Signals/FungusActiveSignals.cs.meta create mode 100644 Assets/Tests/Signals/Editor.meta create mode 100644 Assets/Tests/Signals/Editor/FungusPrioritySignalsTest.cs create mode 100644 Assets/Tests/Signals/Editor/FungusPrioritySignalsTest.cs.meta diff --git a/Assets/Fungus/Scripts/Commands/Priority.meta b/Assets/Fungus/Scripts/Commands/Priority.meta new file mode 100644 index 00000000..f6aaeb61 --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/Priority.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 61d2004f0aa3f1847beb167296c897d8 +folderAsset: yes +timeCreated: 1523180219 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs new file mode 100644 index 00000000..c2a3aeef --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + /// + /// + [CommandInfo("Scripting", + "Priority Count", + "Resets the FungusPriority count to zero. Useful if you are among logic that is hard to have matching increase and decreases.")] + public class FungusPrirorityCurrentCount : Command + { + public FloatVar outVar; + + public override void OnEnter() + { + outVar.Value = FungusPrioritySignals.CurrentPriorityDepth; + + Continue(); + } + + public override string GetSummary() + { + if(outVar == null) + { + return "Error: No out var supplied"; + } + return outVar.Key; + } + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs.meta b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs.meta new file mode 100644 index 00000000..cb0f4932 --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9cf8648fa41dd274ea08513e0e09751a +timeCreated: 1523180726 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs new file mode 100644 index 00000000..59f02ffe --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + /// + /// + [CommandInfo("Scripting", + "Priority Down", + "Decrease the FungusPriority count, causing the related FungusPrioritySignals to fire. " + + "Intended to be used to notify external systems that fungus is doing something important and they should perhaps resume.")] + public class FungusPrirorityDecrease : Command + { + public override void OnEnter() + { + FungusPrioritySignals.DoDecreasePriorityDepth(); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs.meta b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs.meta new file mode 100644 index 00000000..e194da3d --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7c145feff04914a4381eed102db730f9 +timeCreated: 1523180528 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs new file mode 100644 index 00000000..2ec01a37 --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + /// + /// + [CommandInfo("Scripting", + "Priority Up", + "Increases the FungusPriority count, causing the related FungusPrioritySignals to fire. " + + "Intended to be used to notify external systems that fungus is doing something important and they should perhaps pause.")] + public class FungusPrirorityIncrease : Command + { + public override void OnEnter() + { + FungusPrioritySignals.DoIncreasePriorityDepth(); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs.meta b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs.meta new file mode 100644 index 00000000..89a97d3c --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5205fc5ce9948364994bf9075b2fa803 +timeCreated: 1523180260 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs new file mode 100644 index 00000000..811ff875 --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Fungus +{ + /// + /// + [CommandInfo("Scripting", + "Priority Reset", + "Resets the FungusPriority count to zero. Useful if you are among logic that is hard to have matching increase and decreases.")] + public class FungusPrirorityReset : Command + { + public override void OnEnter() + { + FungusPrioritySignals.DoResetPriority(); + + Continue(); + } + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs.meta b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs.meta new file mode 100644 index 00000000..3eff5ec7 --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 130c56669cb437d4d80996fba8aa50dd +timeCreated: 1523180528 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Signals/FungusActiveSignals.cs b/Assets/Fungus/Scripts/Signals/FungusActiveSignals.cs new file mode 100644 index 00000000..f28f75bd --- /dev/null +++ b/Assets/Fungus/Scripts/Signals/FungusActiveSignals.cs @@ -0,0 +1,96 @@ +namespace Fungus +{ + /// + /// Fungus Priority event signalling system. + /// A common point for Fungus core systems and user Commands to signal to external code that a + /// Fungus system is currently doing something important. + /// + /// One intended use case for this system is to have your code listen to this to know when to + /// stop player movement or camera movement etc. when the player is engaged in a conversation + /// with an NPC. + /// + public static class FungusPrioritySignals + { + #region Public members + /// + /// used by increase and decrease active depth functions. + /// + private static int activeDepth; + + public static int CurrentPriorityDepth + { + get + { + return activeDepth; + } + } + + public static event FungusPriorityStartHandler OnFungusPriorityStart; + public delegate void FungusPriorityStartHandler(); + + public static event FungusPriorityEndHandler OnFungusPriorityEnd; + public delegate void FungusPriorityEndHandler(); + + + public static event FungusPriorityChangeHandler OnFungusPriorityChange; + public delegate void FungusPriorityChangeHandler(int previousActiveDepth, int newActiveDepth); + + /// + /// Adds 1 to the theactiveDepth. If it was zero causes the OnFungusPriorityStart + /// + public static void DoIncreasePriorityDepth() + { + if(activeDepth == 0) + { + if (OnFungusPriorityStart != null) + { + OnFungusPriorityStart(); + } + } + if(OnFungusPriorityChange != null) + { + OnFungusPriorityChange(activeDepth, activeDepth + 1); + } + activeDepth++; + } + + /// + /// Subtracts 1 to the theactiveDepth. If it reaches zero causes the OnFungusPriorityEnd + /// + public static void DoDecreasePriorityDepth() + { + if (OnFungusPriorityChange != null) + { + OnFungusPriorityChange(activeDepth, activeDepth - 1); + } + if(activeDepth == 1) + { + if(OnFungusPriorityEnd != null) + { + OnFungusPriorityEnd(); + } + } + activeDepth--; + } + + /// + /// Forces active depth back to 0. If already 0 fires no signals. + /// + public static void DoResetPriority() + { + if (activeDepth == 0) + return; + + if (OnFungusPriorityChange != null) + { + OnFungusPriorityChange(activeDepth, 0); + } + if (OnFungusPriorityEnd != null) + { + OnFungusPriorityEnd(); + } + activeDepth = 0; + } + #endregion + } +} diff --git a/Assets/Fungus/Scripts/Signals/FungusActiveSignals.cs.meta b/Assets/Fungus/Scripts/Signals/FungusActiveSignals.cs.meta new file mode 100644 index 00000000..3d081ea0 --- /dev/null +++ b/Assets/Fungus/Scripts/Signals/FungusActiveSignals.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fd542ada4b268ba49bcab2fd4d8e465e +timeCreated: 1523173334 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/Signals/Editor.meta b/Assets/Tests/Signals/Editor.meta new file mode 100644 index 00000000..930d2f4f --- /dev/null +++ b/Assets/Tests/Signals/Editor.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b38a1b95ff88ff34abb4a8a15679fdf5 +folderAsset: yes +timeCreated: 1523182215 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/Signals/Editor/FungusPrioritySignalsTest.cs b/Assets/Tests/Signals/Editor/FungusPrioritySignalsTest.cs new file mode 100644 index 00000000..8a54946a --- /dev/null +++ b/Assets/Tests/Signals/Editor/FungusPrioritySignalsTest.cs @@ -0,0 +1,89 @@ +using UnityEngine; +using UnityEditor; +using UnityEngine.TestTools; +using NUnit.Framework; +using System.Collections; + +public class FungusPrioritySignalsTest { + + private int changeCallCount, startCallCount, endCallCount; + + [Test] + public void CountsAndSignals() + { + Fungus.FungusPrioritySignals.OnFungusPriorityStart += FungusPrioritySignals_OnFungusPriorityStart; + Fungus.FungusPrioritySignals.OnFungusPriorityEnd += FungusPrioritySignals_OnFungusPriorityEnd; + Fungus.FungusPrioritySignals.OnFungusPriorityChange += FungusPrioritySignals_OnFungusPriorityChange; + + Assert.Zero(Fungus.FungusPrioritySignals.CurrentPriorityDepth); + + Fungus.FungusPrioritySignals.DoIncreasePriorityDepth(); + //one start, one change, no end, 1 depth + Assert.AreEqual(0, endCallCount); + Assert.AreEqual(1, startCallCount); + Assert.AreEqual(1, changeCallCount); + Assert.AreEqual(1, Fungus.FungusPrioritySignals.CurrentPriorityDepth); + + + + Fungus.FungusPrioritySignals.DoIncreasePriorityDepth(); + //one start, 2 change, no end, 2 depth + Assert.AreEqual(0, endCallCount); + Assert.AreEqual(1, startCallCount); + Assert.AreEqual(2, changeCallCount); + Assert.AreEqual(2, Fungus.FungusPrioritySignals.CurrentPriorityDepth); + + + Fungus.FungusPrioritySignals.DoIncreasePriorityDepth(); + //one start, 3 change, no end, 3 depth + Assert.AreEqual(0, endCallCount); + Assert.AreEqual(1, startCallCount); + Assert.AreEqual(3, changeCallCount); + Assert.AreEqual(3, Fungus.FungusPrioritySignals.CurrentPriorityDepth); + + + Fungus.FungusPrioritySignals.DoDecreasePriorityDepth(); + //one start, 4 change, no end, 2 depth + Assert.AreEqual(0, endCallCount); + Assert.AreEqual(1, startCallCount); + Assert.AreEqual(4, changeCallCount); + Assert.AreEqual(2, Fungus.FungusPrioritySignals.CurrentPriorityDepth); + + + Fungus.FungusPrioritySignals.DoDecreasePriorityDepth(); + Fungus.FungusPrioritySignals.DoDecreasePriorityDepth(); + //one start, 6 change, 1 end, 0 depth + Assert.AreEqual(1, endCallCount); + Assert.AreEqual(1, startCallCount); + Assert.AreEqual(6, changeCallCount); + Assert.AreEqual(0, Fungus.FungusPrioritySignals.CurrentPriorityDepth); + + Fungus.FungusPrioritySignals.OnFungusPriorityStart -= FungusPrioritySignals_OnFungusPriorityStart; + Fungus.FungusPrioritySignals.OnFungusPriorityEnd -= FungusPrioritySignals_OnFungusPriorityEnd; + Fungus.FungusPrioritySignals.OnFungusPriorityChange -= FungusPrioritySignals_OnFungusPriorityChange; + + //unsubbed so all the same + Fungus.FungusPrioritySignals.DoIncreasePriorityDepth(); + Fungus.FungusPrioritySignals.DoDecreasePriorityDepth(); + //one start, 6 change, 1 end, 0 depth + Assert.AreEqual(1, endCallCount); + Assert.AreEqual(1, startCallCount); + Assert.AreEqual(6, changeCallCount); + Assert.AreEqual(0, Fungus.FungusPrioritySignals.CurrentPriorityDepth); + } + + private void FungusPrioritySignals_OnFungusPriorityChange(int previousActiveDepth, int newActiveDepth) + { + changeCallCount++; + } + + private void FungusPrioritySignals_OnFungusPriorityEnd() + { + endCallCount++; + } + + private void FungusPrioritySignals_OnFungusPriorityStart() + { + startCallCount++; + } +} diff --git a/Assets/Tests/Signals/Editor/FungusPrioritySignalsTest.cs.meta b/Assets/Tests/Signals/Editor/FungusPrioritySignalsTest.cs.meta new file mode 100644 index 00000000..2f1edd07 --- /dev/null +++ b/Assets/Tests/Signals/Editor/FungusPrioritySignalsTest.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4b20617e7666fda46bd85a41ce882f9d +timeCreated: 1523182238 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 17a934a63b3bb047b4a40ae194bcb2a0b934d2b4 Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Tue, 17 Apr 2018 12:00:33 +1000 Subject: [PATCH 2/3] Fix many typos of 'Prirority' Corrected Summaries Moved Commands to the 'Priority Signals' category --- ...irorityCurrentCount.cs => FungusPriorityCount.cs} | 12 +++++++----- ...yIncrease.cs.meta => FungusPriorityCount.cs.meta} | 4 ++-- ...rirorityDecrease.cs => FungusPriorityDecrease.cs} | 6 ++++-- ...tCount.cs.meta => FungusPriorityDecrease.cs.meta} | 4 ++-- ...rirorityIncrease.cs => FungusPriorityIncrease.cs} | 6 ++++-- ...yReset.cs.meta => FungusPriorityIncrease.cs.meta} | 4 ++-- ...ungusPrirorityReset.cs => FungusPriorityReset.cs} | 5 +++-- ...yDecrease.cs.meta => FungusPriorityReset.cs.meta} | 4 ++-- 8 files changed, 26 insertions(+), 19 deletions(-) rename Assets/Fungus/Scripts/Commands/Priority/{FungusPrirorityCurrentCount.cs => FungusPriorityCount.cs} (50%) rename Assets/Fungus/Scripts/Commands/Priority/{FungusPrirorityIncrease.cs.meta => FungusPriorityCount.cs.meta} (77%) rename Assets/Fungus/Scripts/Commands/Priority/{FungusPrirorityDecrease.cs => FungusPriorityDecrease.cs} (65%) rename Assets/Fungus/Scripts/Commands/Priority/{FungusPrirorityCurrentCount.cs.meta => FungusPriorityDecrease.cs.meta} (77%) rename Assets/Fungus/Scripts/Commands/Priority/{FungusPrirorityIncrease.cs => FungusPriorityIncrease.cs} (65%) rename Assets/Fungus/Scripts/Commands/Priority/{FungusPrirorityReset.cs.meta => FungusPriorityIncrease.cs.meta} (77%) rename Assets/Fungus/Scripts/Commands/Priority/{FungusPrirorityReset.cs => FungusPriorityReset.cs} (68%) rename Assets/Fungus/Scripts/Commands/Priority/{FungusPrirorityDecrease.cs.meta => FungusPriorityReset.cs.meta} (77%) diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs similarity index 50% rename from Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs rename to Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs index c2a3aeef..a1aa957a 100644 --- a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs @@ -5,13 +5,15 @@ using UnityEngine; namespace Fungus { /// + /// Copy the value of the Priority Count to a local IntegerVariable, intended primarily to assist with debugging use of Priority. /// - [CommandInfo("Scripting", - "Priority Count", - "Resets the FungusPriority count to zero. Useful if you are among logic that is hard to have matching increase and decreases.")] - public class FungusPrirorityCurrentCount : Command + [CommandInfo("Priority Signals", + "Get Priority Count", + "Copy the value of the Priority Count to a local IntegerVariable, intended primarily to assist with debugging use of Priority.")] + public class FungusPriorityCount : Command { - public FloatVar outVar; + [VariableProperty(typeof(IntegerVariable))] + public IntegerVariable outVar; public override void OnEnter() { diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs.meta b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs.meta similarity index 77% rename from Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs.meta rename to Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs.meta index 89a97d3c..4862a858 100644 --- a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs.meta +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityCount.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 5205fc5ce9948364994bf9075b2fa803 -timeCreated: 1523180260 +guid: a3aeb6a9bd739484080e7965ecaab89e +timeCreated: 1523926493 licenseType: Free MonoImporter: externalObjects: {} diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs similarity index 65% rename from Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs rename to Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs index 59f02ffe..8461eaee 100644 --- a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs @@ -5,12 +5,14 @@ using UnityEngine; namespace Fungus { /// + /// Decrease the FungusPriority count, causing the related FungusPrioritySignals to fire. + /// Intended to be used to notify external systems that fungus is doing something important and they should perhaps resume. /// - [CommandInfo("Scripting", + [CommandInfo("Priority Signals", "Priority Down", "Decrease the FungusPriority count, causing the related FungusPrioritySignals to fire. " + "Intended to be used to notify external systems that fungus is doing something important and they should perhaps resume.")] - public class FungusPrirorityDecrease : Command + public class FungusPriorityDecrease : Command { public override void OnEnter() { diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs.meta b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs.meta similarity index 77% rename from Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs.meta rename to Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs.meta index cb0f4932..385cd193 100644 --- a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityCurrentCount.cs.meta +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityDecrease.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 9cf8648fa41dd274ea08513e0e09751a -timeCreated: 1523180726 +guid: ebc295ba6aed8944fa3974a64f33cc42 +timeCreated: 1523926493 licenseType: Free MonoImporter: externalObjects: {} diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs similarity index 65% rename from Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs rename to Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs index 2ec01a37..40282e32 100644 --- a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityIncrease.cs +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs @@ -5,12 +5,14 @@ using UnityEngine; namespace Fungus { /// + /// Increases the FungusPriority count, causing the related FungusPrioritySignals to fire. + /// Intended to be used to notify external systems that fungus is doing something important and they should perhaps pause. /// - [CommandInfo("Scripting", + [CommandInfo("Priority Signals", "Priority Up", "Increases the FungusPriority count, causing the related FungusPrioritySignals to fire. " + "Intended to be used to notify external systems that fungus is doing something important and they should perhaps pause.")] - public class FungusPrirorityIncrease : Command + public class FungusPriorityIncrease : Command { public override void OnEnter() { diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs.meta b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs.meta similarity index 77% rename from Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs.meta rename to Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs.meta index 3eff5ec7..49d7aed5 100644 --- a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs.meta +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityIncrease.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 130c56669cb437d4d80996fba8aa50dd -timeCreated: 1523180528 +guid: 3d07cf5e706b13a4eb0ae53386c30fbd +timeCreated: 1523926493 licenseType: Free MonoImporter: externalObjects: {} diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs similarity index 68% rename from Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs rename to Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs index 811ff875..d854f388 100644 --- a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityReset.cs +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs @@ -5,11 +5,12 @@ using UnityEngine; namespace Fungus { /// + /// Resets the FungusPriority count to zero. Useful if you are among logic that is hard to have matching increase and decreases. /// - [CommandInfo("Scripting", + [CommandInfo("Priority Signals", "Priority Reset", "Resets the FungusPriority count to zero. Useful if you are among logic that is hard to have matching increase and decreases.")] - public class FungusPrirorityReset : Command + public class FungusPriorityReset : Command { public override void OnEnter() { diff --git a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs.meta b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs.meta similarity index 77% rename from Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs.meta rename to Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs.meta index e194da3d..7929cf49 100644 --- a/Assets/Fungus/Scripts/Commands/Priority/FungusPrirorityDecrease.cs.meta +++ b/Assets/Fungus/Scripts/Commands/Priority/FungusPriorityReset.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 7c145feff04914a4381eed102db730f9 -timeCreated: 1523180528 +guid: b5b98ba2a3006db49959601485049a0d +timeCreated: 1523926493 licenseType: Free MonoImporter: externalObjects: {} From cf2aa4df58a907ef1b2d47717e81fd482ba5cd43 Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Fri, 4 May 2018 17:55:33 +1000 Subject: [PATCH 3/3] Generated Docs for Priority Signals --- Docs/command_ref/priority signals_commands.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Docs/command_ref/priority signals_commands.md diff --git a/Docs/command_ref/priority signals_commands.md b/Docs/command_ref/priority signals_commands.md new file mode 100644 index 00000000..138b9fbd --- /dev/null +++ b/Docs/command_ref/priority signals_commands.md @@ -0,0 +1,19 @@ +# Priority Signals commands # {#priority signals_commands} + +[TOC] +# Get Priority Count # {#GetPriorityCount} +Copy the value of the Priority Count to a local IntegerVariable, intended primarily to assist with debugging use of Priority. + +Defined in Fungus.FungusPriorityCount +# Priority Down # {#PriorityDown} +Decrease the FungusPriority count, causing the related FungusPrioritySignals to fire. Intended to be used to notify external systems that fungus is doing something important and they should perhaps resume. + +Defined in Fungus.FungusPriorityDecrease +# Priority Reset # {#PriorityReset} +Resets the FungusPriority count to zero. Useful if you are among logic that is hard to have matching increase and decreases. + +Defined in Fungus.FungusPriorityReset +# Priority Up # {#PriorityUp} +Increases the FungusPriority count, causing the related FungusPrioritySignals to fire. Intended to be used to notify external systems that fungus is doing something important and they should perhaps pause. + +Defined in Fungus.FungusPriorityIncrease