Browse Source

Changed Say command, Show Once is now Show Always + Show Count

master
chrisgregan 10 years ago
parent
commit
c0127fe7db
  1. 16
      Assets/Fungus/Dialog/Editor/SayEditor.cs
  2. 9
      Assets/Fungus/Dialog/Scripts/Commands/Say.cs

16
Assets/Fungus/Dialog/Editor/SayEditor.cs

@ -36,7 +36,8 @@ namespace Fungus
protected SerializedProperty characterProp;
protected SerializedProperty sayDialogProp;
protected SerializedProperty voiceOverClipProp;
protected SerializedProperty showOnceProp;
protected SerializedProperty showAlwaysProp;
protected SerializedProperty showCountProp;
protected virtual void OnEnable()
{
@ -44,7 +45,8 @@ namespace Fungus
characterProp = serializedObject.FindProperty("character");
sayDialogProp = serializedObject.FindProperty("sayDialog");
voiceOverClipProp = serializedObject.FindProperty("voiceOverClip");
showOnceProp = serializedObject.FindProperty("showOnce");
showAlwaysProp = serializedObject.FindProperty("showAlways");
showCountProp = serializedObject.FindProperty("showCount");
}
public override void DrawCommandGUI()
@ -97,10 +99,14 @@ namespace Fungus
new GUIContent("<None>"),
SayDialog.activeDialogs);
EditorGUILayout.PropertyField(voiceOverClipProp,
new GUIContent("Voice Over Clip", "Voice over audio to play when the say text is displayed"));
EditorGUILayout.PropertyField(voiceOverClipProp);
EditorGUILayout.PropertyField(showOnceProp, new GUIContent("Show Once", "Show this text once and never show it again."));
EditorGUILayout.PropertyField(showAlwaysProp);
if (showAlwaysProp.boolValue == false)
{
EditorGUILayout.PropertyField(showCountProp);
}
serializedObject.ApplyModifiedProperties();
}

9
Assets/Fungus/Dialog/Scripts/Commands/Say.cs

@ -25,8 +25,11 @@ namespace Fungus
[Tooltip("Voiceover audio to play when writing the story text")]
public AudioClip voiceOverClip;
[Tooltip("Only show this text once, even if the command is executed again")]
public bool showOnce;
[Tooltip("Always show this Say text when the command is executed multiple times")]
public bool showAlways = true;
[Tooltip("Number of times to show this Say text when the command is executed multiple times")]
public int showCount = 1;
protected int executionCount;
@ -34,7 +37,7 @@ namespace Fungus
public override void OnEnter()
{
if (showOnce && executionCount > 0)
if (!showAlways && executionCount >= showCount)
{
Continue();
return;

Loading…
Cancel
Save