Ejemplo n.º 1
0
 static int SortSequencedObjs(ABSSequentiable a, ABSSequentiable b)
 {
     if (a.sequencedPosition > b.sequencedPosition)
     {
         return(1);
     }
     if (a.sequencedPosition < b.sequencedPosition)
     {
         return(-1);
     }
     return(0);
 }
Ejemplo n.º 2
0
        public static Sequence DoPrependInterval(Sequence inSequence, float interval)
        {
            inSequence.duration += interval;
            int count = inSequence._sequencedObjs.Count;

            for (int i = 0; i < count; i++)
            {
                ABSSequentiable aBSSequentiable = inSequence._sequencedObjs[i];
                aBSSequentiable.sequencedPosition    += interval;
                aBSSequentiable.sequencedEndPosition += interval;
            }
            return(inSequence);
        }
Ejemplo n.º 3
0
        // Token: 0x0600008E RID: 142 RVA: 0x00003BB0 File Offset: 0x00001DB0
        internal static Sequence DoPrependInterval(Sequence inSequence, float interval)
        {
            inSequence.lastTweenInsertTime = 0f;
            inSequence.duration           += interval;
            int count = inSequence._sequencedObjs.Count;

            for (int i = 0; i < count; i++)
            {
                ABSSequentiable abssequentiable = inSequence._sequencedObjs[i];
                abssequentiable.sequencedPosition    += interval;
                abssequentiable.sequencedEndPosition += interval;
            }
            return(inSequence);
        }
Ejemplo n.º 4
0
        internal static Sequence DoPrependInterval(Sequence inSequence, float interval)
        {
            inSequence.duration += interval;
            int len = inSequence._sequencedObjs.Count;

            for (int i = 0; i < len; ++i)
            {
                ABSSequentiable sequentiable = inSequence._sequencedObjs[i];
                sequentiable.sequencedPosition    += interval;
                sequentiable.sequencedEndPosition += interval;
            }

            return(inSequence);
        }
Ejemplo n.º 5
0
        public static Sequence DoInsertCallback(Sequence inSequence, TweenCallback callback, float atPosition)
        {
            SequenceCallback sequenceCallback = new SequenceCallback(atPosition, callback);
            ABSSequentiable  arg_13_0         = sequenceCallback;

            sequenceCallback.sequencedEndPosition = atPosition;
            arg_13_0.sequencedPosition            = atPosition;
            inSequence._sequencedObjs.Add(sequenceCallback);
            if (inSequence.duration < atPosition)
            {
                inSequence.duration = atPosition;
            }
            return(inSequence);
        }
Ejemplo n.º 6
0
        static void StableSortSequencedObjs(List <ABSSequentiable> list)
        {
            int len = list.Count;

            for (int i = 1; i < len; i++)
            {
                int             j    = i;
                ABSSequentiable temp = list[i];
                while (j > 0 && list[j - 1].sequencedPosition > temp.sequencedPosition)
                {
                    list[j] = list[j - 1];
                    j       = j - 1;
                }
                list[j] = temp;
            }
        }
Ejemplo n.º 7
0
        // Token: 0x0600008B RID: 139 RVA: 0x00003A40 File Offset: 0x00001C40
        internal static Sequence DoPrepend(Sequence inSequence, Tween t)
        {
            if (t.loops == -1)
            {
                t.loops = 1;
            }
            float num = t.delay + t.duration * (float)t.loops;

            inSequence.duration += num;
            int count = inSequence._sequencedObjs.Count;

            for (int i = 0; i < count; i++)
            {
                ABSSequentiable abssequentiable = inSequence._sequencedObjs[i];
                abssequentiable.sequencedPosition    += num;
                abssequentiable.sequencedEndPosition += num;
            }
            return(Sequence.DoInsert(inSequence, t, 0f));
        }
Ejemplo n.º 8
0
        internal static Sequence DoPrepend(Sequence inSequence, Tween t)
        {
            if (t.loops == -1)
            {
                t.loops = 1;
            }
            float tFullTime = t.delay + (t.duration * t.loops);

            inSequence.duration += tFullTime;
            int len = inSequence._sequencedObjs.Count;

            for (int i = 0; i < len; ++i)
            {
                ABSSequentiable sequentiable = inSequence._sequencedObjs[i];
                sequentiable.sequencedPosition    += tFullTime;
                sequentiable.sequencedEndPosition += tFullTime;
            }

            return(DoInsert(inSequence, t, 0));
        }
Ejemplo n.º 9
0
        // ===================================================================================
        // METHODS ---------------------------------------------------------------------------

        // Returns TRUE if the tween needs to be killed
        static bool ApplyInternalCycle(Sequence s, float fromPos, float toPos, UpdateMode updateMode, bool useInverse, bool prevPosIsInverse, bool multiCycleStep = false)
        {
            bool isBackwardsUpdate = toPos < fromPos;

//            Debug.Log(Time.frameCount + " " + s.id + " " + (multiCycleStep ? "<color=#FFEC03>Multicycle</color> > " : "Cycle > ") + s.position + "/" + s.duration + " - s.isBackwards: " + s.isBackwards + ", useInverse/prevInverse: " + useInverse + "/" + prevPosIsInverse + " - " + fromPos + " > " + toPos + " - UpdateMode: " + updateMode + ", isPlaying: " + s.isPlaying + ", completedLoops: " + s.completedLoops);
            if (isBackwardsUpdate)
            {
                int len = s._sequencedObjs.Count - 1;
                for (int i = len; i > -1; --i)
                {
                    if (!s.active)
                    {
                        return(true);           // Killed by some internal callback
                    }
                    ABSSequentiable sequentiable = s._sequencedObjs[i];
                    if (sequentiable.sequencedEndPosition < toPos || sequentiable.sequencedPosition > fromPos)
                    {
                        continue;
                    }
                    if (sequentiable.tweenType == TweenType.Callback)
                    {
                        if (updateMode == UpdateMode.Update && prevPosIsInverse)
                        {
//                            Debug.Log("<color=#FFEC03>BACKWARDS Callback > " + s.id + " - s.isBackwards: " + s.isBackwards + ", useInverse/prevInverse: " + useInverse + "/" + prevPosIsInverse + " - " + fromPos + " > " + toPos + "</color>");
                            OnTweenCallback(sequentiable.onStart);
                        }
                    }
                    else
                    {
                        // Nested Tweener/Sequence
                        float gotoPos = toPos - sequentiable.sequencedPosition;
//                        float gotoPos = (float)((decimal)toPos - (decimal)sequentiable.sequencedPosition);
                        if (gotoPos < 0)
                        {
                            gotoPos = 0;
                        }
                        Tween t = (Tween)sequentiable;
                        if (!t.startupDone)
                        {
                            continue;                 // since we're going backwards and this tween never started just ignore it
                        }
                        t.isBackwards = true;
                        if (TweenManager.Goto(t, gotoPos, false, updateMode))
                        {
                            return(true);
                        }

                        // Fixes nested callbacks not being called correctly if main sequence has loops and nested ones don't
                        if (multiCycleStep && t.tweenType == TweenType.Sequence)
                        {
                            if (s.position <= 0 && s.completedLoops == 0)
                            {
                                t.position = 0;
                            }
                            else
                            {
                                bool toZero = s.completedLoops == 0 || s.isBackwards && (s.completedLoops < s.loops || s.loops == -1);
                                if (t.isBackwards)
                                {
                                    toZero = !toZero;
                                }
                                if (useInverse)
                                {
                                    toZero = !toZero;
                                }
                                if (s.isBackwards && !useInverse && !prevPosIsInverse)
                                {
                                    toZero = !toZero;
                                }
                                t.position = toZero ? 0 : t.duration;
                            }
                        }
                    }
                }
            }
            else
            {
                int len = s._sequencedObjs.Count;
                for (int i = 0; i < len; ++i)
                {
                    if (!s.active)
                    {
                        return(true);           // Killed by some internal callback
                    }
                    ABSSequentiable sequentiable = s._sequencedObjs[i];
//                    if (sequentiable.sequencedPosition > toPos || sequentiable.sequencedEndPosition < fromPos) continue;
                    // Fix rare case with high FPS when a tween/callback might happen in same exact time as it's set
                    // This fixes it but should check for backwards tweens and loops
                    if (
                        sequentiable.sequencedPosition > toPos ||
                        sequentiable.sequencedPosition > 0 && sequentiable.sequencedEndPosition <= fromPos ||
                        sequentiable.sequencedPosition <= 0 && sequentiable.sequencedEndPosition < fromPos
                        )
                    {
                        continue;
                    }
                    if (sequentiable.tweenType == TweenType.Callback)
                    {
                        if (updateMode == UpdateMode.Update)
                        {
//                            Debug.Log("<color=#FFEC03>FORWARD Callback > " + s.id + " - s.isBackwards: " + s.isBackwards + ", useInverse/prevInverse: " + useInverse + "/" + prevPosIsInverse + " - " + fromPos + " > " + toPos + "</color>");
                            bool fire = !s.isBackwards && !useInverse && !prevPosIsInverse ||
                                        s.isBackwards && useInverse && !prevPosIsInverse;
                            if (fire)
                            {
                                OnTweenCallback(sequentiable.onStart);
                            }
                        }
                    }
                    else
                    {
                        // Nested Tweener/Sequence
                        float gotoPos = toPos - sequentiable.sequencedPosition;
//                        float gotoPos = (float)((decimal)toPos - (decimal)sequentiable.sequencedPosition);
                        if (gotoPos < 0)
                        {
                            gotoPos = 0;
                        }
                        Tween t = (Tween)sequentiable;
                        // Fix for final nested tween not calling OnComplete in some cases
                        if (toPos >= sequentiable.sequencedEndPosition)
                        {
                            if (!t.startupDone)
                            {
                                TweenManager.ForceInit(t, true);
                            }
                            if (gotoPos < t.fullDuration)
                            {
                                gotoPos = t.fullDuration;
                            }
                        }
                        //
                        t.isBackwards = false;
                        if (TweenManager.Goto(t, gotoPos, false, updateMode))
                        {
                            return(true);
                        }

                        // Fixes nested callbacks not being called correctly if main sequence has loops and nested ones don't
                        if (multiCycleStep && t.tweenType == TweenType.Sequence)
                        {
                            if (s.position <= 0 && s.completedLoops == 0)
                            {
                                t.position = 0;
                            }
                            else
                            {
                                bool toZero = s.completedLoops == 0 || !s.isBackwards && (s.completedLoops < s.loops || s.loops == -1);
                                if (t.isBackwards)
                                {
                                    toZero = !toZero;
                                }
                                if (useInverse)
                                {
                                    toZero = !toZero;
                                }
                                if (s.isBackwards && !useInverse && !prevPosIsInverse)
                                {
                                    toZero = !toZero;
                                }
                                t.position = toZero ? 0 : t.duration;
                            }
                        }
                    }
                }
            }
            return(false);
        }
Ejemplo n.º 10
0
 private static bool ApplyInternalCycle(Sequence s, float fromPos, float toPos, UpdateMode updateMode, bool useInverse, bool prevPosIsInverse, bool multiCycleStep = false /* Metadata: 0x0060FA28 */) => default; // 0x004D73B0-0x004D7990
 private static int SortSequencedObjs(ABSSequentiable a, ABSSequentiable b) => default;                                                                                                                            // 0x004D7990-0x004D79B0
Ejemplo n.º 11
0
 // Token: 0x06000097 RID: 151 RVA: 0x0000403C File Offset: 0x0000223C
 private static bool ApplyInternalCycle(Sequence s, float fromPos, float toPos, UpdateMode updateMode, bool useInverse, bool prevPosIsInverse, bool multiCycleStep = false)
 {
     if (toPos < fromPos)
     {
         for (int i = s._sequencedObjs.Count - 1; i > -1; i--)
         {
             if (!s.active)
             {
                 return(true);
             }
             ABSSequentiable abssequentiable = s._sequencedObjs[i];
             if (abssequentiable.sequencedEndPosition >= toPos && abssequentiable.sequencedPosition <= fromPos)
             {
                 if (abssequentiable.tweenType == TweenType.Callback)
                 {
                     if (updateMode == UpdateMode.Update && prevPosIsInverse)
                     {
                         Tween.OnTweenCallback(abssequentiable.onStart);
                     }
                 }
                 else
                 {
                     float num = toPos - abssequentiable.sequencedPosition;
                     if (num < 0f)
                     {
                         num = 0f;
                     }
                     Tween tween = (Tween)abssequentiable;
                     if (tween.startupDone)
                     {
                         tween.isBackwards = true;
                         if (TweenManager.Goto(tween, num, false, updateMode))
                         {
                             return(true);
                         }
                         if (multiCycleStep && tween.tweenType == TweenType.Sequence)
                         {
                             if (s.position <= 0f && s.completedLoops == 0)
                             {
                                 tween.position = 0f;
                             }
                             else
                             {
                                 bool flag = s.completedLoops == 0 || (s.isBackwards && (s.completedLoops < s.loops || s.loops == -1));
                                 if (tween.isBackwards)
                                 {
                                     flag = !flag;
                                 }
                                 if (useInverse)
                                 {
                                     flag = !flag;
                                 }
                                 if (s.isBackwards && !useInverse && !prevPosIsInverse)
                                 {
                                     flag = !flag;
                                 }
                                 tween.position = (flag ? 0f : tween.duration);
                             }
                         }
                     }
                 }
             }
         }
     }
     else
     {
         int count = s._sequencedObjs.Count;
         for (int j = 0; j < count; j++)
         {
             if (!s.active)
             {
                 return(true);
             }
             ABSSequentiable abssequentiable2 = s._sequencedObjs[j];
             if (abssequentiable2.sequencedPosition <= toPos && abssequentiable2.sequencedEndPosition >= fromPos)
             {
                 if (abssequentiable2.tweenType == TweenType.Callback)
                 {
                     if (updateMode == UpdateMode.Update && ((!s.isBackwards && !useInverse && !prevPosIsInverse) || (s.isBackwards && useInverse && !prevPosIsInverse)))
                     {
                         Tween.OnTweenCallback(abssequentiable2.onStart);
                     }
                 }
                 else
                 {
                     float num2 = toPos - abssequentiable2.sequencedPosition;
                     if (num2 < 0f)
                     {
                         num2 = 0f;
                     }
                     Tween tween2 = (Tween)abssequentiable2;
                     tween2.isBackwards = false;
                     if (TweenManager.Goto(tween2, num2, false, updateMode))
                     {
                         return(true);
                     }
                     if (multiCycleStep && tween2.tweenType == TweenType.Sequence)
                     {
                         if (s.position <= 0f && s.completedLoops == 0)
                         {
                             tween2.position = 0f;
                         }
                         else
                         {
                             bool flag2 = s.completedLoops == 0 || (!s.isBackwards && (s.completedLoops < s.loops || s.loops == -1));
                             if (tween2.isBackwards)
                             {
                                 flag2 = !flag2;
                             }
                             if (useInverse)
                             {
                                 flag2 = !flag2;
                             }
                             if (s.isBackwards && !useInverse && !prevPosIsInverse)
                             {
                                 flag2 = !flag2;
                             }
                             tween2.position = (flag2 ? 0f : tween2.duration);
                         }
                     }
                 }
             }
         }
     }
     return(false);
 }
Ejemplo n.º 12
0
        // ===================================================================================
        // METHODS ---------------------------------------------------------------------------

        // Returns TRUE if the tween needs to be killed
        static bool ApplyInternalCycle(Sequence s, float fromPos, float toPos, UpdateMode updateMode, bool useInverse, bool prevPosIsInverse, bool multiCycleStep = false)
        {
            bool isBackwardsUpdate = toPos < fromPos;

//            Debug.Log((multiCycleStep ? "<color=#FFEC03>Multicycle</color> > " : "Cycle > ") + s.position + "/" + s.duration + " - s.isBackwards: " + s.isBackwards + ", useInverse/prevInverse: " + useInverse + "/" + prevPosIsInverse + " - " + fromPos + " > " + toPos);
            if (isBackwardsUpdate)
            {
                int len = s._sequencedObjs.Count - 1;
                for (int i = len; i > -1; --i)
                {
                    if (!s.active)
                    {
                        return(true);           // Killed by some internal callback
                    }
                    ABSSequentiable sequentiable = s._sequencedObjs[i];
                    if (sequentiable.sequencedEndPosition < toPos || sequentiable.sequencedPosition > fromPos)
                    {
                        continue;
                    }
                    if (sequentiable.tweenType == TweenType.Callback)
                    {
                        if (updateMode == UpdateMode.Update && prevPosIsInverse)
                        {
//                            Debug.Log("<color=#FFEC03>BACKWARDS Callback > " + s.id + " - s.isBackwards: " + s.isBackwards + ", useInverse/prevInverse: " + useInverse + "/" + prevPosIsInverse + " - " + fromPos + " > " + toPos + "</color>");
                            sequentiable.onStart();
                        }
                    }
                    else
                    {
                        // Nested Tweener/Sequence
                        float gotoPos = toPos - sequentiable.sequencedPosition;
                        if (gotoPos < 0)
                        {
                            gotoPos = 0;
                        }
                        Tween t = (Tween)sequentiable;
                        if (!t.startupDone)
                        {
                            continue;                 // since we're going backwards and this tween never started just ignore it
                        }
                        t.isBackwards = true;
                        if (TweenManager.Goto(t, gotoPos, false, updateMode))
                        {
                            return(true);
                        }

                        // Fixes nested callbacks not being called correctly if main sequence has loops and nested ones don't
                        if (multiCycleStep && t.tweenType == TweenType.Sequence)
                        {
                            if (s.position <= 0 && s.completedLoops == 0)
                            {
                                t.position = 0;
                            }
                            else
                            {
                                bool toZero = s.completedLoops == 0 || s.isBackwards && (s.completedLoops < s.loops || s.loops == -1);
                                if (t.isBackwards)
                                {
                                    toZero = !toZero;
                                }
                                if (useInverse)
                                {
                                    toZero = !toZero;
                                }
                                if (s.isBackwards && !useInverse && !prevPosIsInverse)
                                {
                                    toZero = !toZero;
                                }
                                t.position = toZero ? 0 : t.duration;
                            }
                        }
                    }
                }
            }
            else
            {
                // Debug
                int len = s._sequencedObjs.Count;
                for (int i = 0; i < len; ++i)
                {
                    if (!s.active)
                    {
                        return(true);           // Killed by some internal callback
                    }
                    ABSSequentiable sequentiable = s._sequencedObjs[i];
                    if (sequentiable.sequencedPosition > toPos || sequentiable.sequencedEndPosition < fromPos)
                    {
                        continue;
                    }
                    if (sequentiable.tweenType == TweenType.Callback)
                    {
                        if (updateMode == UpdateMode.Update)
                        {
//                            Debug.Log("<color=#FFEC03>FORWARD Callback > " + s.id + " - s.isBackwards: " + s.isBackwards + ", useInverse/prevInverse: " + useInverse + "/" + prevPosIsInverse + " - " + fromPos + " > " + toPos + "</color>");
                            bool fire = !s.isBackwards && !useInverse && !prevPosIsInverse ||
                                        s.isBackwards && useInverse && !prevPosIsInverse;
                            if (fire)
                            {
                                sequentiable.onStart();
                            }
                        }
                    }
                    else
                    {
                        // Nested Tweener/Sequence
                        float gotoPos = toPos - sequentiable.sequencedPosition;
                        if (gotoPos < 0)
                        {
                            gotoPos = 0;
                        }
                        Tween t = (Tween)sequentiable;
                        t.isBackwards = false;
                        if (TweenManager.Goto(t, gotoPos, false, updateMode))
                        {
                            return(true);
                        }

                        // Fixes nested callbacks not being called correctly if main sequence has loops and nested ones don't
                        if (multiCycleStep && t.tweenType == TweenType.Sequence)
                        {
                            if (s.position <= 0 && s.completedLoops == 0)
                            {
                                t.position = 0;
                            }
                            else
                            {
                                bool toZero = s.completedLoops == 0 || !s.isBackwards && (s.completedLoops < s.loops || s.loops == -1);
                                if (t.isBackwards)
                                {
                                    toZero = !toZero;
                                }
                                if (useInverse)
                                {
                                    toZero = !toZero;
                                }
                                if (s.isBackwards && !useInverse && !prevPosIsInverse)
                                {
                                    toZero = !toZero;
                                }
                                t.position = toZero ? 0 : t.duration;
                            }
                        }
                    }
                }
            }
            return(false);
        }