State

Namespace

namespace Handy2DTools.Actions{}

Declaration

public abstract class State : MonoBehaviour {}

Fields

new protected string

name

A name you can give the state (you can use the inspector)
so you can have a visual feeeback at the StateMachine inspector

protected StateMachine

machine

The state machine. Set inside InternalLoad() method wich is called by the machine.

protected Actor

actor

The machine’s actor. Set inside InternalLoad() method wich is called by the machine.

Properties

public List<StateTransition> { get; protected set; }

transitions

List of transitions for this state.

public string { get; }

Name

Either the set name or the state Type

Methods

public virtual void

InternalLoad

Called by the StateMachine to load important functionalities.

public virtual void

SortTransitions

Reorders transitions considering priority levels

protected virtual void

AddTransition()

Called to register a StateTransition. Must be called inside State.OnLoad()

Arguments: Func<bool> Condition, State state, int priority = 0

protected virtual void

AddTransition()

Called to register a StateTransition. Must be called inside State.OnLoad()

Arguments: StateTransition transition