コード例 #1
0
        protected override void SetAnimation(int a_targetIndex, float a_easedProgress)
        {
            if (m_targetTransforms == null || a_targetIndex >= m_targetTransforms.Length || m_targetTransforms[a_targetIndex] == null)
            {
                return;
            }

            if (a_easedProgress < 0.5f)
            {
                m_tempEasedProgress = EasingManager.GetEaseProgress(EasingEquation.SineEaseOut, (float)a_easedProgress / 0.5f);

                m_targetTransforms[a_targetIndex].localScale    = Vector3.LerpUnclamped(m_masterScales[a_targetIndex], m_masterScales[a_targetIndex] * m_pulseScale.GetValue(a_targetIndex), m_tempEasedProgress);
                m_targetTransforms[a_targetIndex].localRotation = Quaternion.Euler(Vector3.LerpUnclamped(m_masterRotations[a_targetIndex], m_masterRotations[a_targetIndex] + new Vector3(0, 0, m_rotationAngle.GetValue(a_targetIndex)), m_tempEasedProgress));
            }
            else
            {
                m_tempEasedProgress = EasingManager.GetEaseProgress(EasingEquation.SineEaseIn, (float)(a_easedProgress - 0.5f) / 0.5f);

                m_targetTransforms[a_targetIndex].localScale    = Vector3.LerpUnclamped(m_masterScales[a_targetIndex] * m_pulseScale.GetValue(a_targetIndex), m_masterScales[a_targetIndex], m_tempEasedProgress);
                m_targetTransforms[a_targetIndex].localRotation = Quaternion.Euler(Vector3.LerpUnclamped(m_masterRotations[a_targetIndex] + new Vector3(0, 0, m_rotationAngle.GetValue(a_targetIndex)), m_masterRotations[a_targetIndex], m_tempEasedProgress));
            }
        }
コード例 #2
0
        public void SetAnimationProgress(int a_targetIndex, AnimSetupType a_animType, float a_progress)
        {
            if (!IsEffectStep && a_animType == AnimSetupType.Outro)
            {
                a_progress = 1f - a_progress;
            }

            if (a_progress < 0)
            {
                a_progress = 0;
            }
            else if (a_progress > 1)
            {
                a_progress = 1;
            }

            if (UseEasing)
            {
                a_progress = EasingManager.GetEaseProgress(m_easing, (float)a_progress);
            }

            SetAnimation(a_targetIndex, a_progress);
        }
コード例 #3
0
        public static float GetEaseProgress(EasingEquation ease_type, float linear_progress)
        {
            switch (ease_type)
            {
            case EasingEquation.Linear:
                return(linear_progress);

            case EasingEquation.BackEaseIn:
                return(EasingManager.BackEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.BackEaseInOut:
                return(EasingManager.BackEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.BackEaseOut:
                return(EasingManager.BackEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.BackEaseOutIn:
                return(EasingManager.BackEaseOutIn(linear_progress, 0, 1, 1));

            case EasingEquation.BounceEaseIn:
                return(EasingManager.BounceEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.BounceEaseInOut:
                return(EasingManager.BounceEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.BounceEaseOut:
                return(EasingManager.BounceEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.BounceEaseOutIn:
                return(EasingManager.BounceEaseOutIn(linear_progress, 0, 1, 1));

            case EasingEquation.CircEaseIn:
                return(EasingManager.CircEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.CircEaseInOut:
                return(EasingManager.CircEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.CircEaseOut:
                return(EasingManager.CircEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.CircEaseOutIn:
                return(EasingManager.CircEaseOutIn(linear_progress, 0, 1, 1));

            case EasingEquation.CubicEaseIn:
                return(EasingManager.CubicEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.CubicEaseInOut:
                return(EasingManager.CubicEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.CubicEaseOut:
                return(EasingManager.CubicEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.CubicEaseOutIn:
                return(EasingManager.CubicEaseOutIn(linear_progress, 0, 1, 1));

            case EasingEquation.ElasticEaseIn:
                return(EasingManager.ElasticEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.ElasticEaseInOut:
                return(EasingManager.ElasticEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.ElasticEaseOut:
                return(EasingManager.ElasticEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.ElasticEaseOutIn:
                return(EasingManager.ElasticEaseOutIn(linear_progress, 0, 1, 1));

            case EasingEquation.ExpoEaseIn:
                return(EasingManager.ExpoEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.ExpoEaseInOut:
                return(EasingManager.ExpoEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.ExpoEaseOut:
                return(EasingManager.ExpoEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.ExpoEaseOutIn:
                return(EasingManager.ExpoEaseOutIn(linear_progress, 0, 1, 1));

            case EasingEquation.QuadEaseIn:
                return(EasingManager.QuadEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.QuadEaseInOut:
                return(EasingManager.QuadEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.QuadEaseOut:
                return(EasingManager.QuadEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.QuadEaseOutIn:
                return(EasingManager.QuadEaseOutIn(linear_progress, 0, 1, 1));

            case EasingEquation.QuartEaseIn:
                return(EasingManager.QuartEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.QuartEaseInOut:
                return(EasingManager.QuartEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.QuartEaseOut:
                return(EasingManager.QuartEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.QuartEaseOutIn:
                return(EasingManager.QuartEaseOutIn(linear_progress, 0, 1, 1));

            case EasingEquation.QuintEaseIn:
                return(EasingManager.QuintEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.QuintEaseInOut:
                return(EasingManager.QuintEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.QuintEaseOut:
                return(EasingManager.QuintEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.QuintEaseOutIn:
                return(EasingManager.QuintEaseOutIn(linear_progress, 0, 1, 1));

            case EasingEquation.SineEaseIn:
                return(EasingManager.SineEaseIn(linear_progress, 0, 1, 1));

            case EasingEquation.SineEaseInOut:
                return(EasingManager.SineEaseInOut(linear_progress, 0, 1, 1));

            case EasingEquation.SineEaseOut:
                return(EasingManager.SineEaseOut(linear_progress, 0, 1, 1));

            case EasingEquation.SineEaseOutIn:
                return(EasingManager.SineEaseOutIn(linear_progress, 0, 1, 1));

            default:
                return(linear_progress);
            }
        }