コード例 #1
0
        public void Run(float deltaTime, float unscaledDeltaTime)
        {
            lock (this.runningAndQueueLock)
                this.running = true;
            lock (this.arrayLock)
            {
                int index1 = this.tail - 1;
label_24:
                for (int index2 = 0; index2 < this.tweens.Length; ++index2)
                {
                    ITween tween1 = this.tweens[index2];
                    if (tween1 != null)
                    {
                        try
                        {
                            if (!tween1.MoveNext(ref deltaTime, ref unscaledDeltaTime))
                            {
                                this.tweens[index2] = (ITween)null;
                            }
                            else
                            {
                                continue;
                            }
                        }
                        catch (Exception ex)
                        {
                            this.tweens[index2] = (ITween)null;
                            try
                            {
                                this.unhandledExceptionCallback(ex);
                            }
                            catch
                            {
                            }
                        }
                    }
                    while (index2 < index1)
                    {
                        ITween tween2 = this.tweens[index1];
                        if (tween2 != null)
                        {
                            try
                            {
                                if (!tween2.MoveNext(ref deltaTime, ref unscaledDeltaTime))
                                {
                                    this.tweens[index1] = (ITween)null;
                                    --index1;
                                }
                                else
                                {
                                    this.tweens[index2] = tween2;
                                    this.tweens[index1] = (ITween)null;
                                    --index1;
                                    goto label_24;
                                }
                            }
                            catch (Exception ex)
                            {
                                this.tweens[index1] = (ITween)null;
                                --index1;
                                try
                                {
                                    this.unhandledExceptionCallback(ex);
                                }
                                catch
                                {
                                }
                            }
                        }
                        else
                        {
                            --index1;
                        }
                    }
                    this.tail = index2;
                    break;
                }
                lock (this.runningAndQueueLock)
                {
                    this.running = false;
                    while (this.waitQueue.Count != 0)
                    {
                        if (this.tweens.Length == this.tail)
                        {
                            Array.Resize <ITween>(ref this.tweens, checked (this.tail * 2));
                        }
                        this.tweens[this.tail++] = this.waitQueue.Dequeue();
                    }
                }
            }
        }