Beispiel #1
0
        void TriggerDrawer()
        {
            if (m_IsAnimating)
            {
                return;
            }

            m_IsOpening   = !m_IsOpening;
            m_IsAnimating = true;


            float start  = m_IsOpening ?  m_Start     : m_Start - m_Offset;
            float finish = m_IsOpening ? -m_Offset    : m_Offset;

            TweenActionEase_RectTransformSlide.Begin <TweenActionEase_RectTransformSlide>(gameObject, start, finish, m_EasingGraphManager.duration, m_Equation, onComplete);
        }
        public void TogglePanel()
        {
            if (m_IsAnimating)
            {
                return;
            }

            m_IsActive    = !m_IsActive;
            m_IsAnimating = true;

            float start  = m_IsActive ? -m_SlideWidth : 0f;
            float finish = m_IsActive ?  m_SlideWidth : -m_SlideWidth;

            TweenActionEase_RectTransformSlide.Begin <TweenActionEase_RectTransformSlide>(m_PanelLinearGO, start, finish, m_Duration, EasingEquationsDouble.Equations.Linear, onComplete);

            if (m_SlideByEaseEquation)
            {
                TweenActionEase_RectTransformSlide.Begin <TweenActionEase_RectTransformSlide>(gameObject, start, finish, m_Duration, (EasingEquationsDouble.Equations)(int) m_EaseEquationIndex, onComplete);
            }
            else
            {
                TweenActionCurve_RectTransformSlide.Begin <TweenActionCurve_RectTransformSlide>(gameObject, start, finish, m_Duration, m_EasingGraphManager.m_EasingAnimationCurveCache.m_AnimationCurves[(int)m_EaseEquationIndex], onComplete);
            }
        }