LayoutInfoReader.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // LayoutInfoReader.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 Microsoft.Xna.Framework;
  13. using Microsoft.Xna.Framework.Content;
  14. using Microsoft.Xna.Framework.Graphics;
  15. using TRead = MovipaLibrary.LayoutInfo;
  16. #endregion
  17. namespace MovipaLibrary
  18. {
  19. /// <summary>
  20. /// This class restores the xnb file converted by the content pipeline
  21. /// to the value of LayoutInfoReader.
  22. /// This ContentTypeReader must be the same as the runtime
  23. /// specified in ContentTypeWriter that was used to write the xnb
  24. /// whose type is LayoutInfoReader.
  25. ///
  26. /// ContentPipelineで変換されたxnbファイルをLayoutInfoReaderの値に復元します。
  27. /// このContentTypeReaderはLayoutInfoReader型のxnbを書き込む際に使用した
  28. /// ContentTypeWriterで指定されたランタイムと同じである必要があります。
  29. /// </summary>
  30. public class LayoutInfoReader : ContentTypeReader<TRead>
  31. {
  32. /// <summary>
  33. /// Reads LayoutInfo from the xnb file.
  34. ///
  35. /// xnbファイルからLayoutInfoを読み込みます。
  36. /// </summary>
  37. protected override TRead Read(ContentReader input, TRead existingInstance)
  38. {
  39. TRead info = new TRead();
  40. // Reads AnimationInfo.
  41. //
  42. // AnimationInfoを読み込みます。
  43. AnimationInfoReader.ReadAnimationInfo(input, info);
  44. // Reads LayoutInfo.
  45. //
  46. // LayoutInfoを読み込みます。
  47. info.SceneDataAsset = input.ReadString();
  48. info.Sequence = input.ReadString();
  49. return info;
  50. }
  51. }
  52. }