SF Tool Documentation
Search Results for

    Show / Hide Table of Contents

    Class StateMachineBrain

    This is for controlling non-player controlled characters states and actions.

    StateCore are for non-player characters and AbilityCore are for player controlled characters.

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

    Fields

    _controller2D

    Declaration
    protected Controller2D _controller2D
    Field Value
    Type Description
    Controller2D

    _states

    Declaration
    protected List<StateCore> _states
    Field Value
    Type Description
    List<StateCore>

    ControlledGameObject

    Declaration
    public GameObject ControlledGameObject
    Field Value
    Type Description
    GameObject

    Properties

    CurrentState

    Declaration
    public StateCore CurrentState { get; protected set; }
    Property Value
    Type Description
    StateCore

    DefaultState

    Declaration
    public StateCore DefaultState { get; protected set; }
    Property Value
    Type Description
    StateCore

    PreviousState

    Declaration
    public StateCore PreviousState { get; protected set; }
    Property Value
    Type Description
    StateCore

    Methods

    ChangeState(StateCore)

    Changes the current newState and runs the enter and exit functions for the appropriate states without doing transition or decision newState checks. Due note this is called normally after newState checks, but can be used outside of them to directly bypass them.

    Declaration
    public void ChangeState(StateCore state)
    Parameters
    Type Name Description
    StateCore state

    ChangeStateWithCheck(StateCore)

    Changes the current newState and runs the enter and exit functions for the appropriate states after checking if the newState trying to be changed to can be entered.

    Declaration
    public void ChangeStateWithCheck(StateCore newState)
    Parameters
    Type Name Description
    StateCore newState

    InitStateBrain()

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