Пример #1
0
 public CompositeKeyFrame(CompositeAnimation parentAnimation)
 {
     _name           = "New keyFrame";
     _boneTransforms = new List <CompositeBoneTransform>();
     _duration       = 100;
     Parent          = parentAnimation;
 }
Пример #2
0
 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();
 }
Пример #3
0
 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;
     }
 }
Пример #4
0
 public void CopyValuesTo(CompositeKeyFrame target, CompositeAnimation newParent)
 {
     target.Parent   = newParent;
     target.Name     = this.Name;
     target.Duration = this.Duration;
     // copy CompositeBoneTransforms
     for (int i = 0; i < this.BoneTransforms.Count; i++)
     {
         // if no transform is available
         if (target.BoneTransforms.Count <= i)
         {
             target.BoneTransforms.Add(new CompositeBoneTransform());
         }
         this.BoneTransforms[i].CopyValuesTo(target.BoneTransforms[i], target);
     }
     // Remove remaining types (can cause garbage!)
     for (int i = target.BoneTransforms.Count; i > this.BoneTransforms.Count; i--)
     {
         target.BoneTransforms.RemoveAt(i - 1);
     }
 }