public void OnButtonClicked() { if (ParentState == null) { return; } ParentState.OpenSubstate(StateType); }
public void Back() { if (UIStateMachine.Instance.LockTransitions || _runningTasks > 0) { #if Debugging Debug.Log("Cannot go back a state from " + Type + " because there are still running tasks!"); #endif return; } if (onBackFromState != null) { onBackFromState(Type); } if (OverrideBackState) { ParentToReceiveBackStateCall.OpenSubstate(StateToCallOnBack); return; } if (SubStateList != null && SubStateList.Count > 0 && _currentSubstateIndex != 0) { #if Debugging Debug.Log("Opening Initial Substate"); #endif OpenSubstate(SubStateList [_initialSubstate].TargetState.Type); return; } if (_parentState != null) { _parentState.Back(); return; } #if Debugging Debug.Log("Warning FHUIStateMachine to go back a state"); #endif UIStateMachine.Instance.Back(); }