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

            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
        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.CalculateCurveDuration();

                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.CalculateCurveDuration();
            maxDuration        = cycleDuration * cycles;
        }