private void Elapsed(ulong millSinceBeginning) { lock (this._tempPaths) { if (this._tempPaths != null && this.ActivePath == null && this._tempPaths.Count > 0) { while (this.ActivePath == null) { if (this._tempReverseRepeat) { this.ActivePath = this._tempPaths.LastOrDefault <Path>(); this._tempPaths.RemoveAt(this._tempPaths.Count - 1); } else { this.ActivePath = this._tempPaths.FirstOrDefault <Path>(); this._tempPaths.RemoveAt(0); } this._timer.ResetClock(); millSinceBeginning = 0UL; } } if (this.ActivePath != null) { if (!this._tempReverseRepeat && millSinceBeginning < this.ActivePath.Delay) { this.CurrentStatus = AnimatorStatus.OnHold; } else if (millSinceBeginning - (!this._tempReverseRepeat ? this.ActivePath.Delay : 0UL) <= this.ActivePath.Duration) { if (this.CurrentStatus != AnimatorStatus.Playing) { this.FrameCallback.Invoke(this._tempReverseRepeat ? this.ActivePath.End : this.ActivePath.Start); this.CurrentStatus = AnimatorStatus.Playing; } this.FrameCallback.Invoke(this.ActivePath.Function(this._tempReverseRepeat ? (float)(this.ActivePath.Duration - millSinceBeginning) : (float)(millSinceBeginning - this.ActivePath.Delay), this.ActivePath.Start, this.ActivePath.Change, (float)this.ActivePath.Duration)); } else { if (this.CurrentStatus == AnimatorStatus.Playing) { this.FrameCallback.Invoke(this._tempReverseRepeat ? this.ActivePath.Start : this.ActivePath.End); } if (this._tempReverseRepeat && millSinceBeginning - this.ActivePath.Duration < this.ActivePath.Delay) { this.CurrentStatus = AnimatorStatus.OnHold; } else { this.ActivePath = (Path)null; } } } else if (this.Repeat) { lock (this._tempPaths) { this._tempPaths.AddRange((IEnumerable <Path>) this._paths); this._tempReverseRepeat = this.ReverseRepeat && !this._tempReverseRepeat; } } else { this.Stop(); SafeInvoker temp_11 = this.EndCallback; if (temp_11 == null) { return; } temp_11.Invoke(); } } }