public override void OnExit(MyContext context, SuperState newState) { if (ParentOf(newState)) return; Console.WriteLine("AA - Run on exit code"); base.OnExit(context, newState); }
public override void OnEnter(MyContext context, SuperState oldState) { if (ParentOf(oldState)) return; base.OnEnter(context, oldState); Console.WriteLine("AB - Run on enter code"); }
public static new bool ParentOf(SuperState child) { return child is B; }
public static bool ParentOf(SuperState child) { return child is SuperState; }
public void SetState(SuperState nextState, SuperState oldState) { State = nextState; nextState.OnEnter(this, oldState); }
public void LeaveState(SuperState nextState) { State.OnExit(this, nextState); }
public virtual void OnExit(MyContext context, SuperState newState) { }