예제 #1
0
        public static int FilteredOperation(OperationType operationType, FilterType filterType, object id, bool optionalBool, float optionalFloat, object optionalObj = null)
        {
            int  num  = 0;
            bool flag = false;

            for (int i = TweenManager._maxActiveLookupId; i > -1; i--)
            {
                Tween tween = TweenManager._activeTweens[i];
                if (tween != null && tween.active)
                {
                    bool flag2 = false;
                    switch (filterType)
                    {
                    case FilterType.All:
                        flag2 = true;
                        break;

                    case FilterType.TargetOrId:
                        flag2 = (id.Equals(tween.id) || id.Equals(tween.target));
                        break;

                    case FilterType.TargetAndId:
                        flag2 = (id.Equals(tween.id) && optionalObj != null && optionalObj.Equals(tween.target));
                        break;
                    }
                    if (flag2)
                    {
                        switch (operationType)
                        {
                        case OperationType.Complete:
                        {
                            bool autoKill = tween.autoKill;
                            if (TweenManager.Complete(tween, false))
                            {
                                num += ((!optionalBool) ? 1 : (autoKill ? 1 : 0));
                                if (autoKill)
                                {
                                    if (TweenManager.isUpdateLoop)
                                    {
                                        tween.active = false;
                                    }
                                    else
                                    {
                                        flag = true;
                                        TweenManager._KillList.Add(tween);
                                    }
                                }
                            }
                            break;
                        }

                        case OperationType.Despawn:
                            num++;
                            if (TweenManager.isUpdateLoop)
                            {
                                tween.active = false;
                            }
                            else
                            {
                                TweenManager.Despawn(tween, false);
                                flag = true;
                                TweenManager._KillList.Add(tween);
                            }
                            break;

                        case OperationType.Flip:
                            if (TweenManager.Flip(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.Goto:
                            TweenManager.Goto(tween, optionalFloat, optionalBool, UpdateMode.Goto);
                            num++;
                            break;

                        case OperationType.Pause:
                            if (TweenManager.Pause(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.Play:
                            if (TweenManager.Play(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.PlayForward:
                            if (TweenManager.PlayForward(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.PlayBackwards:
                            if (TweenManager.PlayBackwards(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.Rewind:
                            if (TweenManager.Rewind(tween, optionalBool))
                            {
                                num++;
                            }
                            break;

                        case OperationType.SmoothRewind:
                            if (TweenManager.SmoothRewind(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.Restart:
                            if (TweenManager.Restart(tween, optionalBool))
                            {
                                num++;
                            }
                            break;

                        case OperationType.TogglePause:
                            if (TweenManager.TogglePause(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.IsTweening:
                            if (!tween.isComplete || !tween.autoKill)
                            {
                                num++;
                            }
                            break;
                        }
                    }
                }
            }
            if (flag)
            {
                int num2 = TweenManager._KillList.Count - 1;
                for (int j = num2; j > -1; j--)
                {
                    TweenManager.RemoveActiveTween(TweenManager._KillList[j]);
                }
                TweenManager._KillList.Clear();
            }
            return(num);
        }
예제 #2
0
        internal static int FilteredOperation(OperationType operationType, FilterType filterType, object id, bool optionalBool, float optionalFloat, object optionalObj = null, object[] optionalArray = null)
        {
            int  num  = 0;
            bool flag = false;
            int  num2 = (optionalArray != null) ? optionalArray.Length : 0;

            for (int num3 = TweenManager._maxActiveLookupId; num3 > -1; num3--)
            {
                Tween tween = TweenManager._activeTweens[num3];
                if (tween != null && tween.active)
                {
                    bool flag2 = false;
                    switch (filterType)
                    {
                    case FilterType.All:
                        flag2 = true;
                        break;

                    case FilterType.TargetOrId:
                        flag2 = (id.Equals(tween.id) || id.Equals(tween.target));
                        break;

                    case FilterType.TargetAndId:
                        flag2 = (id.Equals(tween.id) && optionalObj != null && optionalObj.Equals(tween.target));
                        break;

                    case FilterType.AllExceptTargetsOrIds:
                    {
                        flag2 = true;
                        int num4 = 0;
                        while (num4 < num2)
                        {
                            object obj = optionalArray[num4];
                            if (!obj.Equals(tween.id) && !obj.Equals(tween.target))
                            {
                                num4++;
                                continue;
                            }
                            flag2 = false;
                            break;
                        }
                        break;
                    }
                    }
                    if (flag2)
                    {
                        switch (operationType)
                        {
                        case OperationType.Despawn:
                            num++;
                            if (TweenManager.isUpdateLoop)
                            {
                                tween.active = false;
                            }
                            else
                            {
                                TweenManager.Despawn(tween, false);
                                flag = true;
                                TweenManager._KillList.Add(tween);
                            }
                            break;

                        case OperationType.Complete:
                        {
                            bool autoKill = tween.autoKill;
                            if (TweenManager.Complete(tween, false, (UpdateMode)((!(optionalFloat > 0f)) ? 1 : 0)))
                            {
                                num += ((!optionalBool) ? 1 : (autoKill ? 1 : 0));
                                if (autoKill)
                                {
                                    if (TweenManager.isUpdateLoop)
                                    {
                                        tween.active = false;
                                    }
                                    else
                                    {
                                        flag = true;
                                        TweenManager._KillList.Add(tween);
                                    }
                                }
                            }
                            break;
                        }

                        case OperationType.Flip:
                            if (TweenManager.Flip(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.Goto:
                            TweenManager.Goto(tween, optionalFloat, optionalBool, UpdateMode.Goto);
                            num++;
                            break;

                        case OperationType.Pause:
                            if (TweenManager.Pause(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.Play:
                            if (TweenManager.Play(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.PlayBackwards:
                            if (TweenManager.PlayBackwards(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.PlayForward:
                            if (TweenManager.PlayForward(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.Restart:
                            if (TweenManager.Restart(tween, optionalBool))
                            {
                                num++;
                            }
                            break;

                        case OperationType.Rewind:
                            if (TweenManager.Rewind(tween, optionalBool))
                            {
                                num++;
                            }
                            break;

                        case OperationType.SmoothRewind:
                            if (TweenManager.SmoothRewind(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.TogglePause:
                            if (TweenManager.TogglePause(tween))
                            {
                                num++;
                            }
                            break;

                        case OperationType.IsTweening:
                            if (tween.isComplete && tween.autoKill)
                            {
                                break;
                            }
                            num++;
                            break;
                        }
                    }
                }
            }
            if (flag)
            {
                for (int num5 = TweenManager._KillList.Count - 1; num5 > -1; num5--)
                {
                    TweenManager.RemoveActiveTween(TweenManager._KillList[num5]);
                }
                TweenManager._KillList.Clear();
            }
            return(num);
        }