CharacterStateMachine
ZEPETO.Character.Controller.CharacterStateMachine
Class responsible for synchronizing the animator with the character state of a ZEPETO character.
Hierarchy
StateMachine$1
<CharacterState
>↳
CharacterStateMachine
Constructors
constructor
• new CharacterStateMachine()
Inherited from
Properties
OnChangedState
• OnChangedState: Action$2
<CharacterState
, CharacterState
>
Event triggered when the camera state changes. Registered listeners receive two parameters:
- The new state.
- The previous state.
Inherited from
Accessors
Current
• get
Current(): State$1
<TEnum
>
Retrieves the current state.
Returns
State$1
<TEnum
>
Inherited from
StateMachine$1.Current
Events
• get
Events(): TransitionBase$1
<TEnum
>[]
Provides an array of all the events defined in the state machine.
Returns
TransitionBase$1
<TEnum
>[]
Inherited from
StateMachine$1.Events
IsRunning
• get
IsRunning(): boolean
Indicates whether the state machine is actively processing states and transitions.
Returns
boolean
Inherited from
StateMachine$1.IsRunning
Prev
• get
Prev(): State$1
<TEnum
>
Retrieves the previous state.
Returns
State$1
<TEnum
>
Inherited from
StateMachine$1.Prev
constraintStateAnimation
• get
constraintStateAnimation(): boolean
Determines whether to synchronize the animator with the current character state of the ZEPETO character.
If set to true
, the animator state will not be updated based on the current character state.
Returns
boolean
• set
constraintStateAnimation(value
): void
Determines whether to synchronize the animator with the current character state of the ZEPETO character.
If set to true
, the animator state will not be updated based on the current character state.
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
stateCount
• get
stateCount(): number
Retrieves the count of states defined in the state machine.
Returns
number
Inherited from
StateMachine$1.stateCount
transitionCount
• get
transitionCount(): number
Retrieves the count of transitions defined in the state machine.
Returns
number
Inherited from
StateMachine$1.transitionCount
Methods
ChangeStateAnimation
▸ ChangeStateAnimation($state
): void
Plays the animation associated with the provided character state on the animator.
Parameters
Name | Type | Description |
---|---|---|
$state | CharacterState | Character state representing the animation to play. |
Returns
void
EnterState
▸ EnterState($state
): void
Transitions the state machine into a specified state.
Parameters
Name | Type | Description |
---|---|---|
$state | CharacterState | The state to which the state machine will transition. |
Returns
void
Inherited from
FindState
▸ FindState($state
, $success
, $failed
): void
Finds a state within the state machine and executes a callback on success.
Parameters
Name | Type | Description |
---|---|---|
$state | CharacterState | State to find within the state machine. |
$success | Action$1 <State$1 <CharacterState >> | Callback function to handle the found State . |
$failed | Action | Callback function to handle the case when the state is not found. |
Returns
void
Inherited from
FindTransition
▸ FindTransition($from
, $to
, $success
, $failed
): void
Finds a transition within the state machine and executes a callback on success.
Parameters
Name | Type | Description |
---|---|---|
$from | CharacterState | State from which the transition starts. |
$to | CharacterState | State to which the transition will occur. |
$success | Action$1 <Transition$1 <CharacterState >> | Callback function to handle the found Transition . |
$failed | Action | Callback function to handle the case when the transition is not found. |
Returns
void
Inherited from
FindTransitions
▸ FindTransitions($from
, $success
, $failed
): void
Finds transitions within the state machine and executes a callback on success.
Parameters
Name | Type | Description |
---|---|---|
$from | CharacterState | State from which the transition starts. |
$success | Action$1 <Transition$1 <CharacterState >[]> | Callback function to handle the found array of Transition . |
$failed | Action | Callback function to handle the case when transitions are not found. |
Returns
void
Inherited from
StateMachine$1.FindTransitions
LeaveState
▸ LeaveState($nextState
): void
The state machine exits the current state.
Parameters
Name | Type | Description |
---|---|---|
$nextState | CharacterState | The next state to be handled by the current state's OnLeave . |
Returns
void
Inherited from
Start
▸ Start($state
): void
Initiates the processing of the state machine.
Parameters
Name | Type | Description |
---|---|---|
$state | CharacterState | State from which the state machine will start its processing. |
Returns
void
Inherited from
Stop
▸ Stop(): void
Stops the processing of the state machine.
Returns
void
Inherited from
SyncStateAnimation
▸ SyncStateAnimation(): void
Synchronizes the animator with the current character state of the ZEPETO character.
Returns
void
Update
▸ Update($deltaTime
): void
Updates the current state and transition of the state machine.
Parameters
Name | Type | Description |
---|---|---|
$deltaTime | number | Time elapsed in seconds since the last Update call. |
Returns
void