コード例 #1
0
        // Token: 0x06000096 RID: 150 RVA: 0x00003E38 File Offset: 0x00002038
        internal static bool DoApplyTween(Sequence s, float prevPosition, int prevCompletedLoops, int newCompletedSteps, bool useInversePosition, UpdateMode updateMode)
        {
            float num  = prevPosition;
            float num2 = s.position;

            if (s.easeType != Ease.Linear)
            {
                num  = s.duration * EaseManager.Evaluate(s.easeType, s.customEase, num, s.duration, s.easeOvershootOrAmplitude, s.easePeriod);
                num2 = s.duration * EaseManager.Evaluate(s.easeType, s.customEase, num2, s.duration, s.easeOvershootOrAmplitude, s.easePeriod);
            }
            float num3 = 0f;
            bool  flag = s.loopType == LoopType.Yoyo && ((num < s.duration) ? (prevCompletedLoops % 2 != 0) : (prevCompletedLoops % 2 == 0));

            if (s.isBackwards)
            {
                flag = !flag;
            }
            float num5;

            if (newCompletedSteps > 0)
            {
                int   completedLoops = s.completedLoops;
                float position       = s.position;
                int   num4           = newCompletedSteps;
                int   i = 0;
                num5 = num;
                if (updateMode == UpdateMode.Update)
                {
                    while (i < num4)
                    {
                        if (i > 0)
                        {
                            num5 = num3;
                        }
                        else if (flag && !s.isBackwards)
                        {
                            num5 = s.duration - num5;
                        }
                        num3 = (flag ? 0f : s.duration);
                        if (Sequence.ApplyInternalCycle(s, num5, num3, updateMode, useInversePosition, flag, true))
                        {
                            return(true);
                        }
                        i++;
                        if (s.loopType == LoopType.Yoyo)
                        {
                            flag = !flag;
                        }
                    }
                    if (completedLoops != s.completedLoops || Math.Abs(position - s.position) > 1.401298E-45f)
                    {
                        return(!s.active);
                    }
                }
                else
                {
                    if (s.loopType == LoopType.Yoyo && newCompletedSteps % 2 != 0)
                    {
                        flag = !flag;
                        num  = s.duration - num;
                    }
                    newCompletedSteps = 0;
                }
            }
            if (newCompletedSteps == 1 && s.isComplete)
            {
                return(false);
            }
            if (newCompletedSteps > 0 && !s.isComplete)
            {
                num5 = (useInversePosition ? s.duration : 0f);
                if (s.loopType == LoopType.Restart && num3 > 0f)
                {
                    Sequence.ApplyInternalCycle(s, s.duration, 0f, UpdateMode.Goto, false, false, false);
                }
            }
            else
            {
                num5 = (useInversePosition ? (s.duration - num) : num);
            }
            return(Sequence.ApplyInternalCycle(s, num5, useInversePosition ? (s.duration - num2) : num2, updateMode, useInversePosition, flag, false));
        }