SF Tool Documentation
Search Results for

    Show / Hide Table of Contents

    Class StateCore

    StateMachineBrain
    Inheritance
    System.Object
    StateCore
    PathfindingAIState
    Namespace: SF.StateMachine.Core
    Assembly: cs.temp.dll.dll
    Syntax
    public abstract class StateCore : MonoBehaviour

    Fields

    _controller

    Declaration
    protected Controller2D _controller
    Field Value
    Type Description
    Controller2D

    _decision

    Declaration
    protected DecisionTransition _decision
    Field Value
    Type Description
    DecisionTransition

    _initialized

    Declaration
    protected bool _initialized
    Field Value
    Type Description
    System.Boolean

    CanStateTransistToSelf

    This is to allow setting states to enter themselves on loop.

    Declaration
    public bool CanStateTransistToSelf
    Field Value
    Type Description
    System.Boolean

    Decisions

    Declaration
    public List<StateDecisionCore> Decisions
    Field Value
    Type Description
    List<StateDecisionCore>

    NonEnterableStates

    Declaration
    public List<StateCore> NonEnterableStates
    Field Value
    Type Description
    List<StateCore>

    StateBrain

    Declaration
    public StateMachineBrain StateBrain
    Field Value
    Type Description
    StateMachineBrain

    Properties

    StateName

    Declaration
    public string StateName { get; protected set; }
    Property Value
    Type Description
    System.String

    Methods

    CheckEnterableState(StateCore)

    Declaration
    public virtual bool CheckEnterableState(StateCore currentState)
    Parameters
    Type Name Description
    StateCore currentState
    Returns
    Type Description
    System.Boolean

    CheckTransitions()

    Declaration
    protected virtual void CheckTransitions()

    EnterState()

    This function is called from the StateMachineBrain to set up calling the OnEnterState function for methods.

    Declaration
    public void EnterState()

    ExitState()

    This function is called from the StateMachineBrain to set up calling the OnExitState function for methods.

    Declaration
    public void ExitState()

    Init(Controller2D)

    This is run the very first time this object is enabled and when the StateMachineBrain inits it. This won't run everytime this state is interacted with.

    Declaration
    public void Init(Controller2D controller2D = null)
    Parameters
    Type Name Description
    Controller2D controller2D

    OnAwake()

    Declaration
    protected virtual void OnAwake()

    OnDisable()

    When the state is disabled we can do clean up work here.

    Declaration
    protected virtual void OnDisable()

    OnEnable()

    When the state is enabled we can do set up work here.

    Declaration
    protected virtual void OnEnable()

    OnInit()

    This function can be overridden to give sub class of State Core custom Init functionality.

    Declaration
    protected virtual void OnInit()

    OnInit(Controller2D)

    Declaration
    protected virtual void OnInit(Controller2D controller2D)
    Parameters
    Type Name Description
    Controller2D controller2D

    OnStart()

    Declaration
    protected virtual void OnStart()

    OnStateEnter()

    When we enter the state we do prep stuf here if we need to prep something every state entrance

    Declaration
    protected virtual void OnStateEnter()

    OnStateExit()

    When we leave the state use this function to do clean up actions.

    Declaration
    protected virtual void OnStateExit()

    OnUpdateState()

    We do per frame update logic here. This is controlled by the state machine brain on the object.

    Declaration
    protected virtual void OnUpdateState()

    UpdateState()

    This is where the state machine calls the start of the states update.

    Declaration
    public void UpdateState()
    In This Article
    Back to top Generated by DocFX