mirror of
https://github.com/Bragin-Stepan/project-entity.git
synced 2026-03-02 22:31:10 +00:00
feat: add state machine
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using _Project.Develop.Runtime.Utils.ReactiveManagement.Event;
|
||||
|
||||
namespace Assets._Project.Develop.Runtime.Utilities.StateMachineCore
|
||||
{
|
||||
public abstract class State : IState
|
||||
{
|
||||
private ReactiveEvent _entered = new();
|
||||
private ReactiveEvent _exited = new();
|
||||
|
||||
public IReadOnlyEvent Entered => _entered;
|
||||
|
||||
public IReadOnlyEvent Exited => _exited;
|
||||
|
||||
public virtual void Enter() => _entered.Invoke();
|
||||
|
||||
public virtual void Exit() => _exited.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user