Esempio n. 1
0
        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 );
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
    // ------------------------------------------------------------------
    // 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);
    }
Esempio n. 4
0
    // ------------------------------------------------------------------
    // 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 );
    }