v3.6.1 Documentation
Fungus.Command Class Reference

Base class for Commands. More...

Inheritance diagram for Fungus.Command:
Fungus.BaseLeanTweenCommand Fungus.BaseUnaryMathCommand Fungus.Break Fungus.Call Fungus.CallMethod Fungus.Clamp Fungus.ClearMenu Fungus.Comment Fungus.Condition Fungus.ControlAudio Fungus.ControlWithDisplay< TDisplayEnum > Fungus.Conversation Fungus.DebugLog Fungus.DeleteSaveKey Fungus.Destroy Fungus.Else Fungus.End Fungus.ExecuteLua Fungus.FadeScreen Fungus.FadeSprite Fungus.FadeToView Fungus.Fullscreen Fungus.GetText Fungus.GetToggleState Fungus.InvLerp Fungus.InvokeEvent Fungus.InvokeMethod Fungus.iTweenCommand Fungus.Jump Fungus.Label Fungus.Lerp Fungus.LinkToWebsite Fungus.LoadScene Fungus.LoadVariable Fungus.Map Fungus.Menu Fungus.MenuTimer Fungus.MinMax Fungus.MoveToView Fungus.PlayAnimState Fungus.PlayMusic Fungus.PlaySound Fungus.Pow Fungus.Quit Fungus.RandomFloat Fungus.RandomInteger Fungus.ReadTextFile Fungus.Reset Fungus.ResetAnimTrigger Fungus.SaveVariable Fungus.Say Fungus.SendMessage Fungus.SetActive Fungus.SetAnimBool Fungus.SetAnimFloat Fungus.SetAnimInteger Fungus.SetAnimTrigger Fungus.SetAudioPitch Fungus.SetAudioVolume Fungus.SetClickable2D Fungus.SetCollider Fungus.SetDraggable2D Fungus.SetInteractable Fungus.SetLanguage Fungus.SetMenuDialog Fungus.SetMouseCursor Fungus.SetSaveProfile Fungus.SetSayDialog Fungus.SetSliderValue Fungus.SetSortingLayer Fungus.SetSpriteOrder Fungus.SetText Fungus.SetToggleState Fungus.SetVariable Fungus.ShakeCamera Fungus.ShowSprite Fungus.SpawnObject Fungus.StartSwipe Fungus.Stop Fungus.StopBlock Fungus.StopFlowchart Fungus.StopMusic Fungus.StopSwipe Fungus.StopTween Fungus.StopTweens Fungus.StopTweensLean Fungus.ToInt Fungus.TweenUI Fungus.Wait Fungus.WaitFrames Fungus.Write

Public Member Functions

virtual Flowchart GetFlowchart ()
 Returns the Flowchart that this command belongs to. More...
 
virtual void Execute ()
 Execute the command. More...
 
virtual void Continue ()
 End execution of this command and continue execution at the next command. More...
 
virtual void Continue (int nextCommandIndex)
 End execution of this command and continue execution at a specific command index. More...
 
virtual void StopParentBlock ()
 Stops the parent Block executing. More...
 
virtual void OnStopExecuting ()
 Called when the parent block has been requested to stop executing, and this command is the currently executing command. More...
 
virtual void OnCommandAdded (Block parentBlock)
 Called when the new command is added to a block in the editor. More...
 
virtual void OnCommandRemoved (Block parentBlock)
 Called when the command is deleted from a block in the editor. More...
 
virtual void OnEnter ()
 Called when this command starts execution. More...
 
virtual void OnExit ()
 Called when this command ends execution. More...
 
virtual void OnReset ()
 Called when this command is reset. More...
 
virtual void GetConnectedBlocks (ref List< Block > connectedBlocks)
 Populates a list with the Blocks that this command references. More...
 
virtual bool HasReference (Variable variable)
 Returns true if this command references the variable. More...
 
virtual string GetSummary ()
 Returns the summary text to display in the command inspector. More...
 
virtual string GetHelpText ()
 Returns the help text to display for this command. More...
 
virtual bool OpenBlock ()
 Return true if this command opens a block of commands. More...
 
virtual bool CloseBlock ()
 Return true if this command closes a block of commands. More...
 
virtual Color GetButtonColor ()
 Return the color for the command background in inspector. More...
 
virtual bool IsPropertyVisible (string propertyName)
 Returns true if the specified property should be displayed in the inspector. More...
 
virtual bool IsReorderableArray (string propertyName)
 Returns true if the specified property should be displayed as a reorderable list in the inspector. More...
 
virtual string GetFlowchartLocalizationId ()
 Returns the localization id for the Flowchart that contains this command. More...
 

Protected Attributes

int itemId = -1
 
int indentLevel
 
string errorMessage = ""
 

Properties

virtual int ItemId [get, set]
 Unique identifier for this command. More...
 
virtual string ErrorMessage [get]
 Error message to display in the command inspector. More...
 
virtual int IndentLevel [get, set]
 Indent depth of the current commands. More...
 
virtual int CommandIndex [get, set]
 Index of the command in the parent block's command list. More...
 
virtual bool IsExecuting [get, set]
 Set to true by the parent block while the command is executing. More...
 
virtual float ExecutingIconTimer [get, set]
 Timer used to control appearance of executing icon in inspector. More...
 
virtual Block ParentBlock [get, set]
 Reference to the Block object that this command belongs to. More...
 

Detailed Description

Base class for Commands.

Commands can be added to Blocks to create an execution sequence.

Definition at line 40 of file Command.cs.

Member Function Documentation

◆ CloseBlock()

virtual bool Fungus.Command.CloseBlock ( )
virtual

Return true if this command closes a block of commands.

Used for indenting commands.

Reimplemented in Fungus.Else, Fungus.End, Fungus.ElseIf, and Fungus.LuaElseIf.

Definition at line 232 of file Command.cs.

◆ Continue() [1/2]

virtual void Fungus.Command.Continue ( )
virtual

End execution of this command and continue execution at the next command.

Definition at line 117 of file Command.cs.

◆ Continue() [2/2]

virtual void Fungus.Command.Continue ( int  nextCommandIndex)
virtual

End execution of this command and continue execution at a specific command index.

Parameters
nextCommandIndexNext command index.

Definition at line 130 of file Command.cs.

◆ Execute()

virtual void Fungus.Command.Execute ( )
virtual

Execute the command.

Definition at line 109 of file Command.cs.

◆ GetButtonColor()

virtual Color Fungus.Command.GetButtonColor ( )
virtual

Return the color for the command background in inspector.

Returns
The button color.

Reimplemented in Fungus.InvokeMethod, Fungus.ControlAudio, Fungus.SetVariable, Fungus.ExecuteLua, Fungus.Call, Fungus.InvokeEvent, Fungus.Say, Fungus.Write, Fungus.TweenUI, Fungus.LuaCondition, Fungus.FadeToView, Fungus.BaseLeanTweenCommand, Fungus.iTweenCommand, Fungus.VariableCondition, Fungus.SaveVariable, Fungus.MoveToView, Fungus.LoadVariable, Fungus.SetCollider, Fungus.Menu, Fungus.SetInteractable, Fungus.SendMessage, Fungus.GetText, Fungus.SetText, Fungus.StartSwipe, Fungus.CallMethod, Fungus.Trig, Fungus.ShowSprite, Fungus.Break, Fungus.FadeScreen, Fungus.PlaySound, Fungus.Else, Fungus.ShakeCamera, Fungus.DebugLog, Fungus.FadeSprite, Fungus.SpawnObject, Fungus.SetSpriteOrder, Fungus.Clamp, Fungus.SetSortingLayer, Fungus.MenuTimer, Fungus.ReadTextFile, Fungus.Jump, Fungus.ToInt, Fungus.While, Fungus.Fullscreen, Fungus.Lerp, Fungus.StopFlowchart, Fungus.MinMax, Fungus.SetMouseCursor, Fungus.RandomFloat, Fungus.RandomInteger, Fungus.SetAudioPitch, Fungus.StopBlock, Fungus.SetAudioVolume, Fungus.PlayAnimState, Fungus.PlayMusic, Fungus.Conversation, Fungus.DeleteSaveKey, Fungus.SetAnimBool, Fungus.SetAnimFloat, Fungus.SetAnimInteger, Fungus.LoadScene, Fungus.ResetAnimTrigger, Fungus.SetActive, Fungus.SetAnimTrigger, Fungus.WaitFrames, Fungus.End, Fungus.SetLanguage, Fungus.SetClickable2D, Fungus.SetDraggable2D, Fungus.Destroy, Fungus.Map, Fungus.SetSaveProfile, Fungus.StopTweensLean, Fungus.SetMenuDialog, Fungus.SetSayDialog, Fungus.InvLerp, Fungus.Comment, Fungus.Wait, Fungus.ClearMenu, Fungus.GetToggleState, Fungus.Label, Fungus.SetSliderValue, Fungus.SetToggleState, Fungus.LinkToWebsite, Fungus.Pow, Fungus.ElseIf, Fungus.LuaElseIf, Fungus.Reset, Fungus.StopMusic, Fungus.StopSwipe, Fungus.Quit, Fungus.Stop, Fungus.If, Fungus.LuaIf, and Fungus.BaseUnaryMathCommand.

Definition at line 241 of file Command.cs.

◆ GetConnectedBlocks()

virtual void Fungus.Command.GetConnectedBlocks ( ref List< Block connectedBlocks)
virtual

Populates a list with the Blocks that this command references.

Reimplemented in Fungus.Call, Fungus.Menu, and Fungus.MenuTimer.

Definition at line 193 of file Command.cs.

◆ GetFlowchart()

virtual Flowchart Fungus.Command.GetFlowchart ( )
virtual

Returns the Flowchart that this command belongs to.

Definition at line 95 of file Command.cs.

◆ GetFlowchartLocalizationId()

virtual string Fungus.Command.GetFlowchartLocalizationId ( )
virtual

Returns the localization id for the Flowchart that contains this command.

Definition at line 267 of file Command.cs.

◆ GetHelpText()

virtual string Fungus.Command.GetHelpText ( )
virtual

Returns the help text to display for this command.

Definition at line 216 of file Command.cs.

◆ GetSummary()

virtual string Fungus.Command.GetSummary ( )
virtual

Returns the summary text to display in the command inspector.

Reimplemented in Fungus.InvokeMethod, Fungus.ControlAudio, Fungus.ExecuteLua, Fungus.SetVariable, Fungus.Say, Fungus.Call, Fungus.InvokeEvent, Fungus.Write, Fungus.FadeToView, Fungus.LuaCondition, Fungus.BaseLeanTweenCommand, Fungus.iTweenCommand, Fungus.MoveToView, Fungus.SaveVariable, Fungus.TweenUI, Fungus.LoadVariable, Fungus.SetCollider, Fungus.Menu, Fungus.SendMessage, Fungus.SetText, Fungus.VariableCondition, Fungus.Trig, Fungus.GetText, Fungus.FadeScreen, Fungus.StartSwipe, Fungus.ShakeCamera, Fungus.DebugLog, Fungus.ShowSprite, Fungus.CallMethod, Fungus.Clamp, Fungus.PlaySound, Fungus.FadeSprite, Fungus.ToInt, Fungus.SpawnObject, Fungus.Fullscreen, Fungus.Lerp, Fungus.SetSortingLayer, Fungus.MinMax, Fungus.MenuTimer, Fungus.Jump, Fungus.SetAudioPitch, Fungus.SetInteractable, Fungus.StopBlock, Fungus.SetAudioVolume, Fungus.Conversation, Fungus.Round, Fungus.SetMouseCursor, Fungus.GetToggleState, Fungus.WaitFrames, Fungus.Log, Fungus.PlayAnimState, Fungus.PlayMusic, Fungus.SetLanguage, Fungus.DeleteSaveKey, Fungus.ReadTextFile, Fungus.SetAnimBool, Fungus.SetAnimFloat, Fungus.SetAnimInteger, Fungus.SetSliderValue, Fungus.SetToggleState, Fungus.RandomFloat, Fungus.RandomInteger, Fungus.LoadScene, Fungus.SetSaveProfile, Fungus.Map, Fungus.ResetAnimTrigger, Fungus.SetActive, Fungus.SetAnimTrigger, Fungus.SetSpriteOrder, Fungus.InvLerp, Fungus.SetClickable2D, Fungus.SetDraggable2D, Fungus.Destroy, Fungus.Wait, Fungus.Label, Fungus.StopTweensLean, Fungus.SetMenuDialog, Fungus.SetSayDialog, Fungus.Comment, Fungus.LinkToWebsite, Fungus.ClearMenu, Fungus.Pow, Fungus.Curve, Fungus.Inv, Fungus.Abs, Fungus.Exp, Fungus.Neg, Fungus.Sign, and Fungus.Sqrt.

Definition at line 208 of file Command.cs.

◆ HasReference()

virtual bool Fungus.Command.HasReference ( Variable  variable)
virtual

Returns true if this command references the variable.

Used to highlight variables in the variable list when a command is selected.

Reimplemented in Fungus.SetVariable, Fungus.VariableCondition, Fungus.ReadTextFile, Fungus.RandomFloat, and Fungus.RandomInteger.

Definition at line 200 of file Command.cs.

◆ IsPropertyVisible()

virtual bool Fungus.Command.IsPropertyVisible ( string  propertyName)
virtual

Returns true if the specified property should be displayed in the inspector.

This is useful for hiding certain properties based on the value of another property.

Reimplemented in Fungus.FadeUI.

Definition at line 250 of file Command.cs.

◆ IsReorderableArray()

virtual bool Fungus.Command.IsReorderableArray ( string  propertyName)
virtual

Returns true if the specified property should be displayed as a reorderable list in the inspector.

This only applies for array properties and has no effect for non-array properties.

Reimplemented in Fungus.TweenUI, Fungus.SetInteractable, Fungus.SetSpriteOrder, and Fungus.StopFlowchart.

Definition at line 259 of file Command.cs.

◆ OnCommandAdded()

virtual void Fungus.Command.OnCommandAdded ( Block  parentBlock)
virtual

Called when the new command is added to a block in the editor.

Reimplemented in Fungus.SetInteractable, Fungus.SetSpriteOrder, and Fungus.TweenUI.

Definition at line 163 of file Command.cs.

◆ OnCommandRemoved()

virtual void Fungus.Command.OnCommandRemoved ( Block  parentBlock)
virtual

Called when the command is deleted from a block in the editor.

Definition at line 169 of file Command.cs.

◆ OnEnter()

virtual void Fungus.Command.OnEnter ( )
virtual

Called when this command starts execution.

Reimplemented in Fungus.InvokeMethod, Fungus.ControlAudio, Fungus.ExecuteLua, Fungus.SetVariable, Fungus.InvokeEvent, Fungus.Say, Fungus.Write, Fungus.iTweenCommand, Fungus.FadeToView, Fungus.BaseLeanTweenCommand, Fungus.TweenUI, Fungus.Call, Fungus.MoveToView, Fungus.SetCollider, Fungus.StartSwipe, Fungus.Menu, Fungus.SendMessage, Fungus.Condition, Fungus.SetSortingLayer, Fungus.ShakeCamera, Fungus.Conversation, Fungus.DebugLog, Fungus.ShowSprite, Fungus.WaitFrames, Fungus.FadeScreen, Fungus.CallMethod, Fungus.SetMouseCursor, Fungus.Fullscreen, Fungus.ToInt, Fungus.PlaySound, Fungus.FadeSprite, Fungus.LoadScene, Fungus.SaveVariable, Fungus.SpawnObject, Fungus.Clamp, Fungus.Lerp, Fungus.MinMax, Fungus.Trig, Fungus.PlayAnimState, Fungus.PlayMusic, Fungus.SetSaveProfile, Fungus.SetText, Fungus.SetAnimBool, Fungus.SetAnimFloat, Fungus.SetAnimInteger, Fungus.SetAudioPitch, Fungus.SetAudioVolume, Fungus.LoadVariable, Fungus.MenuTimer, Fungus.RandomFloat, Fungus.RandomInteger, Fungus.Wait, Fungus.GetText, Fungus.Label, Fungus.ResetAnimTrigger, Fungus.SetActive, Fungus.SetAnimTrigger, Fungus.Comment, Fungus.GetToggleState, Fungus.InvLerp, Fungus.ReadTextFile, Fungus.SetInteractable, Fungus.SetLanguage, Fungus.SetSpriteOrder, Fungus.StopFlowchart, Fungus.Round, Fungus.Reset, Fungus.SetClickable2D, Fungus.SetDraggable2D, Fungus.SetSliderValue, Fungus.SetToggleState, Fungus.Destroy, Fungus.Jump, Fungus.Log, Fungus.Map, Fungus.StopBlock, Fungus.StopTween, Fungus.DeleteSaveKey, Fungus.StopTweensLean, Fungus.LinkToWebsite, Fungus.SetMenuDialog, Fungus.SetSayDialog, Fungus.ClearMenu, Fungus.End, Fungus.Pow, Fungus.Break, Fungus.Else, Fungus.Quit, Fungus.Stop, Fungus.StopMusic, Fungus.StopSwipe, Fungus.StopTweens, Fungus.While, Fungus.Curve, Fungus.Abs, Fungus.Exp, Fungus.Inv, Fungus.Neg, Fungus.Sign, and Fungus.Sqrt.

Definition at line 175 of file Command.cs.

◆ OnExit()

virtual void Fungus.Command.OnExit ( )
virtual

Called when this command ends execution.

Definition at line 181 of file Command.cs.

◆ OnReset()

virtual void Fungus.Command.OnReset ( )
virtual

Called when this command is reset.

This happens when the Reset command is used.

Reimplemented in Fungus.Say.

Definition at line 187 of file Command.cs.

◆ OnStopExecuting()

virtual void Fungus.Command.OnStopExecuting ( )
virtual

Called when the parent block has been requested to stop executing, and this command is the currently executing command.

Use this callback to terminate any asynchronous operations and cleanup state so that the command is ready to execute again later on.

Reimplemented in Fungus.Say, Fungus.Write, Fungus.FadeToView, and Fungus.MoveToView.

Definition at line 157 of file Command.cs.

◆ OpenBlock()

virtual bool Fungus.Command.OpenBlock ( )
virtual

Return true if this command opens a block of commands.

Used for indenting commands.

Reimplemented in Fungus.LuaCondition, Fungus.Condition, Fungus.Else, Fungus.While, Fungus.ElseIf, and Fungus.LuaElseIf.

Definition at line 224 of file Command.cs.

◆ StopParentBlock()

virtual void Fungus.Command.StopParentBlock ( )
virtual

Stops the parent Block executing.

Definition at line 142 of file Command.cs.

Member Data Documentation

◆ errorMessage

string Fungus.Command.errorMessage = ""
protected

Definition at line 49 of file Command.cs.

◆ indentLevel

int Fungus.Command.indentLevel
protected

Definition at line 47 of file Command.cs.

◆ itemId

int Fungus.Command.itemId = -1
protected

Definition at line 44 of file Command.cs.

Property Documentation

◆ CommandIndex

virtual int Fungus.Command.CommandIndex
getset

Index of the command in the parent block's command list.

Definition at line 73 of file Command.cs.

◆ ErrorMessage

virtual string Fungus.Command.ErrorMessage
get

Error message to display in the command inspector.

Definition at line 62 of file Command.cs.

◆ ExecutingIconTimer

virtual float Fungus.Command.ExecutingIconTimer
getset

Timer used to control appearance of executing icon in inspector.

Definition at line 83 of file Command.cs.

◆ IndentLevel

virtual int Fungus.Command.IndentLevel
getset

Indent depth of the current commands.

Commands are indented inside If, While, etc. sections.

Definition at line 68 of file Command.cs.

◆ IsExecuting

virtual bool Fungus.Command.IsExecuting
getset

Set to true by the parent block while the command is executing.

Definition at line 78 of file Command.cs.

◆ ItemId

virtual int Fungus.Command.ItemId
getset

Unique identifier for this command.

Unique for this Flowchart.

Definition at line 57 of file Command.cs.

◆ ParentBlock

virtual Block Fungus.Command.ParentBlock
getset

Reference to the Block object that this command belongs to.

This reference is only populated at runtime and in the editor when the block is selected.

Definition at line 90 of file Command.cs.


The documentation for this class was generated from the following file: