Browse Source

Replace "Run Slow In Editor" per block with "Pause After Command" in flowchart

master
chrisgregan 10 years ago
parent
commit
bb48384dfa
  1. 5
      Assets/Fungus/Flowchart/Editor/BlockEditor.cs
  2. 6
      Assets/Fungus/Flowchart/Editor/FlowchartEditor.cs
  3. 9
      Assets/Fungus/Flowchart/Scripts/Block.cs
  4. 8
      Assets/Fungus/Flowchart/Scripts/Command.cs
  5. 6
      Assets/Fungus/Flowchart/Scripts/Flowchart.cs
  6. 5
      Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs
  7. 3
      ProjectSettings/ProjectSettings.asset

5
Assets/Fungus/Flowchart/Editor/BlockEditor.cs

@ -60,10 +60,7 @@ namespace Fungus
{
SerializedProperty descriptionProp = serializedObject.FindProperty("description");
EditorGUILayout.PropertyField(descriptionProp);
SerializedProperty runSlowInEditorProp = serializedObject.FindProperty("runSlowInEditor");
EditorGUILayout.PropertyField(runSlowInEditorProp);
DrawEventHandlerGUI(flowchart);
UpdateIndentLevels(block);

6
Assets/Fungus/Flowchart/Editor/FlowchartEditor.cs

@ -21,7 +21,7 @@ namespace Fungus
protected SerializedProperty descriptionProp;
protected SerializedProperty colorCommandsProp;
protected SerializedProperty hideComponentsProp;
protected SerializedProperty runSlowDurationProp;
protected SerializedProperty pauseAfterCommandProp;
protected SerializedProperty saveSelectionProp;
protected SerializedProperty localizationIdProp;
protected SerializedProperty variablesProp;
@ -31,7 +31,7 @@ namespace Fungus
descriptionProp = serializedObject.FindProperty("description");
colorCommandsProp = serializedObject.FindProperty("colorCommands");
hideComponentsProp = serializedObject.FindProperty("hideComponents");
runSlowDurationProp = serializedObject.FindProperty("runSlowDuration");
pauseAfterCommandProp = serializedObject.FindProperty("pauseAfterCommand");
saveSelectionProp = serializedObject.FindProperty("saveSelection");
localizationIdProp = serializedObject.FindProperty("localizationId");
variablesProp = serializedObject.FindProperty("variables");
@ -48,7 +48,7 @@ namespace Fungus
EditorGUILayout.PropertyField(descriptionProp);
EditorGUILayout.PropertyField(colorCommandsProp);
EditorGUILayout.PropertyField(hideComponentsProp);
EditorGUILayout.PropertyField(runSlowDurationProp);
EditorGUILayout.PropertyField(pauseAfterCommandProp);
EditorGUILayout.PropertyField(saveSelectionProp);
EditorGUILayout.PropertyField(localizationIdProp);

9
Assets/Fungus/Flowchart/Scripts/Block.cs

@ -40,9 +40,6 @@ namespace Fungus
[Tooltip("Description text to display under the block node")]
public string description = "";
[Tooltip("Slow down execution in the editor to make it easier to visualise program flow")]
public bool runSlowInEditor = true;
public EventHandler eventHandler;
[HideInInspector]
@ -236,10 +233,12 @@ namespace Fungus
yield return null;
}
if (runSlowInEditor)
#if UNITY_EDITOR
if (flowchart.pauseAfterCommand > 0f)
{
yield return new WaitForSeconds(flowchart.runSlowDuration);
yield return new WaitForSeconds(flowchart.pauseAfterCommand);
}
#endif
command.isExecuting = false;
}

8
Assets/Fungus/Flowchart/Scripts/Command.cs

@ -193,14 +193,6 @@ namespace Fungus
{
return Color.white;
}
/**
* Adds a delay between commands if the 'Run Slow In Editor' option is enabled.
*/
public virtual bool RunSlowInEditor()
{
return true;
}
}
}

6
Assets/Fungus/Flowchart/Scripts/Flowchart.cs

@ -83,11 +83,11 @@ namespace Fungus
public string description = "";
/**
* Minimum time for each command to execute when runSlowInEditor is enabled.
* Slow down execution in the editor to make it easier to visualise program flow.
*/
[Range(0f, 5f)]
[Tooltip("Minimum time that each command will take to execute when Run Slow In Editor is enabled")]
public float runSlowDuration = 0.25f;
[Tooltip("Slow down execution in the editor to make it easier to visualise program flow. Does not affect platform builds.")]
public float pauseAfterCommand = 0f;
/**
* Use command color when displaying the command list in the inspector.

5
Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs

@ -53,11 +53,6 @@ namespace Fungus
{
return new Color32(184, 210, 235, 255);
}
public override bool RunSlowInEditor()
{
return false;
}
}
}

3
ProjectSettings/ProjectSettings.asset

@ -16,6 +16,7 @@ PlayerSettings:
cloudProjectId:
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_ShowUnitySplashScreen: 1
defaultScreenWidth: 2000
defaultScreenHeight: 2000
defaultScreenWidthWeb: 960
@ -118,6 +119,7 @@ PlayerSettings:
serializedVersion: 2
rgba: 0
iOSLaunchScreenFillPct: 1
iOSLaunchScreenSize: 100
iOSLaunchScreenCustomXibPath:
AndroidTargetDevice: 0
AndroidSplashScreenScale: 0
@ -130,6 +132,7 @@ PlayerSettings:
- width: 320
height: 180
banner: {fileID: 0}
androidGamepadSupportLevel: 0
resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons:
- m_BuildTarget:

Loading…
Cancel
Save