diff --git a/Assets/Fungus/Scripts/Commands/Call.cs b/Assets/Fungus/Scripts/Commands/Call.cs index 8797af63..4291c3e9 100644 --- a/Assets/Fungus/Scripts/Commands/Call.cs +++ b/Assets/Fungus/Scripts/Commands/Call.cs @@ -8,6 +8,19 @@ using System; namespace Fungus.Commands { + /// + /// Supported modes for calling a block. + /// + public enum CallMode + { + /// Stop executing the current block after calling. + Stop, + /// Continue executing the current block after calling + Continue, + /// Wait until the called block finishes executing, then continue executing current block. + WaitUntilFinished + } + /// /// Execute another block in the same Flowchart as the command, or in a different Flowchart. /// @@ -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; diff --git a/Assets/Fungus/Scripts/Commands/ControlAudio.cs b/Assets/Fungus/Scripts/Commands/ControlAudio.cs index 8dd076d3..013d25fe 100644 --- a/Assets/Fungus/Scripts/Commands/ControlAudio.cs +++ b/Assets/Fungus/Scripts/Commands/ControlAudio.cs @@ -8,6 +8,23 @@ using Fungus.Variables; namespace Fungus.Commands { + /// + /// The type of audio control to perform. + /// + public enum ControlAudioType + { + /// Play the audiosource once. + PlayOnce, + /// Play the audiosource in a loop. + PlayLoop, + /// Pause a looping audiosource. + PauseLoop, + /// Stop a looping audiosource. + StopLoop, + /// Change the volume level of an audiosource. + ChangeVolume + } + /// /// Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped. /// @@ -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; } diff --git a/Assets/Fungus/Scripts/Commands/ControlStage.cs b/Assets/Fungus/Scripts/Commands/ControlStage.cs index 33be9830..c035a497 100644 --- a/Assets/Fungus/Scripts/Commands/ControlStage.cs +++ b/Assets/Fungus/Scripts/Commands/ControlStage.cs @@ -6,14 +6,24 @@ using Fungus.Utils; namespace Fungus.Commands { + /// + /// Supported display operations for Stage. + /// public enum StageDisplayType { + /// No operation None, + /// Show the stage and all portraits. Show, + /// Hide the stage and all portraits. Hide, + /// Swap the stage and all portraits with another stage. Swap, + /// Move stage to the front. MoveToFront, + /// Undim all portraits on the stage. UndimAllPortraits, + /// Dim all non-speaking portraits on the stage. DimNonSpeakingPortraits } diff --git a/Assets/Fungus/Scripts/Commands/DebugLog.cs b/Assets/Fungus/Scripts/Commands/DebugLog.cs index f34b597d..8834cab6 100644 --- a/Assets/Fungus/Scripts/Commands/DebugLog.cs +++ b/Assets/Fungus/Scripts/Commands/DebugLog.cs @@ -6,6 +6,19 @@ using Fungus.Variables; namespace Fungus.Commands { + /// + /// Type of log message. Maps directly to Unity's log types. + /// + public enum DebugLogType + { + /// Informative log message. + Info, + /// Warning log message. + Warning, + /// Error log message. + Error + } + /// /// Writes a log message to the debug console. /// @@ -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; diff --git a/Assets/Fungus/Scripts/Commands/FadeUI.cs b/Assets/Fungus/Scripts/Commands/FadeUI.cs index aff71a0f..a2caa96f 100644 --- a/Assets/Fungus/Scripts/Commands/FadeUI.cs +++ b/Assets/Fungus/Scripts/Commands/FadeUI.cs @@ -8,6 +8,17 @@ using Fungus.Variables; namespace Fungus.Commands { + /// + /// Select which type of fade will be applied. + /// + public enum FadeMode + { + /// Fade the alpha color component only. + Alpha, + /// Fade all color components (RGBA). + Color + } + /// /// Fades a UI object. /// @@ -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); diff --git a/Assets/Fungus/Scripts/Commands/Fullscreen.cs b/Assets/Fungus/Scripts/Commands/Fullscreen.cs index 0b7f6979..b6578ccd 100644 --- a/Assets/Fungus/Scripts/Commands/Fullscreen.cs +++ b/Assets/Fungus/Scripts/Commands/Fullscreen.cs @@ -5,6 +5,19 @@ using UnityEngine; namespace Fungus.Commands { + /// + /// Fullscreen mode options. + /// + public enum FullscreenMode + { + /// Toggle the current mode between fullscreen and windowed. + Toggle, + /// Switch to fullscreen mode. + Fullscreen, + /// Switch to windowed mode. + Windowed + } + /// /// Sets the application to fullscreen, windowed or toggles the current state. /// @@ -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() diff --git a/Assets/Fungus/Scripts/Commands/InvokeEvent.cs b/Assets/Fungus/Scripts/Commands/InvokeEvent.cs index f9a115ad..e49d37cf 100644 --- a/Assets/Fungus/Scripts/Commands/InvokeEvent.cs +++ b/Assets/Fungus/Scripts/Commands/InvokeEvent.cs @@ -8,6 +8,23 @@ using Fungus.Variables; namespace Fungus.Commands { + /// + /// Supported types of method invocation. + /// + public enum InvokeType + { + /// Call a method with an optional constant value parameter. + Static, // + /// Call a method with an optional boolean constant / variable parameter. + DynamicBoolean, + /// Call a method with an optional integer constant / variable parameter. + DynamicInteger, + /// Call a method with an optional float constant / variable parameter. + DynamicFloat, + /// Call a method with an optional string constant / variable parameter. + DynamicString + } + /// /// 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 {} [Serializable] public class StringEvent : UnityEvent {} - 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; diff --git a/Assets/Fungus/Scripts/Commands/InvokeMethod.cs b/Assets/Fungus/Scripts/Commands/InvokeMethod.cs index 82226680..8bc46786 100644 --- a/Assets/Fungus/Scripts/Commands/InvokeMethod.cs +++ b/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(); } diff --git a/Assets/Fungus/Scripts/Commands/SendMessage.cs b/Assets/Fungus/Scripts/Commands/SendMessage.cs index f87b4340..ae44517a 100644 --- a/Assets/Fungus/Scripts/Commands/SendMessage.cs +++ b/Assets/Fungus/Scripts/Commands/SendMessage.cs @@ -8,6 +8,21 @@ using Fungus.EventHandlers; namespace Fungus.Commands { + /// + /// Supported target types for messages. + /// + public enum MessageTarget + { + /// + /// Send message to the Flowchart containing the SendMessage command. + /// + SameFlowchart, + /// + /// Broadcast message to all Flowcharts. + /// + AllFlowcharts + } + /// /// 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. /// @@ -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; diff --git a/Assets/Fungus/Scripts/Commands/SetVariable.cs b/Assets/Fungus/Scripts/Commands/SetVariable.cs index 02122b80..582b8354 100644 --- a/Assets/Fungus/Scripts/Commands/SetVariable.cs +++ b/Assets/Fungus/Scripts/Commands/SetVariable.cs @@ -6,6 +6,25 @@ using Fungus.Variables; namespace Fungus.Commands { + /// + /// Mathematical operations that can be performed on variables. + /// + public enum SetOperator + { + /// = operator. + Assign, // + /// =! operator. + Negate, + /// += operator. + Add, + /// -= operator. + Subtract, + /// *= operator. + Multiply, + /// /= operator. + Divide + } + /// /// 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. /// @@ -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), diff --git a/Assets/Fungus/Scripts/Commands/Write.cs b/Assets/Fungus/Scripts/Commands/Write.cs index 2a04f9e1..eb0599f8 100644 --- a/Assets/Fungus/Scripts/Commands/Write.cs +++ b/Assets/Fungus/Scripts/Commands/Write.cs @@ -6,6 +6,21 @@ using Fungus.Variables; namespace Fungus.Commands { + /// + /// Text coloring mode for Write command. + /// + public enum TextColor + { + /// Don't change the text color. + Default, + /// Set the text alpha to 1. + SetVisible, + /// Set the text alpha to a value. + SetAlpha, + /// Set the text color to a value. + SetColor + } + /// /// Writes content to a UI Text or Text Mesh object. /// @@ -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); diff --git a/Assets/Fungus/Scripts/Commands/iTweenCommand.cs b/Assets/Fungus/Scripts/Commands/iTweenCommand.cs index 8d5b6136..a3a77dbe 100644 --- a/Assets/Fungus/Scripts/Commands/iTweenCommand.cs +++ b/Assets/Fungus/Scripts/Commands/iTweenCommand.cs @@ -7,12 +7,18 @@ using Fungus.Variables; namespace Fungus.Commands { - + /// + /// Axis to apply the tween on. + /// public enum iTweenAxis { + /// Don't specify an axis. None, + /// Apply the tween on the X axis only. X, + /// Apply the tween on the Y axis only. Y, + /// Apply the tween on the Z axis only. Z } diff --git a/Assets/Fungus/Scripts/Components/DialogInput.cs b/Assets/Fungus/Scripts/Components/DialogInput.cs index e8902ea4..cbbe69bd 100644 --- a/Assets/Fungus/Scripts/Components/DialogInput.cs +++ b/Assets/Fungus/Scripts/Components/DialogInput.cs @@ -6,19 +6,26 @@ using UnityEngine.EventSystems; namespace Fungus { + /// + /// Supported modes for clicking through a Say Dialog. + /// + public enum ClickMode + { + /// Clicking disabled. + Disabled, + /// Click anywhere on screen to advance. + ClickAnywhere, + /// Click anywhere on Say Dialog to advance. + ClickOnDialog, + /// Click on continue button to advance. + ClickOnButton + } + /// /// Input handler for say dialogs. /// 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; diff --git a/Assets/Fungus/Scripts/Components/Writer.cs b/Assets/Fungus/Scripts/Components/Writer.cs index d21506cf..836526f4 100644 --- a/Assets/Fungus/Scripts/Components/Writer.cs +++ b/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 paramList, TextTagToken.TokenType previousTokenType) + protected virtual IEnumerator DoWords(List 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'); } diff --git a/Assets/Fungus/Scripts/Components/WriterAudio.cs b/Assets/Fungus/Scripts/Components/WriterAudio.cs index e8242954..d9d61904 100644 --- a/Assets/Fungus/Scripts/Components/WriterAudio.cs +++ b/Assets/Fungus/Scripts/Components/WriterAudio.cs @@ -6,17 +6,22 @@ using System.Collections.Generic; namespace Fungus { + /// + /// Type of audio effect to play. + /// + public enum AudioMode + { + /// Use short beep sound effects. + Beeps, + /// Use long looping sound effect. + SoundEffect, + } + /// /// Manages audio effects for Dialogs. /// 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; diff --git a/Assets/Fungus/Scripts/Editor/ControlAudioEditor.cs b/Assets/Fungus/Scripts/Editor/ControlAudioEditor.cs index 1603f3d2..383bcebb 100644 --- a/Assets/Fungus/Scripts/Editor/ControlAudioEditor.cs +++ b/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"; diff --git a/Assets/Fungus/Scripts/Editor/InvokeEventEditor.cs b/Assets/Fungus/Scripts/Editor/InvokeEventEditor.cs index f177a034..bb023c8d 100644 --- a/Assets/Fungus/Scripts/Editor/InvokeEventEditor.cs +++ b/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; diff --git a/Assets/Fungus/Scripts/Editor/SetVariableEditor.cs b/Assets/Fungus/Scripts/Editor/SetVariableEditor.cs index a295d999..49f2d2fd 100644 --- a/Assets/Fungus/Scripts/Editor/SetVariableEditor.cs +++ b/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; } } diff --git a/Assets/Fungus/Scripts/Editor/WriteEditor.cs b/Assets/Fungus/Scripts/Editor/WriteEditor.cs index 4027f519..00467edb 100644 --- a/Assets/Fungus/Scripts/Editor/WriteEditor.cs +++ b/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; } diff --git a/Assets/Fungus/Scripts/Editor/WriterAudioEditor.cs b/Assets/Fungus/Scripts/Editor/WriterAudioEditor.cs index 61751342..35c31fb7 100644 --- a/Assets/Fungus/Scripts/Editor/WriterAudioEditor.cs +++ b/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); diff --git a/Assets/Fungus/Scripts/EventHandlers/KeyPressed.cs b/Assets/Fungus/Scripts/EventHandlers/KeyPressed.cs index 034e6658..8d7269f5 100644 --- a/Assets/Fungus/Scripts/EventHandlers/KeyPressed.cs +++ b/Assets/Fungus/Scripts/EventHandlers/KeyPressed.cs @@ -5,6 +5,19 @@ namespace Fungus.EventHandlers { + /// + /// Key press modes supported by Key Pressed event handler. + /// + public enum KeyPressType + { + /// Execute once when the key is pressed down. + KeyDown, + /// Execute once when the key is released + KeyUp, + /// Execute once per frame when key is held down. + KeyRepeat + } + /// /// The block will execute when a key press event occurs. /// @@ -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; diff --git a/Assets/Fungus/Scripts/Interfaces/IBlock.cs b/Assets/Fungus/Scripts/Interfaces/IBlock.cs index ad6f5c6a..b38321a1 100644 --- a/Assets/Fungus/Scripts/Interfaces/IBlock.cs +++ b/Assets/Fungus/Scripts/Interfaces/IBlock.cs @@ -11,7 +11,9 @@ namespace Fungus /// public enum ExecutionState { - Idle, + /// No command executing + Idle, + /// Executing a command Executing, } diff --git a/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs b/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs index 8fe36e14..e6254a10 100644 --- a/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs +++ b/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs @@ -7,14 +7,19 @@ using Fungus.Utils; namespace Fungus { /// - /// Types of display operations supported by portraits + /// Types of display operations supported by portraits. /// public enum DisplayType { + /// Do nothing. None, + /// Show the portrait. Show, + /// Hide the portrait. Hide, + /// Replace the existing portrait. Replace, + /// Move portrait to the front. MoveToFront } @@ -23,8 +28,11 @@ namespace Fungus /// public enum FacingDirection { - None, + /// Unknown direction + None, + /// Facing left. Left, + /// Facing right. Right } @@ -33,8 +41,11 @@ namespace Fungus /// public enum PositionOffset { + /// Unknown offset direction. None, + /// Offset applies to the left. OffsetLeft, + /// Offset applies to the right. OffsetRight } diff --git a/Assets/Fungus/Scripts/Interfaces/IVariable.cs b/Assets/Fungus/Scripts/Interfaces/IVariable.cs index 172bca3c..38ef0bb1 100644 --- a/Assets/Fungus/Scripts/Interfaces/IVariable.cs +++ b/Assets/Fungus/Scripts/Interfaces/IVariable.cs @@ -3,14 +3,23 @@ namespace Fungus { + /// + /// Standard comparison operators. + /// public enum CompareOperator { - Equals, // == - NotEquals, // != - LessThan, // < - GreaterThan, // > - LessThanOrEquals, // <= - GreaterThanOrEquals // >= + /// == mathematical operator. + Equals, + /// != mathematical operator. + NotEquals, + /// < mathematical operator. + LessThan, + /// > mathematical operator. + GreaterThan, + /// <= mathematical operator. + LessThanOrEquals, + /// >= mathematical operator. + GreaterThanOrEquals } /// @@ -18,7 +27,9 @@ namespace Fungus /// public enum VariableScope { + /// Can only be accessed by commands in the same Flowchart. Private, + /// Can be accessed from any command in any Flowchart. Public } diff --git a/Assets/Fungus/Scripts/Utils/TextTagParser.cs b/Assets/Fungus/Scripts/Utils/TextTagParser.cs index 208df57a..868d9140 100644 --- a/Assets/Fungus/Scripts/Utils/TextTagParser.cs +++ b/Assets/Fungus/Scripts/Utils/TextTagParser.cs @@ -45,7 +45,7 @@ namespace Fungus.Utils protected virtual void AddWordsToken(List tokenList, string words) { TextTagToken token = new TextTagToken(); - token.type = TextTagToken.TokenType.Words; + token.type = TokenType.Words; token.paramList = new List(); 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 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; } diff --git a/Assets/Fungus/Scripts/Utils/TextTagToken.cs b/Assets/Fungus/Scripts/Utils/TextTagToken.cs index fb139eb4..12c8e202 100644 --- a/Assets/Fungus/Scripts/Utils/TextTagToken.cs +++ b/Assets/Fungus/Scripts/Utils/TextTagToken.cs @@ -5,41 +5,82 @@ using System.Collections.Generic; namespace Fungus.Utils { - public class TextTagToken + /// + /// Supported token types for use in Say / Write text. + /// + 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} - } + /// Invalid token type. + Invalid, + /// A string of words. + Words, + /// b + BoldStart, // + /// /b + BoldEnd, + /// i + ItalicStart, + /// /i + ItalicEnd, + /// color=red + ColorStart, + /// /color + ColorEnd, + /// size=20 + SizeStart, + /// /size + SizeEnd, + /// w, w=0.5 + Wait, + /// wi + WaitForInputNoClear, + /// wc + WaitForInputAndClear, + /// wp, wp=0.5 + WaitOnPunctuationStart, + /// /wp + WaitOnPunctuationEnd, + /// c + Clear, + /// s, s=60 + SpeedStart, + /// /s + SpeedEnd, + /// x + Exit, + /// m=MessageName + Message, + /// vpunch=0.5 + VerticalPunch, + /// hpunch=0.5 + HorizontalPunch, + /// punch=0.5 + Punch, + /// flash=0.5 + Flash, + /// audio=Sound + Audio, + /// audioloop=Sound + AudioLoop, + /// audiopause=Sound + AudioPause, + /// audiostop=Sound + AudioStop + } + /// + /// Represents a token of story text. The text is broken into a list of tokens. + /// + public class TextTagToken + { + /// + /// The type of the token. + /// public TokenType type = TokenType.Invalid; + + /// + /// List of comma separated parameters. + /// public List paramList; } } \ No newline at end of file diff --git a/Assets/Tests/UI/Editor/TextTagParserTests.cs b/Assets/Tests/UI/Editor/TextTagParserTests.cs index 9f308ff6..290ec9ab 100644 --- a/Assets/Tests/UI/Editor/TextTagParserTests.cs +++ b/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 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);