public virtual void SetState(TransitionStates _state)
    {
        State = _state;

        switch (_state)
        {
        case TransitionStates.ToReady:
            OnChangeToReady();
            break;

        case TransitionStates.Ready:
            OnChangeReady();
            break;

        case TransitionStates.ToFinish:
            OnChangeToFinish();
            break;

        case TransitionStates.Finish:
            OnChangeFinish();
            break;
        }

        if (onStateChanged != null)
        {
            onStateChanged(State);
        }
    }
Beispiel #2
0
    public void ToNextState(string a_sOutroText, string a_sIntroText)
    {
        m_TranState  = TransitionStates.PlayingOutro;
        m_sIntroText = a_sIntroText;

        m_TranTextObject.text = a_sOutroText;
    }
    public void SetTransitionState(TransitionStates passState)
    {
        currentState = passState;


        switch (currentState)
        {
        case TransitionStates.waiting:
            blackCover.gameObject.SetActive(false);
            //Debug.Log("turnOff");
            break;

        case TransitionStates.fading:

            blackCover.gameObject.SetActive(true);
            darkenFrames     = maxDarkenFrames;
            transitionFrames = maxTransitionFrames;
            blackCover.color = new Color(blackCover.color.r, blackCover.color.g, blackCover.color.b, 0);

            GameObject.FindGameObjectWithTag("player").GetComponent <Movement>().enabled = false;

            break;

        case TransitionStates.unfading:

            darkenFrames     = 0;
            transitionFrames = 0;
            blackCover.color = new Color(blackCover.color.r, blackCover.color.g, blackCover.color.b, 1);
            break;

        default:
            break;
        }
    }
Beispiel #4
0
 // Start is called before the first frame update
 void Start()
 {
     m_TranState           = 0;
     m_fCurrentTranTime    = 0.0f;
     m_sIntroText          = "BattleStart";
     m_TranTextObject.text = m_sIntroText;
     m_TextColor           = m_TranTextObject.color;
 }
Beispiel #5
0
    // Update is called once per frame
    void Update()
    {
        if (InTransition)
        {
            m_fCurrentTranTime += Time.deltaTime;

            float transparency = (m_cTranTime - m_fCurrentTranTime) / m_cTranTime;
            m_TextColor            = new Color(m_TextColor.r, m_TextColor.g, m_TextColor.b, transparency);
            m_TranTextObject.color = m_TextColor;

            if (m_fCurrentTranTime >= m_cTranTime)
            {
                m_TranState = m_TranState == TransitionStates.PlayingOutro ?
                              TransitionStates.PlayingIntro : m_TranState + 1;

                if (m_TranState == TransitionStates.PlayingIntro)
                {
                    m_TranTextObject.text = m_sIntroText;
                }

                m_fCurrentTranTime = 0.0f;
            }
        }
    }