Browse Source

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

master
chrisgregan 10 years ago
parent
commit
bb48384dfa
  1. 3
      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

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

@ -61,9 +61,6 @@ namespace Fungus
SerializedProperty descriptionProp = serializedObject.FindProperty("description"); SerializedProperty descriptionProp = serializedObject.FindProperty("description");
EditorGUILayout.PropertyField(descriptionProp); EditorGUILayout.PropertyField(descriptionProp);
SerializedProperty runSlowInEditorProp = serializedObject.FindProperty("runSlowInEditor");
EditorGUILayout.PropertyField(runSlowInEditorProp);
DrawEventHandlerGUI(flowchart); DrawEventHandlerGUI(flowchart);
UpdateIndentLevels(block); UpdateIndentLevels(block);

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

@ -21,7 +21,7 @@ namespace Fungus
protected SerializedProperty descriptionProp; protected SerializedProperty descriptionProp;
protected SerializedProperty colorCommandsProp; protected SerializedProperty colorCommandsProp;
protected SerializedProperty hideComponentsProp; protected SerializedProperty hideComponentsProp;
protected SerializedProperty runSlowDurationProp; protected SerializedProperty pauseAfterCommandProp;
protected SerializedProperty saveSelectionProp; protected SerializedProperty saveSelectionProp;
protected SerializedProperty localizationIdProp; protected SerializedProperty localizationIdProp;
protected SerializedProperty variablesProp; protected SerializedProperty variablesProp;
@ -31,7 +31,7 @@ namespace Fungus
descriptionProp = serializedObject.FindProperty("description"); descriptionProp = serializedObject.FindProperty("description");
colorCommandsProp = serializedObject.FindProperty("colorCommands"); colorCommandsProp = serializedObject.FindProperty("colorCommands");
hideComponentsProp = serializedObject.FindProperty("hideComponents"); hideComponentsProp = serializedObject.FindProperty("hideComponents");
runSlowDurationProp = serializedObject.FindProperty("runSlowDuration"); pauseAfterCommandProp = serializedObject.FindProperty("pauseAfterCommand");
saveSelectionProp = serializedObject.FindProperty("saveSelection"); saveSelectionProp = serializedObject.FindProperty("saveSelection");
localizationIdProp = serializedObject.FindProperty("localizationId"); localizationIdProp = serializedObject.FindProperty("localizationId");
variablesProp = serializedObject.FindProperty("variables"); variablesProp = serializedObject.FindProperty("variables");
@ -48,7 +48,7 @@ namespace Fungus
EditorGUILayout.PropertyField(descriptionProp); EditorGUILayout.PropertyField(descriptionProp);
EditorGUILayout.PropertyField(colorCommandsProp); EditorGUILayout.PropertyField(colorCommandsProp);
EditorGUILayout.PropertyField(hideComponentsProp); EditorGUILayout.PropertyField(hideComponentsProp);
EditorGUILayout.PropertyField(runSlowDurationProp); EditorGUILayout.PropertyField(pauseAfterCommandProp);
EditorGUILayout.PropertyField(saveSelectionProp); EditorGUILayout.PropertyField(saveSelectionProp);
EditorGUILayout.PropertyField(localizationIdProp); 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")] [Tooltip("Description text to display under the block node")]
public string description = ""; 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; public EventHandler eventHandler;
[HideInInspector] [HideInInspector]
@ -236,10 +233,12 @@ namespace Fungus
yield return null; 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; command.isExecuting = false;
} }

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

@ -193,14 +193,6 @@ namespace Fungus
{ {
return Color.white; 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 = ""; 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)] [Range(0f, 5f)]
[Tooltip("Minimum time that each command will take to execute when Run Slow In Editor is enabled")] [Tooltip("Slow down execution in the editor to make it easier to visualise program flow. Does not affect platform builds.")]
public float runSlowDuration = 0.25f; public float pauseAfterCommand = 0f;
/** /**
* Use command color when displaying the command list in the inspector. * 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); return new Color32(184, 210, 235, 255);
} }
public override bool RunSlowInEditor()
{
return false;
}
} }
} }

3
ProjectSettings/ProjectSettings.asset

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

Loading…
Cancel
Save