Browse Source

Documented all enum values. Moved all enums to namespace scope.

master
Christopher 8 years ago
parent
commit
47b946b306
  1. 20
      Assets/Fungus/Scripts/Commands/Call.cs
  2. 46
      Assets/Fungus/Scripts/Commands/ControlAudio.cs
  3. 10
      Assets/Fungus/Scripts/Commands/ControlStage.cs
  4. 20
      Assets/Fungus/Scripts/Commands/DebugLog.cs
  5. 17
      Assets/Fungus/Scripts/Commands/FadeUI.cs
  6. 20
      Assets/Fungus/Scripts/Commands/Fullscreen.cs
  7. 26
      Assets/Fungus/Scripts/Commands/InvokeEvent.cs
  8. 8
      Assets/Fungus/Scripts/Commands/InvokeMethod.cs
  9. 21
      Assets/Fungus/Scripts/Commands/SendMessage.cs
  10. 29
      Assets/Fungus/Scripts/Commands/SetVariable.cs
  11. 23
      Assets/Fungus/Scripts/Commands/Write.cs
  12. 8
      Assets/Fungus/Scripts/Commands/iTweenCommand.cs
  13. 23
      Assets/Fungus/Scripts/Components/DialogInput.cs
  14. 62
      Assets/Fungus/Scripts/Components/Writer.cs
  15. 17
      Assets/Fungus/Scripts/Components/WriterAudio.cs
  16. 4
      Assets/Fungus/Scripts/Editor/ControlAudioEditor.cs
  17. 12
      Assets/Fungus/Scripts/Editor/InvokeEventEditor.cs
  18. 28
      Assets/Fungus/Scripts/Editor/SetVariableEditor.cs
  19. 10
      Assets/Fungus/Scripts/Editor/WriteEditor.cs
  20. 2
      Assets/Fungus/Scripts/Editor/WriterAudioEditor.cs
  21. 20
      Assets/Fungus/Scripts/EventHandlers/KeyPressed.cs
  22. 4
      Assets/Fungus/Scripts/Interfaces/IBlock.cs
  23. 15
      Assets/Fungus/Scripts/Interfaces/IPortraitController.cs
  24. 23
      Assets/Fungus/Scripts/Interfaces/IVariable.cs
  25. 70
      Assets/Fungus/Scripts/Utils/TextTagParser.cs
  26. 105
      Assets/Fungus/Scripts/Utils/TextTagToken.cs
  27. 84
      Assets/Tests/UI/Editor/TextTagParserTests.cs

20
Assets/Fungus/Scripts/Commands/Call.cs

@ -8,6 +8,19 @@ using System;
namespace Fungus.Commands
{
/// <summary>
/// Supported modes for calling a block.
/// </summary>
public enum CallMode
{
/// <summary> Stop executing the current block after calling. </summary>
Stop,
/// <summary> Continue executing the current block after calling </summary>
Continue,
/// <summary> Wait until the called block finishes executing, then continue executing current block. </summary>
WaitUntilFinished
}
/// <summary>
/// Execute another block in the same Flowchart as the command, or in a different Flowchart.
/// </summary>
@ -17,13 +30,6 @@ namespace Fungus.Commands
[AddComponentMenu("")]
public class Call : Command
{
public enum CallMode
{
Stop, // Stop executing the current block after calling
Continue, // Continue executing the current block after calling
WaitUntilFinished // Wait until the called block finishes executing, then continue executing current block
}
[Tooltip("Flowchart which contains the block to execute. If none is specified then the current Flowchart is used.")]
[SerializeField] protected Flowchart targetFlowchart;

46
Assets/Fungus/Scripts/Commands/ControlAudio.cs

@ -8,6 +8,23 @@ using Fungus.Variables;
namespace Fungus.Commands
{
/// <summary>
/// The type of audio control to perform.
/// </summary>
public enum ControlAudioType
{
/// <summary> Play the audiosource once. </summary>
PlayOnce,
/// <summary> Play the audiosource in a loop. </summary>
PlayLoop,
/// <summary> Pause a looping audiosource. </summary>
PauseLoop,
/// <summary> Stop a looping audiosource. </summary>
StopLoop,
/// <summary> Change the volume level of an audiosource. </summary>
ChangeVolume
}
/// <summary>
/// Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped.
/// </summary>
@ -17,18 +34,9 @@ namespace Fungus.Commands
[ExecuteInEditMode]
public class ControlAudio : Command
{
public enum ControlType
{
PlayOnce,
PlayLoop,
PauseLoop,
StopLoop,
ChangeVolume
}
[Tooltip("What to do to audio")]
[SerializeField] protected ControlType control;
public virtual ControlType Control { get { return control; } }
[SerializeField] protected ControlAudioType control;
public virtual ControlAudioType Control { get { return control; } }
[Tooltip("Audio clip to play")]
[SerializeField] protected AudioSourceData _audioSource;
@ -55,28 +63,28 @@ namespace Fungus.Commands
return;
}
if (control != ControlType.ChangeVolume)
if (control != ControlAudioType.ChangeVolume)
{
_audioSource.Value.volume = endVolume;
}
switch(control)
{
case ControlType.PlayOnce:
case ControlAudioType.PlayOnce:
StopAudioWithSameTag();
PlayOnce();
break;
case ControlType.PlayLoop:
case ControlAudioType.PlayLoop:
StopAudioWithSameTag();
PlayLoop();
break;
case ControlType.PauseLoop:
case ControlAudioType.PauseLoop:
PauseLoop();
break;
case ControlType.StopLoop:
case ControlAudioType.StopLoop:
StopLoop(_audioSource.Value);
break;
case ControlType.ChangeVolume:
case ControlAudioType.ChangeVolume:
ChangeVolume();
break;
}
@ -256,11 +264,11 @@ namespace Fungus.Commands
if (fadeDuration > 0)
{
fadeType = " Fade out";
if (control != ControlType.StopLoop)
if (control != ControlAudioType.StopLoop)
{
fadeType = " Fade in volume to " + endVolume;
}
if (control == ControlType.ChangeVolume)
if (control == ControlAudioType.ChangeVolume)
{
fadeType = " to " + endVolume;
}

10
Assets/Fungus/Scripts/Commands/ControlStage.cs

@ -6,14 +6,24 @@ using Fungus.Utils;
namespace Fungus.Commands
{
/// <summary>
/// Supported display operations for Stage.
/// </summary>
public enum StageDisplayType
{
/// <summary> No operation </summary>
None,
/// <summary> Show the stage and all portraits. </summary>
Show,
/// <summary> Hide the stage and all portraits. </summary>
Hide,
/// <summary> Swap the stage and all portraits with another stage. </summary>
Swap,
/// <summary> Move stage to the front. </summary>
MoveToFront,
/// <summary> Undim all portraits on the stage. </summary>
UndimAllPortraits,
/// <summary> Dim all non-speaking portraits on the stage. </summary>
DimNonSpeakingPortraits
}

20
Assets/Fungus/Scripts/Commands/DebugLog.cs

@ -6,6 +6,19 @@ using Fungus.Variables;
namespace Fungus.Commands
{
/// <summary>
/// Type of log message. Maps directly to Unity's log types.
/// </summary>
public enum DebugLogType
{
/// <summary> Informative log message. </summary>
Info,
/// <summary> Warning log message. </summary>
Warning,
/// <summary> Error log message. </summary>
Error
}
/// <summary>
/// Writes a log message to the debug console.
/// </summary>
@ -15,13 +28,6 @@ namespace Fungus.Commands
[AddComponentMenu("")]
public class DebugLog : Command
{
public enum DebugLogType
{
Info,
Warning,
Error
}
[Tooltip("Display type of debug log info")]
[SerializeField] protected DebugLogType logType;

17
Assets/Fungus/Scripts/Commands/FadeUI.cs

@ -8,6 +8,17 @@ using Fungus.Variables;
namespace Fungus.Commands
{
/// <summary>
/// Select which type of fade will be applied.
/// </summary>
public enum FadeMode
{
/// <summary> Fade the alpha color component only. </summary>
Alpha,
/// <summary> Fade all color components (RGBA). </summary>
Color
}
/// <summary>
/// Fades a UI object.
/// </summary>
@ -16,12 +27,6 @@ namespace Fungus.Commands
"Fades a UI object")]
public class FadeUI : TweenUI
{
public enum FadeMode
{
Alpha,
Color
}
[SerializeField] protected FadeMode fadeMode = FadeMode.Alpha;
[SerializeField] protected ColorData targetColor = new ColorData(Color.white);

20
Assets/Fungus/Scripts/Commands/Fullscreen.cs

@ -5,6 +5,19 @@ using UnityEngine;
namespace Fungus.Commands
{
/// <summary>
/// Fullscreen mode options.
/// </summary>
public enum FullscreenMode
{
/// <summary> Toggle the current mode between fullscreen and windowed. </summary>
Toggle,
/// <summary> Switch to fullscreen mode. </summary>
Fullscreen,
/// <summary> Switch to windowed mode. </summary>
Windowed
}
/// <summary>
/// Sets the application to fullscreen, windowed or toggles the current state.
/// </summary>
@ -14,13 +27,6 @@ namespace Fungus.Commands
[AddComponentMenu("")]
public class Fullscreen : Command
{
public enum FullscreenMode
{
Toggle,
Fullscreen,
Windowed
}
[SerializeField] protected FullscreenMode fullscreenMode;
public override void OnEnter()

26
Assets/Fungus/Scripts/Commands/InvokeEvent.cs

@ -8,6 +8,23 @@ using Fungus.Variables;
namespace Fungus.Commands
{
/// <summary>
/// Supported types of method invocation.
/// </summary>
public enum InvokeType
{
/// <summary> Call a method with an optional constant value parameter. </summary>
Static, //
/// <summary> Call a method with an optional boolean constant / variable parameter. </summary>
DynamicBoolean,
/// <summary> Call a method with an optional integer constant / variable parameter. </summary>
DynamicInteger,
/// <summary> Call a method with an optional float constant / variable parameter. </summary>
DynamicFloat,
/// <summary> Call a method with an optional string constant / variable parameter. </summary>
DynamicString
}
/// <summary>
/// Calls a list of component methods via the Unity Event System (as used in the Unity UI)
/// This command is more efficient than the Invoke Method command but can only pass a single parameter and doesn't support return values.
@ -25,15 +42,6 @@ namespace Fungus.Commands
[Serializable] public class FloatEvent : UnityEvent<float> {}
[Serializable] public class StringEvent : UnityEvent<string> {}
public enum InvokeType
{
Static, // Call a method with an optional constant value parameter
DynamicBoolean, // Call a method with an optional boolean constant / variable parameter
DynamicInteger, // Call a method with an optional integer constant / variable parameter
DynamicFloat, // Call a method with an optional float constant / variable parameter
DynamicString // Call a method with an optional string constant / variable parameter
}
[Tooltip("Delay (in seconds) before the methods will be called")]
[SerializeField] protected float delay;

8
Assets/Fungus/Scripts/Commands/InvokeMethod.cs

@ -66,7 +66,7 @@ namespace Fungus.Commands
[HideInInspector]
[Tooltip("The coroutine call behavior for methods that return IEnumerator")]
[SerializeField] protected Call.CallMode callMode;
[SerializeField] protected CallMode callMode;
protected Type componentType;
protected Component objComponent;
@ -121,11 +121,11 @@ namespace Fungus.Commands
{
StartCoroutine(ExecuteCoroutine());
if (callMode == Call.CallMode.Continue)
if (callMode == CallMode.Continue)
{
Continue();
}
else if(callMode == Call.CallMode.Stop)
else if(callMode == CallMode.Stop)
{
StopParentBlock();
}
@ -141,7 +141,7 @@ namespace Fungus.Commands
{
yield return StartCoroutine((IEnumerator)objMethod.Invoke(objComponent, GetParameterValues()));
if (callMode == Call.CallMode.WaitUntilFinished)
if (callMode == CallMode.WaitUntilFinished)
{
Continue();
}

21
Assets/Fungus/Scripts/Commands/SendMessage.cs

@ -8,6 +8,21 @@ using Fungus.EventHandlers;
namespace Fungus.Commands
{
/// <summary>
/// Supported target types for messages.
/// </summary>
public enum MessageTarget
{
/// <summary>
/// Send message to the Flowchart containing the SendMessage command.
/// </summary>
SameFlowchart,
/// <summary>
/// Broadcast message to all Flowcharts.
/// </summary>
AllFlowcharts
}
/// <summary>
/// Sends a message to either the owner Flowchart or all Flowcharts in the scene. Blocks can listen for this message using a Message Received event handler.
/// </summary>
@ -18,12 +33,6 @@ namespace Fungus.Commands
[ExecuteInEditMode]
public class SendMessage : Command
{
public enum MessageTarget
{
SameFlowchart,
AllFlowcharts
}
[Tooltip("Target flowchart(s) to send the message to")]
[SerializeField] protected MessageTarget messageTarget;

29
Assets/Fungus/Scripts/Commands/SetVariable.cs

@ -6,6 +6,25 @@ using Fungus.Variables;
namespace Fungus.Commands
{
/// <summary>
/// Mathematical operations that can be performed on variables.
/// </summary>
public enum SetOperator
{
/// <summary> = operator. </summary>
Assign, //
/// <summary> =! operator. </summary>
Negate,
/// <summary> += operator. </summary>
Add,
/// <summary> -= operator. </summary>
Subtract,
/// <summary> *= operator. </summary>
Multiply,
/// <summary> /= operator. </summary>
Divide
}
/// <summary>
/// Sets a Boolean, Integer, Float or String variable to a new value using a simple arithmetic operation. The value can be a constant or reference another variable of the same type.
/// </summary>
@ -15,16 +34,6 @@ namespace Fungus.Commands
[AddComponentMenu("")]
public class SetVariable : Command
{
public enum SetOperator
{
Assign, // =
Negate, // =!
Add, // +=
Subtract, // -=
Multiply, // *=
Divide // /=
}
[Tooltip("The variable whos value will be set")]
[VariableProperty(typeof(BooleanVariable),
typeof(IntegerVariable),

23
Assets/Fungus/Scripts/Commands/Write.cs

@ -6,6 +6,21 @@ using Fungus.Variables;
namespace Fungus.Commands
{
/// <summary>
/// Text coloring mode for Write command.
/// </summary>
public enum TextColor
{
/// <summary> Don't change the text color. </summary>
Default,
/// <summary> Set the text alpha to 1. </summary>
SetVisible,
/// <summary> Set the text alpha to a value. </summary>
SetAlpha,
/// <summary> Set the text color to a value. </summary>
SetColor
}
/// <summary>
/// Writes content to a UI Text or Text Mesh object.
/// </summary>
@ -30,14 +45,6 @@ namespace Fungus.Commands
[Tooltip("Wait until this command finishes before executing the next command")]
[SerializeField] protected bool waitUntilFinished = true;
public enum TextColor
{
Default,
SetVisible,
SetAlpha,
SetColor
}
[SerializeField] protected TextColor textColor = TextColor.Default;
[SerializeField] protected FloatData setAlpha = new FloatData(1f);

8
Assets/Fungus/Scripts/Commands/iTweenCommand.cs

@ -7,12 +7,18 @@ using Fungus.Variables;
namespace Fungus.Commands
{
/// <summary>
/// Axis to apply the tween on.
/// </summary>
public enum iTweenAxis
{
/// <summary> Don't specify an axis. </summary>
None,
/// <summary> Apply the tween on the X axis only. </summary>
X,
/// <summary> Apply the tween on the Y axis only. </summary>
Y,
/// <summary> Apply the tween on the Z axis only. </summary>
Z
}

23
Assets/Fungus/Scripts/Components/DialogInput.cs

@ -6,19 +6,26 @@ using UnityEngine.EventSystems;
namespace Fungus
{
/// <summary>
/// Supported modes for clicking through a Say Dialog.
/// </summary>
public enum ClickMode
{
/// <summary> Clicking disabled. </summary>
Disabled,
/// <summary> Click anywhere on screen to advance. </summary>
ClickAnywhere,
/// <summary> Click anywhere on Say Dialog to advance. </summary>
ClickOnDialog,
/// <summary> Click on continue button to advance. </summary>
ClickOnButton
}
/// <summary>
/// Input handler for say dialogs.
/// </summary>
public class DialogInput : MonoBehaviour, IDialogInput
{
public enum ClickMode
{
Disabled, // Clicking disabled
ClickAnywhere, // Click anywhere on screen to advance
ClickOnDialog, // Click anywhere on Say Dialog to advance
ClickOnButton // Click on continue button to advance
}
[Tooltip("Click to advance story")]
[SerializeField] protected ClickMode clickMode;

62
Assets/Fungus/Scripts/Components/Writer.cs

@ -297,34 +297,34 @@ namespace Fungus
exitFlag = false;
isWriting = true;
TextTagToken.TokenType previousTokenType = TextTagToken.TokenType.Invalid;
TokenType previousTokenType = TokenType.Invalid;
foreach (TextTagToken token in tokens)
{
switch (token.type)
{
case TextTagToken.TokenType.Words:
case TokenType.Words:
yield return StartCoroutine(DoWords(token.paramList, previousTokenType));
break;
case TextTagToken.TokenType.BoldStart:
case TokenType.BoldStart:
boldActive = true;
break;
case TextTagToken.TokenType.BoldEnd:
case TokenType.BoldEnd:
boldActive = false;
break;
case TextTagToken.TokenType.ItalicStart:
case TokenType.ItalicStart:
italicActive = true;
break;
case TextTagToken.TokenType.ItalicEnd:
case TokenType.ItalicEnd:
italicActive = false;
break;
case TextTagToken.TokenType.ColorStart:
case TokenType.ColorStart:
if (CheckParamCount(token.paramList, 1))
{
colorActive = true;
@ -332,66 +332,66 @@ namespace Fungus
}
break;
case TextTagToken.TokenType.ColorEnd:
case TokenType.ColorEnd:
colorActive = false;
break;
case TextTagToken.TokenType.SizeStart:
case TokenType.SizeStart:
if (TryGetSingleParam(token.paramList, 0, 16f, out sizeValue))
{
sizeActive = true;
}
break;
case TextTagToken.TokenType.SizeEnd:
case TokenType.SizeEnd:
sizeActive = false;
break;
case TextTagToken.TokenType.Wait:
case TokenType.Wait:
yield return StartCoroutine(DoWait(token.paramList));
break;
case TextTagToken.TokenType.WaitForInputNoClear:
case TokenType.WaitForInputNoClear:
yield return StartCoroutine(DoWaitForInput(false));
break;
case TextTagToken.TokenType.WaitForInputAndClear:
case TokenType.WaitForInputAndClear:
yield return StartCoroutine(DoWaitForInput(true));
break;
case TextTagToken.TokenType.WaitOnPunctuationStart:
case TokenType.WaitOnPunctuationStart:
TryGetSingleParam(token.paramList, 0, punctuationPause, out currentPunctuationPause);
break;
case TextTagToken.TokenType.WaitOnPunctuationEnd:
case TokenType.WaitOnPunctuationEnd:
currentPunctuationPause = punctuationPause;
break;
case TextTagToken.TokenType.Clear:
case TokenType.Clear:
text = "";
break;
case TextTagToken.TokenType.SpeedStart:
case TokenType.SpeedStart:
TryGetSingleParam(token.paramList, 0, writingSpeed, out currentWritingSpeed);
break;
case TextTagToken.TokenType.SpeedEnd:
case TokenType.SpeedEnd:
currentWritingSpeed = writingSpeed;
break;
case TextTagToken.TokenType.Exit:
case TokenType.Exit:
exitFlag = true;
break;
case TextTagToken.TokenType.Message:
case TokenType.Message:
if (CheckParamCount(token.paramList, 1))
{
Flowchart.BroadcastFungusMessage(token.paramList[0]);
}
break;
case TextTagToken.TokenType.VerticalPunch:
case TokenType.VerticalPunch:
{
float vintensity;
float time;
@ -401,7 +401,7 @@ namespace Fungus
}
break;
case TextTagToken.TokenType.HorizontalPunch:
case TokenType.HorizontalPunch:
{
float hintensity;
float time;
@ -411,7 +411,7 @@ namespace Fungus
}
break;
case TextTagToken.TokenType.Punch:
case TokenType.Punch:
{
float intensity;
float time;
@ -421,13 +421,13 @@ namespace Fungus
}
break;
case TextTagToken.TokenType.Flash:
case TokenType.Flash:
float flashDuration;
TryGetSingleParam(token.paramList, 0, 0.2f, out flashDuration);
Flash(flashDuration);
break;
case TextTagToken.TokenType.Audio:
case TokenType.Audio:
{
AudioSource audioSource = null;
if (CheckParamCount(token.paramList, 1))
@ -441,7 +441,7 @@ namespace Fungus
}
break;
case TextTagToken.TokenType.AudioLoop:
case TokenType.AudioLoop:
{
AudioSource audioSource = null;
if (CheckParamCount(token.paramList, 1))
@ -456,7 +456,7 @@ namespace Fungus
}
break;
case TextTagToken.TokenType.AudioPause:
case TokenType.AudioPause:
{
AudioSource audioSource = null;
if (CheckParamCount(token.paramList, 1))
@ -470,7 +470,7 @@ namespace Fungus
}
break;
case TextTagToken.TokenType.AudioStop:
case TokenType.AudioStop:
{
AudioSource audioSource = null;
if (CheckParamCount(token.paramList, 1))
@ -506,7 +506,7 @@ namespace Fungus
}
}
protected virtual IEnumerator DoWords(List<string> paramList, TextTagToken.TokenType previousTokenType)
protected virtual IEnumerator DoWords(List<string> paramList, TokenType previousTokenType)
{
if (!CheckParamCount(paramList, 1))
{
@ -516,8 +516,8 @@ namespace Fungus
string param = paramList[0];
// Trim whitespace after a {wc} or {c} tag
if (previousTokenType == TextTagToken.TokenType.WaitForInputAndClear ||
previousTokenType == TextTagToken.TokenType.Clear)
if (previousTokenType == TokenType.WaitForInputAndClear ||
previousTokenType == TokenType.Clear)
{
param = param.TrimStart(' ', '\t', '\r', '\n');
}

17
Assets/Fungus/Scripts/Components/WriterAudio.cs

@ -6,17 +6,22 @@ using System.Collections.Generic;
namespace Fungus
{
/// <summary>
/// Type of audio effect to play.
/// </summary>
public enum AudioMode
{
/// <summary> Use short beep sound effects. </summary>
Beeps,
/// <summary> Use long looping sound effect. </summary>
SoundEffect,
}
/// <summary>
/// Manages audio effects for Dialogs.
/// </summary>
public class WriterAudio : MonoBehaviour, IWriterListener
{
public enum AudioMode
{
Beeps, // Use short beep sound effects
SoundEffect, // Use long looping sound effect
}
[Tooltip("Volume level of writing sound effects")]
[Range(0,1)]
[SerializeField] protected float volume = 1f;

4
Assets/Fungus/Scripts/Editor/ControlAudioEditor.cs

@ -40,11 +40,11 @@ namespace Fungus.EditorUtils
EditorGUILayout.PropertyField(controlProp);
EditorGUILayout.PropertyField(audioSourceProp);
string fadeLabel = "Fade Out Duration";
if (t.Control != ControlAudio.ControlType.StopLoop && t.Control != ControlAudio.ControlType.PauseLoop)
if (t.Control != ControlAudioType.StopLoop && t.Control != ControlAudioType.PauseLoop)
{
fadeLabel = "Fade In Duration";
string volumeLabel = "End Volume";
if (t.Control == ControlAudio.ControlType.ChangeVolume)
if (t.Control == ControlAudioType.ChangeVolume)
{
fadeLabel = "Fade Duration";
volumeLabel = "New Volume";

12
Assets/Fungus/Scripts/Editor/InvokeEventEditor.cs

@ -46,24 +46,24 @@ namespace Fungus.EditorUtils
EditorGUILayout.PropertyField(delayProp);
EditorGUILayout.PropertyField(invokeTypeProp);
switch ((InvokeEvent.InvokeType)invokeTypeProp.enumValueIndex)
switch ((InvokeType)invokeTypeProp.enumValueIndex)
{
case InvokeEvent.InvokeType.Static:
case InvokeType.Static:
EditorGUILayout.PropertyField(staticEventProp);
break;
case InvokeEvent.InvokeType.DynamicBoolean:
case InvokeType.DynamicBoolean:
EditorGUILayout.PropertyField(booleanEventProp);
EditorGUILayout.PropertyField(booleanParameterProp);
break;
case InvokeEvent.InvokeType.DynamicInteger:
case InvokeType.DynamicInteger:
EditorGUILayout.PropertyField(integerEventProp);
EditorGUILayout.PropertyField(integerParameterProp);
break;
case InvokeEvent.InvokeType.DynamicFloat:
case InvokeType.DynamicFloat:
EditorGUILayout.PropertyField(floatEventProp);
EditorGUILayout.PropertyField(floatParameterProp);
break;
case InvokeEvent.InvokeType.DynamicString:
case InvokeType.DynamicString:
EditorGUILayout.PropertyField(stringEventProp);
EditorGUILayout.PropertyField(stringParameterProp);
break;

28
Assets/Fungus/Scripts/Editor/SetVariableEditor.cs

@ -75,29 +75,29 @@ namespace Fungus.EditorUtils
switch (t._SetOperator)
{
default:
case SetVariable.SetOperator.Assign:
case SetOperator.Assign:
selectedIndex = 0;
break;
case SetVariable.SetOperator.Negate:
case SetOperator.Negate:
selectedIndex = 1;
break;
case SetVariable.SetOperator.Add:
case SetOperator.Add:
selectedIndex = 1;
break;
case SetVariable.SetOperator.Subtract:
case SetOperator.Subtract:
selectedIndex = 2;
break;
case SetVariable.SetOperator.Multiply:
case SetOperator.Multiply:
selectedIndex = 3;
break;
case SetVariable.SetOperator.Divide:
case SetOperator.Divide:
selectedIndex = 4;
break;
}
selectedIndex = EditorGUILayout.Popup(new GUIContent("Operation", "Arithmetic operator to use"), selectedIndex, operatorsList.ToArray());
SetVariable.SetOperator setOperator = SetVariable.SetOperator.Assign;
SetOperator setOperator = SetOperator.Assign;
if (variableType == typeof(BooleanVariable) ||
variableType == typeof(StringVariable))
{
@ -105,10 +105,10 @@ namespace Fungus.EditorUtils
{
default:
case 0:
setOperator = SetVariable.SetOperator.Assign;
setOperator = SetOperator.Assign;
break;
case 1:
setOperator = SetVariable.SetOperator.Negate;
setOperator = SetOperator.Negate;
break;
}
}
@ -119,19 +119,19 @@ namespace Fungus.EditorUtils
{
default:
case 0:
setOperator = SetVariable.SetOperator.Assign;
setOperator = SetOperator.Assign;
break;
case 1:
setOperator = SetVariable.SetOperator.Add;
setOperator = SetOperator.Add;
break;
case 2:
setOperator = SetVariable.SetOperator.Subtract;
setOperator = SetOperator.Subtract;
break;
case 3:
setOperator = SetVariable.SetOperator.Multiply;
setOperator = SetOperator.Multiply;
break;
case 4:
setOperator = SetVariable.SetOperator.Divide;
setOperator = SetOperator.Divide;
break;
}
}

10
Assets/Fungus/Scripts/Editor/WriteEditor.cs

@ -71,16 +71,16 @@ namespace Fungus.EditorUtils
EditorGUILayout.PropertyField(clearTextProp);
EditorGUILayout.PropertyField(textColorProp);
switch ((Write.TextColor)textColorProp.enumValueIndex)
switch ((TextColor)textColorProp.enumValueIndex)
{
case Write.TextColor.Default:
case TextColor.Default:
break;
case Write.TextColor.SetVisible:
case TextColor.SetVisible:
break;
case Write.TextColor.SetAlpha:
case TextColor.SetAlpha:
EditorGUILayout.PropertyField(setAlphaProp);
break;
case Write.TextColor.SetColor:
case TextColor.SetColor:
EditorGUILayout.PropertyField(setColorProp);
break;
}

2
Assets/Fungus/Scripts/Editor/WriterAudioEditor.cs

@ -39,7 +39,7 @@ namespace Fungus.EditorUtils
EditorGUILayout.PropertyField(inputSoundProp);
EditorGUILayout.PropertyField(audioModeProp);
if ((WriterAudio.AudioMode)audioModeProp.enumValueIndex == WriterAudio.AudioMode.Beeps)
if ((AudioMode)audioModeProp.enumValueIndex == AudioMode.Beeps)
{
ReorderableListGUI.Title(new GUIContent("Beep Sounds", "A list of beep sounds to play at random"));
ReorderableListGUI.ListField(beepSoundsProp);

20
Assets/Fungus/Scripts/EventHandlers/KeyPressed.cs

@ -5,6 +5,19 @@
namespace Fungus.EventHandlers
{
/// <summary>
/// Key press modes supported by Key Pressed event handler.
/// </summary>
public enum KeyPressType
{
/// <summary> Execute once when the key is pressed down. </summary>
KeyDown,
/// <summary> Execute once when the key is released </summary>
KeyUp,
/// <summary> Execute once per frame when key is held down. </summary>
KeyRepeat
}
/// <summary>
/// The block will execute when a key press event occurs.
/// </summary>
@ -14,13 +27,6 @@ namespace Fungus.EventHandlers
[AddComponentMenu("")]
public class KeyPressed : EventHandler
{
public enum KeyPressType
{
KeyDown, // Execute once when the key is pressed down
KeyUp, // Execute once when the key is released
KeyRepeat // Execute once per frame when key is held down
}
[Tooltip("The type of keypress to activate on")]
[SerializeField] protected KeyPressType keyPressType;

4
Assets/Fungus/Scripts/Interfaces/IBlock.cs

@ -11,7 +11,9 @@ namespace Fungus
/// </summary>
public enum ExecutionState
{
Idle,
/// <summary> No command executing </summary>
Idle,
/// <summary> Executing a command </summary>
Executing,
}

15
Assets/Fungus/Scripts/Interfaces/IPortraitController.cs

@ -7,14 +7,19 @@ using Fungus.Utils;
namespace Fungus
{
/// <summary>
/// Types of display operations supported by portraits
/// Types of display operations supported by portraits.
/// </summary>
public enum DisplayType
{
/// <summary> Do nothing. </summary>
None,
/// <summary> Show the portrait. </summary>
Show,
/// <summary> Hide the portrait. </summary>
Hide,
/// <summary> Replace the existing portrait. </summary>
Replace,
/// <summary> Move portrait to the front. </summary>
MoveToFront
}
@ -23,8 +28,11 @@ namespace Fungus
/// </summary>
public enum FacingDirection
{
None,
/// <summary> Unknown direction </summary>
None,
/// <summary> Facing left. </summary>
Left,
/// <summary> Facing right. </summary>
Right
}
@ -33,8 +41,11 @@ namespace Fungus
/// </summary>
public enum PositionOffset
{
/// <summary> Unknown offset direction. </summary>
None,
/// <summary> Offset applies to the left. </summary>
OffsetLeft,
/// <summary> Offset applies to the right. </summary>
OffsetRight
}

23
Assets/Fungus/Scripts/Interfaces/IVariable.cs

@ -3,14 +3,23 @@
namespace Fungus
{
/// <summary>
/// Standard comparison operators.
/// </summary>
public enum CompareOperator
{
Equals, // ==
NotEquals, // !=
LessThan, // <
GreaterThan, // >
LessThanOrEquals, // <=
GreaterThanOrEquals // >=
/// <summary> == mathematical operator.</summary>
Equals,
/// <summary> != mathematical operator.</summary>
NotEquals,
/// <summary> < mathematical operator.</summary>
LessThan,
/// <summary> > mathematical operator.</summary>
GreaterThan,
/// <summary> <= mathematical operator.</summary>
LessThanOrEquals,
/// <summary> >= mathematical operator.</summary>
GreaterThanOrEquals
}
/// <summary>
@ -18,7 +27,9 @@ namespace Fungus
/// </summary>
public enum VariableScope
{
/// <summary> Can only be accessed by commands in the same Flowchart. </summary>
Private,
/// <summary> Can be accessed from any command in any Flowchart. </summary>
Public
}

70
Assets/Fungus/Scripts/Utils/TextTagParser.cs

@ -45,7 +45,7 @@ namespace Fungus.Utils
protected virtual void AddWordsToken(List<TextTagToken> tokenList, string words)
{
TextTagToken token = new TextTagToken();
token.type = TextTagToken.TokenType.Words;
token.type = TokenType.Words;
token.paramList = new List<string>();
token.paramList.Add(words);
tokenList.Add(token);
@ -62,131 +62,131 @@ namespace Fungus.Utils
string tag = tagText.Substring(1, tagText.Length - 2);
var type = TextTagToken.TokenType.Invalid;
var type = TokenType.Invalid;
List<string> parameters = ExtractParameters(tag);
if (tag == "b")
{
type = TextTagToken.TokenType.BoldStart;
type = TokenType.BoldStart;
}
else if (tag == "/b")
{
type = TextTagToken.TokenType.BoldEnd;
type = TokenType.BoldEnd;
}
else if (tag == "i")
{
type = TextTagToken.TokenType.ItalicStart;
type = TokenType.ItalicStart;
}
else if (tag == "/i")
{
type = TextTagToken.TokenType.ItalicEnd;
type = TokenType.ItalicEnd;
}
else if (tag.StartsWith("color="))
{
type = TextTagToken.TokenType.ColorStart;
type = TokenType.ColorStart;
}
else if (tag == "/color")
{
type = TextTagToken.TokenType.ColorEnd;
type = TokenType.ColorEnd;
}
else if (tag.StartsWith("size="))
{
type = TextTagToken.TokenType.SizeStart;
type = TokenType.SizeStart;
}
else if (tag == "/size")
{
type = TextTagToken.TokenType.SizeEnd;
type = TokenType.SizeEnd;
}
else if (tag == "wi")
{
type = TextTagToken.TokenType.WaitForInputNoClear;
type = TokenType.WaitForInputNoClear;
}
if (tag == "wc")
{
type = TextTagToken.TokenType.WaitForInputAndClear;
type = TokenType.WaitForInputAndClear;
}
else if (tag.StartsWith("wp="))
{
type = TextTagToken.TokenType.WaitOnPunctuationStart;
type = TokenType.WaitOnPunctuationStart;
}
else if (tag == "wp")
{
type = TextTagToken.TokenType.WaitOnPunctuationStart;
type = TokenType.WaitOnPunctuationStart;
}
else if (tag == "/wp")
{
type = TextTagToken.TokenType.WaitOnPunctuationEnd;
type = TokenType.WaitOnPunctuationEnd;
}
else if (tag.StartsWith("w="))
{
type = TextTagToken.TokenType.Wait;
type = TokenType.Wait;
}
else if (tag == "w")
{
type = TextTagToken.TokenType.Wait;
type = TokenType.Wait;
}
else if (tag == "c")
{
type = TextTagToken.TokenType.Clear;
type = TokenType.Clear;
}
else if (tag.StartsWith("s="))
{
type = TextTagToken.TokenType.SpeedStart;
type = TokenType.SpeedStart;
}
else if (tag == "s")
{
type = TextTagToken.TokenType.SpeedStart;
type = TokenType.SpeedStart;
}
else if (tag == "/s")
{
type = TextTagToken.TokenType.SpeedEnd;
type = TokenType.SpeedEnd;
}
else if (tag == "x")
{
type = TextTagToken.TokenType.Exit;
type = TokenType.Exit;
}
else if (tag.StartsWith("m="))
{
type = TextTagToken.TokenType.Message;
type = TokenType.Message;
}
else if (tag.StartsWith("vpunch") ||
tag.StartsWith("vpunch="))
{
type = TextTagToken.TokenType.VerticalPunch;
type = TokenType.VerticalPunch;
}
else if (tag.StartsWith("hpunch") ||
tag.StartsWith("hpunch="))
{
type = TextTagToken.TokenType.HorizontalPunch;
type = TokenType.HorizontalPunch;
}
else if (tag.StartsWith("punch") ||
tag.StartsWith("punch="))
{
type = TextTagToken.TokenType.Punch;
type = TokenType.Punch;
}
else if (tag.StartsWith("flash") ||
tag.StartsWith("flash="))
{
type = TextTagToken.TokenType.Flash;
type = TokenType.Flash;
}
else if (tag.StartsWith("audio="))
{
type = TextTagToken.TokenType.Audio;
type = TokenType.Audio;
}
else if (tag.StartsWith("audioloop="))
{
type = TextTagToken.TokenType.AudioLoop;
type = TokenType.AudioLoop;
}
else if (tag.StartsWith("audiopause="))
{
type = TextTagToken.TokenType.AudioPause;
type = TokenType.AudioPause;
}
else if (tag.StartsWith("audiostop="))
{
type = TextTagToken.TokenType.AudioStop;
type = TokenType.AudioStop;
}
if (type != TextTagToken.TokenType.Invalid)
if (type != TokenType.Invalid)
{
TextTagToken token = new TextTagToken();
token.type = type;
@ -261,13 +261,13 @@ namespace Fungus.Utils
foreach (TextTagToken token in tokens)
{
if (trimLeading &&
token.type == TextTagToken.TokenType.Words)
token.type == TokenType.Words)
{
token.paramList[0] = token.paramList[0].TrimStart(' ', '\t', '\r', '\n');
}
if (token.type == TextTagToken.TokenType.Clear ||
token.type == TextTagToken.TokenType.WaitForInputAndClear)
if (token.type == TokenType.Clear ||
token.type == TokenType.WaitForInputAndClear)
{
trimLeading = true;
}

105
Assets/Fungus/Scripts/Utils/TextTagToken.cs

@ -5,41 +5,82 @@ using System.Collections.Generic;
namespace Fungus.Utils
{
public class TextTagToken
/// <summary>
/// Supported token types for use in Say / Write text.
/// </summary>
public enum TokenType
{
public enum TokenType
{
Invalid,
Words, // A string of words
BoldStart, // b
BoldEnd, // /b
ItalicStart, // i
ItalicEnd, // /i
ColorStart, // color=red
ColorEnd, // /color
SizeStart, // size=20
SizeEnd, // /size
Wait, // w, w=0.5
WaitForInputNoClear, // wi
WaitForInputAndClear, // wc
WaitOnPunctuationStart, // wp, wp=0.5
WaitOnPunctuationEnd, // /wp
Clear, // c
SpeedStart, // s, s=60
SpeedEnd, // /s
Exit, // x
Message, // m=MessageName
VerticalPunch, // {vpunch=0.5}
HorizontalPunch, // {hpunch=0.5}
Punch, // {punch=0.5}
Flash, // {flash=0.5}
Audio, // {audio=Sound}
AudioLoop, // {audioloop=Sound}
AudioPause, // {audiopause=Sound}
AudioStop // {audiostop=Sound}
}
/// <summary> Invalid token type. </summary>
Invalid,
/// <summary> A string of words. </summary>
Words,
/// <summary> b </summary>
BoldStart, //
/// <summary> /b </summary>
BoldEnd,
/// <summary> i </summary>
ItalicStart,
/// <summary> /i </summary>
ItalicEnd,
/// <summary> color=red </summary>
ColorStart,
/// <summary> /color </summary>
ColorEnd,
/// <summary> size=20 </summary>
SizeStart,
/// <summary> /size </summary>
SizeEnd,
/// <summary> w, w=0.5 </summary>
Wait,
/// <summary> wi </summary>
WaitForInputNoClear,
/// <summary> wc </summary>
WaitForInputAndClear,
/// <summary> wp, wp=0.5 </summary>
WaitOnPunctuationStart,
/// <summary> /wp </summary>
WaitOnPunctuationEnd,
/// <summary> c </summary>
Clear,
/// <summary> s, s=60 </summary>
SpeedStart,
/// <summary> /s </summary>
SpeedEnd,
/// <summary> x </summary>
Exit,
/// <summary> m=MessageName </summary>
Message,
/// <summary> vpunch=0.5 </summary>
VerticalPunch,
/// <summary> hpunch=0.5 </summary>
HorizontalPunch,
/// <summary> punch=0.5 </summary>
Punch,
/// <summary> flash=0.5 </summary>
Flash,
/// <summary> audio=Sound </summary>
Audio,
/// <summary> audioloop=Sound </summary>
AudioLoop,
/// <summary> audiopause=Sound </summary>
AudioPause,
/// <summary> audiostop=Sound </summary>
AudioStop
}
/// <summary>
/// Represents a token of story text. The text is broken into a list of tokens.
/// </summary>
public class TextTagToken
{
/// <summary>
/// The type of the token.
/// </summary>
public TokenType type = TokenType.Invalid;
/// <summary>
/// List of comma separated parameters.
/// </summary>
public List<string> paramList;
}
}

84
Assets/Tests/UI/Editor/TextTagParserTests.cs

@ -40,139 +40,139 @@ public class TextTagParserTests
"{audiostop=Sound}");
int i = 0;
Assert.That(tokens[i].type == TextTagToken.TokenType.Words);
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "Words ");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.BoldStart);
Assert.That(tokens[i].type == TokenType.BoldStart);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Words);
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "bold test");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.BoldEnd);
Assert.That(tokens[i].type == TokenType.BoldEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.ItalicStart);
Assert.That(tokens[i].type == TokenType.ItalicStart);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Words);
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "italic test");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.ItalicEnd);
Assert.That(tokens[i].type == TokenType.ItalicEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.ColorStart);
Assert.That(tokens[i].type == TokenType.ColorStart);
Assert.That(tokens[i].paramList[0] == "red");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Words);
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "color test");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.ColorEnd);
Assert.That(tokens[i].type == TokenType.ColorEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.SizeStart);
Assert.That(tokens[i].type == TokenType.SizeStart);
Assert.That(tokens[i].paramList[0] == "30");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Words);
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "size test");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.SizeEnd);
Assert.That(tokens[i].type == TokenType.SizeEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Wait);
Assert.That(tokens[i].type == TokenType.Wait);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Wait);
Assert.That(tokens[i].type == TokenType.Wait);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.WaitForInputNoClear);
Assert.That(tokens[i].type == TokenType.WaitForInputNoClear);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.WaitForInputAndClear);
Assert.That(tokens[i].type == TokenType.WaitForInputAndClear);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.WaitOnPunctuationStart);
Assert.That(tokens[i].type == TokenType.WaitOnPunctuationStart);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.WaitOnPunctuationStart);
Assert.That(tokens[i].type == TokenType.WaitOnPunctuationStart);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.WaitOnPunctuationEnd);
Assert.That(tokens[i].type == TokenType.WaitOnPunctuationEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Clear);
Assert.That(tokens[i].type == TokenType.Clear);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.SpeedStart);
Assert.That(tokens[i].type == TokenType.SpeedStart);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.SpeedStart);
Assert.That(tokens[i].type == TokenType.SpeedStart);
Assert.That(tokens[i].paramList[0] == "60");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.SpeedEnd);
Assert.That(tokens[i].type == TokenType.SpeedEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Exit);
Assert.That(tokens[i].type == TokenType.Exit);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Message);
Assert.That(tokens[i].type == TokenType.Message);
Assert.That(tokens[i].paramList[0] == "Message");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.VerticalPunch);
Assert.That(tokens[i].type == TokenType.VerticalPunch);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.HorizontalPunch);
Assert.That(tokens[i].type == TokenType.HorizontalPunch);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Punch);
Assert.That(tokens[i].type == TokenType.Punch);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Flash);
Assert.That(tokens[i].type == TokenType.Flash);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Audio);
Assert.That(tokens[i].type == TokenType.Audio);
Assert.That(tokens[i].paramList[0] == "Sound");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.AudioLoop);
Assert.That(tokens[i].type == TokenType.AudioLoop);
Assert.That(tokens[i].paramList[0] == "Sound");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.AudioPause);
Assert.That(tokens[i].type == TokenType.AudioPause);
Assert.That(tokens[i].paramList[0] == "Sound");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.AudioStop);
Assert.That(tokens[i].type == TokenType.AudioStop);
Assert.That(tokens[i].paramList[0] == "Sound");
Assert.That(tokens.Count == 34);
@ -187,35 +187,35 @@ public class TextTagParserTests
List<TextTagToken> tokens = textTagParser.Tokenize("Play sound{audio=BeepSound}{w=1} Play loop{audioloop=BeepSound}{w=3} Stop{audiostop=BeepSound}");
int i = 0;
Assert.That(tokens[i].type == TextTagToken.TokenType.Words);
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "Play sound");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Audio);
Assert.That(tokens[i].type == TokenType.Audio);
Assert.That(tokens[i].paramList[0] == "BeepSound");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Wait);
Assert.That(tokens[i].type == TokenType.Wait);
Assert.That(tokens[i].paramList[0] == "1");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Words);
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == " Play loop");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.AudioLoop);
Assert.That(tokens[i].type == TokenType.AudioLoop);
Assert.That(tokens[i].paramList[0] == "BeepSound");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Wait);
Assert.That(tokens[i].type == TokenType.Wait);
Assert.That(tokens[i].paramList[0] == "3");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.Words);
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == " Stop");
i++;
Assert.That(tokens[i].type == TextTagToken.TokenType.AudioStop);
Assert.That(tokens[i].type == TokenType.AudioStop);
Assert.That(tokens[i].paramList[0] == "BeepSound");
Assert.That(tokens.Count == 8);

Loading…
Cancel
Save