public void to( UIState _targetState, System.Func<bool> _onCheck, float _duration ) { UITransition newTranstion = new UITransition (); newTranstion.source = this; newTranstion.target = _targetState; if ( _onCheck != null ) newTranstion.onCheck = _onCheck; newTranstion.duration = _duration; newTranstion.from = panel; newTranstion.to = _targetState.panel; transitionList.Add ( newTranstion ); }
public void to(UIState _targetState, System.Func <bool> _onCheck, float _duration) { UITransition newTranstion = new UITransition(); newTranstion.source = this; newTranstion.target = _targetState; if (_onCheck != null) { newTranstion.onCheck = _onCheck; } newTranstion.duration = _duration; newTranstion.from = panel; newTranstion.to = _targetState.panel; transitionList.Add(newTranstion); }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ void InitStateMachine() { // ======================================================== // init states // ======================================================== fsm.UIState stateA = new fsm.UIState(panelA, stateMachine); fsm.UIState stateB = new fsm.UIState(panelB, stateMachine); fsm.UIState stateC = new fsm.UIState(panelC, stateMachine); // ======================================================== // init transitions // ======================================================== // stateA.to(stateB, cond_IsB, fadeDuration); // stateB.to(stateA, cond_IsA, fadeDuration); stateB.to(stateC, cond_IsC, fadeDuration); // stateC.to(stateB, cond_IsB, fadeDuration); }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ void InitStateMachine() { // ======================================================== // init states // ======================================================== fsm.UIState stateA = new fsm.UIState( panelA, stateMachine ); fsm.UIState stateB = new fsm.UIState( panelB, stateMachine ); fsm.UIState stateC = new fsm.UIState( panelC, stateMachine ); // ======================================================== // init transitions // ======================================================== // stateA.to ( stateB, cond_IsB, fadeDuration ); // stateB.to ( stateA, cond_IsA, fadeDuration ); stateB.to ( stateC, cond_IsC, fadeDuration ); // stateC.to ( stateB, cond_IsB, fadeDuration ); }