using UOP1.StateMachine.ScriptableObjects;
namespace UOP1.StateMachine
{
///
/// An object representing an action.
///
public abstract class StateAction : IStateComponent
{
internal StateActionSO _originSO;
///
/// Use this property to access shared data from the that corresponds to this
///
protected StateActionSO OriginSO => _originSO;
///
/// Called every frame the is in a with this .
///
public abstract void OnUpdate();
///
/// Awake is called when creating a new instance. Use this method to cache the components needed for the action.
///
/// The this instance belongs to.
public virtual void Awake(StateMachine stateMachine) { }
public virtual void OnStateEnter() { }
public virtual void OnStateExit() { }
///
/// This enum is used to create flexible StateActions which can execute in any of the 3 available "moments".
/// The StateAction in this case would have to implement all the relative functions, and use an if statement with this enum as a condition to decide whether to act or not in each moment.
///
public enum SpecificMoment
{
OnStateEnter, OnStateExit, OnUpdate,
}
}
}