public virtual void OnExit(ENST state) { this.Running = false; this.State = state; for (int i = 0; i < Children.Count; i++) { Children[i].OnExit(state); } }
public void OnTick() { if (State == ENST.INITIAL) { bool checkCondition = OnEnter(); this.State = checkCondition ? ENST.RUNNING : ENST.FAILURE; } if (State == ENST.RUNNING) { ENST nodeStatus = OnExecute(); this.Running = nodeStatus == ENST.RUNNING; this.State = nodeStatus; } else { this.Running = false; } }