diff --git a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs index ef1f998d..80ab2a3c 100644 --- a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs +++ b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs @@ -77,12 +77,17 @@ namespace Fungus public class Settings { /** - * Minimum time for each command to execute when playing the scene in the editor. - * Slowing down the program flow makes it easier to visualise execution order. + * Slow down execution when playing in the editor to make it easier to visualise program flow. + */ + [Tooltip("Slow down execution in the editor to make it easier to visualise program flow")] + public bool runSlowInEditor = true; + + /** + * Minimum time for each command to execute when runSlowInEditor is enabled. */ [Range(0f, 5f)] - [Tooltip("Minimum time for each command to execute when playing the scene in the editor")] - public float minCommandDuration = 0.25f; + [Tooltip("Minimum time that each command will take to execute when Run Slow In Editor is enabled")] + public float runSlowDuration = 0.25f; /** * Use command color when displaying the command list in the Fungus Editor window. diff --git a/Assets/Fungus/FungusScript/Scripts/Sequence.cs b/Assets/Fungus/FungusScript/Scripts/Sequence.cs index b40ce9d4..3694e732 100644 --- a/Assets/Fungus/FungusScript/Scripts/Sequence.cs +++ b/Assets/Fungus/FungusScript/Scripts/Sequence.cs @@ -94,14 +94,14 @@ namespace Fungus { FungusScript fungusScript = GetFungusScript(); - if (fungusScript.settings.minCommandDuration == 0f) + if (!fungusScript.settings.runSlowInEditor) { activeCommand = nextCommand; nextCommand.Execute(); } else { - StartCoroutine(ExecuteAfterDelay(nextCommand, fungusScript.settings.minCommandDuration)); + StartCoroutine(ExecuteAfterDelay(nextCommand, fungusScript.settings.runSlowDuration)); } }