C# Class AStateMachine, PocketGodsRPG_Proto

An instantiable/inheritable state machine reusable for complex components. Only acts as a data structure By: NeilDG
显示文件 Open project: pocket-playlab/PocketGodsRPG_Proto Class Usage Examples

Protected Properties

Property Type Description
currentState AState,
initialState AState,

Public Methods

Method Description
GetCurrentState ( ) : AState,
GetCurrentStateLabel ( ) : string
InitializeStateTransitions ( ) : void

Put all state initialization and state transitions here!

OnUpdate ( ) : void

Raises the update event. Call this if you want this state machine to perform actions on Unity Update

SetInitialState ( AState, initialState ) : void
TransitionTo ( string stateLabel ) : void

Transitions the current state to its next state. Will not transition if the current state do not have any next state!

Method Details

GetCurrentState() public method

public GetCurrentState ( ) : AState,
return AState,

GetCurrentStateLabel() public method

public GetCurrentStateLabel ( ) : string
return string

InitializeStateTransitions() public abstract method

Put all state initialization and state transitions here!
public abstract InitializeStateTransitions ( ) : void
return void

OnUpdate() public method

Raises the update event. Call this if you want this state machine to perform actions on Unity Update
public OnUpdate ( ) : void
return void

SetInitialState() public method

public SetInitialState ( AState, initialState ) : void
initialState AState,
return void

TransitionTo() public method

Transitions the current state to its next state. Will not transition if the current state do not have any next state!
public TransitionTo ( string stateLabel ) : void
stateLabel string
return void

Property Details

currentState protected_oe property

protected AState, currentState
return AState,

initialState protected_oe property

protected AState, initialState
return AState,