protected void OnFinal() { if (!IsFinal) { foreach (var region in regions) { IsFinal |= region.Value.IsFinal; } if (IsFinal) { FinalEvent?.Invoke(); } } }
private void ChangeActiveImpl(State state, State rootState, StateEventArg arg) { if (active != null) { StateMachine.OnLeaveState(active.Name); } active = state; rootActive = rootState; StateMachine.OnEnterState(rootActive != null ? rootActive.Name : "", arg); //Debug.Log(string.Format("Region {0} Active: {1}", Name, rootActive != null ? rootActive.Name : "null")); if (rootActive is FinalState) { IsFinal = true; FinalEvent?.Invoke(); } }