SStateMachine
في هذا الصنفNextState
| دالة | NextState | Enter the next state |
| دالة | PrevState | – |
| دالة | SetState | Enters the state of being set that its order is "state" |
| دالة | BindToUI | The state machine will bind itself to all Toggles, Buttons, Dropdowns and Sliders on the SGameObject it is in or on a specified SGameObject. |
| خاصية | Enabled | Whether the simple state machine component is Enabled or not |
| خاصية | StateCount | Total number of States. |
| خاصية | StateNames | A list of the names of all States. |
| خاصية | CurrentState | The index number of the current state. |
| خاصية | CurrentStateName | The name of the current state, or null if no state. |
| خاصية | ComponentName | The name of this component. |
| خاصية | GameObject | The GameObject this component is attached to. |
الدوال
NextState
Enter the next state
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.StateMachine.NextState()
PrevState
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.StateMachine.PrevState()
SetState
Enters the state of being set that its order is "state"
المعاملات
| المعامل | النوع | الوصف |
|---|---|---|
| state | int | The index of the state. First state is 1. |
| state | string | The name of the state as set in the State Machine component. |
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.StateMachine.SetState(2)
--or
Space.Host.ExecutingObject.StateMachine.SetState('A State Name')
BindToUI
The state machine will bind itself to all Toggles, Buttons, Dropdowns and Sliders on the SGameObject it is in or on a specified SGameObject.
Binding to Button : Clicking button will call NextState()
Binding to Toggle: Toggle On sets State to 1, Toggle Off sets state to 2
Binding to Dropdown: Selecting will set State to that selection's caption text
Binding to Slider: Moving slider changes State to slider value
المعاملات
| المعامل | النوع | الوصف |
|---|---|---|
| go | SGameObject | A specific SGameObject which this State Machine will bind to. |
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.StateMachine.BindToUI()
----or
Space.Host.ExecutingObject.StateMachine.BindToUI(Space.Host.GetReference("a reference"))
الخصائص
Enabled
Whether the simple state machine component is Enabled or not
مثال
Space.Host.ExecutingObject.StateMachine.Enabled = false
StateCountللقراءة فقط
Total number of States.
مثال
numberOfStates = Space.Host.ExecutingObject.StateMachine.StateCount
StateNamesللقراءة فقط
A list of the names of all States.
مثال
tableStateNames = Space.Host.ExecutingObject.StateMachine.StateNames
CurrentStateللقراءة فقط
The index number of the current state.
مثال
currentState = Space.Host.ExecutingObject.StateMachine.CurrentState
CurrentStateNameللقراءة فقط
The name of the current state, or null if no state.
مثال
currentStateName = Space.Host.ExecutingObject.StateMachine.CurrentStateName
ComponentNameللقراءة فقط
The name of this component.
مثال
componentName = Space.Host.ExecutingObject.StateMachine.ComponentName
GameObjectللقراءة فقط
The GameObject this component is attached to. A component is always attached to a GameObject.
مثال
theGameObject = Space.Host.ExecutingObject.StateMachine.GameObject



