public void CopyValuesTo(CompositeAnimation target, CompositeEntity newParent) { target.Parent = newParent; target.Name = this.Name; target.LerpLastFrameWithFirst = this.LerpLastFrameWithFirst; target.IsPaused = this.IsPaused; target.IsStopped = this.IsStopped; target.LoopMax = this.LoopMax; target.Speed = this.Speed; target.AutoPlay = this.AutoPlay; target.HideWhenStopped = this.HideWhenStopped; // copy keyframes for (int i = 0; i < this._keyFrames.Count; i++) { // if no particle type is available if (target.KeyFrames.Count <= i) { target.KeyFrames.Add(new CompositeKeyFrame(target)); } this.KeyFrames[i].CopyValuesTo(target.KeyFrames[i], target); } // Remove remaining types (can cause garbage!) for (int i = target.KeyFrames.Count; i > this.KeyFrames.Count; i--) { target.KeyFrames.RemoveAt(i - 1); } target.Reset(); }
internal void OnEndOfAnimLoopReached(CompositeAnimation compositeAnimation) { if (EndOfAnimLoopReached != null) { EndOfAnimLoopReached(compositeAnimation, EventArgs.Empty); } if (_queuedAnimationID.HasValue) { compositeAnimation.IsStopped = true; compositeAnimation.Reset(); _currentAnimationID = _queuedAnimationID.Value; _animations[_queuedAnimationID.Value].Play(); _queuedAnimationID = null; } }
public void CopyValuesTo(CompositeAnimation target, CompositeEntity newParent) { target.Parent = newParent; target.Name = this.Name; target.LerpLastFrameWithFirst = this.LerpLastFrameWithFirst; target.IsPaused = this.IsPaused; target.IsStopped = this.IsStopped; target.LoopMax = this.LoopMax; target.Speed = this.Speed; target.AutoPlay = this.AutoPlay; target.HideWhenStopped = this.HideWhenStopped; // copy keyframes for (int i = 0; i < this._keyFrames.Count; i++) { // if no particle type is available if (target.KeyFrames.Count <= i) { target.KeyFrames.Add(new CompositeKeyFrame(target)); } this.KeyFrames[i].CopyValuesTo(target.KeyFrames[i], target); } // Remove remaining types (can cause garbage!) for (int i = target.KeyFrames.Count; i > this.KeyFrames.Count; i--) { target.KeyFrames.RemoveAt(i-1); } target.Reset(); }