Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class SmState

    Represents an abstract state within a state machine, providing the core lifecycle methods for state management.

    Inheritance
    object
    SmState
    SmStateMachine
    SmState<TContext>
    UserToolStateBase
    Implements
    ISmState
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Fwt.Core.StateMachines
    Assembly: fwt.core.dll
    Syntax
    public abstract class SmState : ISmState
    Remarks

    Implementations of this class define the behavior for entering, exiting, and updating a state in a state machine. The methods should be overridden to specify actions that occur when the state is prepared to run, prepared to stop, or updated on each tick. This class is intended to be used as a base for concrete state implementations in state machine architectures.

    Methods

    PrepareToRun()

    Performs any necessary initialization or setup required before executing the main operation. Called by state machine once when state becomes active. If state is disabled and then enabled again, this method will be called again.

    Declaration
    public abstract void PrepareToRun()
    Remarks

    Override this method to implement preparation logic specific to the derived class. This method should be called prior to running the core functionality to ensure all prerequisites are met.

    PrepareToStop()

    Performs any necessary actions to prepare the object for stopping or shutdown. Called when the state is about to be deactivated.

    Declaration
    public abstract void PrepareToStop()
    Remarks

    Implementations should ensure that all resources are released and any ongoing operations are safely terminated before the object is stopped. This method is typically called prior to disposing or shutting down the object to ensure a clean transition.

    Tick()

    Advances the state of the object by one time unit or processing step.

    Declaration
    public abstract void Tick()
    Remarks

    Derived classes should implement this method to perform periodic updates or actions. The specific behavior depends on the implementation.

    Implements

    ISmState

    Extension Methods

    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    In this article
    Back to top Generated by DocFX