예제 #1
0
        public void Initialize(int type)
        {
            calculatedDuration = curve.GetDuration();

            isAppearance = type >= 3;

            switch (type)
            {
            //mov
            default:
            case 0: defaultReturn = 0; break;

            //scale
            case 1: defaultReturn = 1; break;

            //rot
            case 2: defaultReturn = 0; break;

            //app mov
            case 3: defaultReturn = 0; break;

            //app scale
            case 4: defaultReturn = 1; break;

            //app rot
            case 5: defaultReturn = 0; break;
            }
        }
예제 #2
0
        private IEnumerator Update_Coroutine()
        {
            float duration = m_animCurve.GetDuration();
            float timer    = 0;

            while (timer < duration || m_isLooping)
            {
                timer += Time.deltaTime;

                float value = m_animCurve.Evaluate(timer);
                transform.localScale = m_axis * value;

                yield return(null);
            }

            m_updateRoutine = null;
        }
예제 #3
0
        public void Initialize(float effectsMaxDuration)
        {
            effectWeigth = 0;
            passedTime   = 0;

            Keyframe[] totalKeys = new Keyframe[
                attackCurve.length + (continueForever ? 0 : decayCurve.length)
                                   ];

            for (int i = 0; i < attackCurve.length; i++)
            {
                totalKeys[i] = attackCurve[i];
            }

            if (!continueForever)
            {
                if (overrideDuration > 0)
                {
                    effectsMaxDuration = overrideDuration;
                }

                float attackDuration = attackCurve.GetDuration();

                for (int i = attackCurve.length; i < totalKeys.Length; i++)
                {
                    totalKeys[i]       = decayCurve[i - attackCurve.length];
                    totalKeys[i].time += effectsMaxDuration + attackDuration;
                }
            }

            intensityOverDuration              = new AnimationCurve(totalKeys);
            intensityOverDuration.preWrapMode  = WrapMode.Loop;
            intensityOverDuration.postWrapMode = WrapMode.Loop;

            this.cycleDuration = intensityOverDuration.GetDuration();
            maxDuration        = cycleDuration * cycles;
        }
예제 #4
0
 public void Initialize()
 {
     calculatedDuration = curve.GetDuration();
 }