Exemple #1
0
 public virtual void Dispose()
 {
     RenderManager.Renderer.DeleteMesh(this);
     vertices.Clear();
     indices.Clear();
     if (skeleton != null)
     {
         if (skeleton.GetAnimations() != null)
         {
             skeleton.GetAnimations().Clear();
         }
         if (skeleton.GetBones() != null)
         {
             skeleton.GetBones().Clear();
         }
         skeleton = null;
     }
 }
 public void PlayAnimation(string name, float speed)
 {
     if (currentAnim == null || currentAnim.GetName() != name || playState != PlayState.Playing || this.speed != speed)
     {
         ResetAnimation();
         SetAnimation(skeleton.GetAnimations().IndexOf(skeleton.GetAnimation(name)));
         SetSpeed(speed);
         SetPlayState(PlayState.Playing);
     }
 }
 private static void SaveSkeleton(Skeleton s, XmlWriter writer)
 {
     writer.WriteStartElement(TOKEN_SKELETON);
     foreach (Bone b in s.GetBones())
     {
         SaveBone(b, writer);
     }
     if (s.GetAnimations().Count > 0)
     {
         SaveAnimations(s, writer);
     }
     writer.WriteEndElement();
 }
 private static void SaveAnimations(Skeleton s, XmlWriter writer)
 {
     writer.WriteStartElement(TOKEN_ANIMATIONS);
     foreach (Animation anim in s.GetAnimations())
     {
         SaveAnimation(anim, writer);
     }
     writer.WriteEndElement();
 }