Beispiel #1
0
    //---------------------------------------------------------
    void FixedUpdate()
    {
        if (m_UiCamera.enabled == false)
        {
            return;
        }

#if UNITY_STANDALONE
        if ((double)m_CachedScreenSize.x != (double)Screen.width || (double)m_CachedScreenSize.y != (double)Screen.height)
        {
            ScreenSizeChanged();
        }
#endif

        if (m_NextAnimationDelay > 0.0f)
        {
            m_NextAnimationDelay -= Time.deltaTime;
            if (m_NextAnimationDelay > 0.0f)
            {
                return;
            }
        }

        if (m_ActiveAnimation == null && m_Animations.Count > 0)
        {
            m_ActiveAnimation = m_Animations.Dequeue();

            if (m_ActiveAnimation != null)
            {
                m_ActiveAnimation.Start();
            }
        }

        if (m_ActiveAnimation != null)
        {
            m_ActiveAnimation.Update();

            if (m_ActiveAnimation.Visible == false || m_ActiveAnimation.Finished == true)
            {
                m_ActiveAnimation    = null;
                m_NextAnimationDelay = 0.1f;
            }
        }
    }
Beispiel #2
0
    public static void FlushAnimations()
    {
        if (Instance == null)
        {
            return;
        }

        if (Instance.m_ActiveAnimation != null)
        {
            Instance.m_ActiveAnimation.ForceFinish();
            Instance.m_ActiveAnimation.Update();
            Instance.m_ActiveAnimation = null;
        }

        while (Instance.m_Animations.Count > 0)
        {
            WidgetAnimation.Base animation = Instance.m_Animations.Dequeue();
            animation.Start();
            animation.ForceFinish();
            animation.Update();
        }

        Instance.m_NextAnimationDelay = 0.0f;
    }