Search Results for

    Show / Hide Table of Contents

    Class State

    A state that can be runned in the StateMachine. Can be added to and edited inside StateData.
    Use AddStateMenuAttribute and StateTransitionAttribute to define transitions for the state and make it visible to the editor scritps to allow editing in the custom inspector of StateData

    Inheritance
    object
    Object
    ScriptableObject
    State
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: LobsterFramework.AI
    Assembly: LobsterFramework.dll
    Syntax
    public abstract class State : ScriptableObject

    Fields

    | Improve this Doc View Source

    StateMachine

    Declaration
    [HideInInspector]
    protected StateMachine StateMachine
    Field Value
    Type Description
    StateMachine

    Methods

    | Improve this Doc View Source

    GetComponentReference<T>(int)

    Attempts to get the reference of the specified component type from StateMachine. The type of the reference should be one of the required types applied via RequireComponentReferenceAttribute on this state class.

    Declaration
    protected T GetComponentReference<T>(int index = 0) where T : Component
    Parameters
    Type Name Description
    int index

    The index to the list of components of the type specified. Use of type safe enum is strongly recommended.

    Returns
    Type Description
    T

    The component reference stored in StateMachine if it exists, otherwise null

    Type Parameters
    Name Description
    T

    The type of the component looking for

    Remarks

    This is a shorthand call for GetComponentReference<T>(Type, int) via StateMachine

    | Improve this Doc View Source

    InitializeFields()

    Called to initialize references and perform setups

    Declaration
    protected abstract void InitializeFields()
    | Improve this Doc View Source

    OnBecomeInactive()

    Called to perform clean up operations

    Declaration
    protected abstract void OnBecomeInactive()
    | Improve this Doc View Source

    OnEnter()

    Called when entering the state

    Declaration
    protected abstract void OnEnter()
    | Improve this Doc View Source

    OnExit()

    Called when the exiting the state

    Declaration
    protected abstract void OnExit()
    | Improve this Doc View Source

    Tick()

    Main body of the state logic, will be called every frame during Update event.

    Declaration
    protected abstract Type Tick()
    Returns
    Type Description
    Type

    The type of the state to transition to, null if not transitioning to any state.

    • Improve this Doc
    • View Source
    In This Article
    Back to top LobsterFramework documentation