AnimationSequence.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // AnimationSequence.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Text;
  13. using System.IO;
  14. using System.Xml;
  15. using System.Xml.Serialization;
  16. using Microsoft.Xna.Framework;
  17. using RobotGameData.Resource;
  18. #endregion
  19. namespace RobotGameData.GameObject
  20. {
  21. /// <summary>
  22. /// this is the basic unit of an animation that has key frame of several bones.
  23. /// It can load an XML file(.Animation).
  24. /// </summary>
  25. [Serializable]
  26. public class AnimationSequence
  27. {
  28. #region Fields
  29. public int KeyFrameSequenceCount = 0;
  30. /// <summary>
  31. /// KeyFrame duration time
  32. /// </summary>
  33. public float Duration = 0.0f;
  34. /// <summary>
  35. /// KeyFrames container
  36. /// </summary>
  37. public List<KeyFrameSequence> KeyFrameSequences = null;
  38. #endregion
  39. /// <summary>
  40. /// Gets the key frame sequence by index
  41. /// </summary>
  42. public KeyFrameSequence GetKeyFrameSequence(int index)
  43. {
  44. return KeyFrameSequences[index];
  45. }
  46. /// <summary>
  47. /// Gets the bone name of the key frame sequence
  48. /// </summary>
  49. /// <param name="index"></param>
  50. /// <returns></returns>
  51. public string GetKeyFrameSequenceBoneName(int index)
  52. {
  53. return GetKeyFrameSequence(index).BoneName;
  54. }
  55. }
  56. }