Example #1
0
    private void LateUpdate()
    {
        if ((m_wait -= Time.deltaTime) > 0.0f)
            return;

        bool finishedState = true;
        m_progress += Time.deltaTime;

        switch (m_currentState)
        {
            case FancyTextAnimation.Type.Enter:
                foreach(FancyTextAnimation a in m_enterAnimations)
                {
                    finishedState &= a.UpdateAnimation(m_progress, m_textTransform, m_text);
                }

                if(finishedState)
                {
                    m_progress = 0.0f;
                    FModUtility.PlayOneShot(m_audio);
                    m_currentState = FancyTextAnimation.Type.Idle;
                }

                break;
            case FancyTextAnimation.Type.Idle:
                foreach (FancyTextAnimation a in m_idleAnimations)
                {
                    finishedState &= a.UpdateAnimation(m_progress, m_textTransform, m_text);
                }

                if (finishedState)
                {
                    m_progress = 0.0f;
                }

                break;
            case FancyTextAnimation.Type.Exit:
                foreach (FancyTextAnimation a in m_exitAnimations)
                {
                    finishedState &= a.UpdateAnimation(m_progress, m_textTransform, m_text);
                }

                if (finishedState)
                {
                    Remove();
                }

                break;
        }
    }
Example #2
0
    public void ForceStateLetters(FancyTextAnimation.Type state)
    {
        foreach (Letter l in GetComponentsInChildren <Letter>())
        {
            if (l.m_wait > 0)
            {
                l.m_progress = l.m_wait % 1.0f;
            }
            else
            {
                l.m_progress = 0.0f;
            }

            l.m_wait         = 0.0f;
            l.m_currentState = state;
        }
    }