Class StateToggle
A helper component designed for quickly allowing control over a StateMachine by hooking it up to Toggles through dynamic function assignment. The Toggle would also respond to changes made to the StateMachine.
Inheritance
System.Object
StateToggle
Namespace: ScriptableFramework
Assembly: cs.temp.dll.dll
Syntax
public class StateToggle : MonoBehaviour
Fields
events
An array of events to collectively run when the toggle is fired.
Declaration
public AppEvent[] events
Field Value
Type | Description |
---|---|
AppEvent[] |
stateMachine
The StateMachine being controlled.
Declaration
public StateMachine stateMachine
Field Value
Type | Description |
---|---|
StateMachine |
Methods
RespondToStateMachineChange(Int32)
If the StateMachine were to be updated through some other means, use this function as a response to an int event and pass that value here to make the Toggle reflect the state of the StateMachine.
Declaration
public void RespondToStateMachineChange(int activeIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | activeIndex |
UpdateStateMachine(Boolean)
The Toggle calls this function to update the StateMachine state according to its sibling index.
Declaration
public void UpdateStateMachine(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value |