EntityData.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 Jiang Yin. All rights reserved.
  4. // Homepage: https://gameframework.cn/
  5. // Feedback: mailto:ellan@gameframework.cn
  6. //------------------------------------------------------------
  7. using System;
  8. using UnityEngine;
  9. namespace MetaClient
  10. {
  11. [Serializable]
  12. public abstract class EntityData
  13. {
  14. [SerializeField]
  15. private int m_Id = 0;
  16. [SerializeField]
  17. private int m_TypeId = 0;
  18. [SerializeField]
  19. private Vector3 m_Position = Vector3.zero;
  20. [SerializeField]
  21. private Quaternion m_Rotation = Quaternion.identity;
  22. public EntityData(int entityId, int typeId)
  23. {
  24. m_Id = entityId;
  25. m_TypeId = typeId;
  26. }
  27. /// <summary>
  28. /// 实体编号。
  29. /// </summary>
  30. public int Id
  31. {
  32. get
  33. {
  34. return m_Id;
  35. }
  36. }
  37. /// <summary>
  38. /// 实体类型编号。
  39. /// </summary>
  40. public int TypeId
  41. {
  42. get
  43. {
  44. return m_TypeId;
  45. }
  46. }
  47. /// <summary>
  48. /// 实体位置。
  49. /// </summary>
  50. public Vector3 Position
  51. {
  52. get
  53. {
  54. return m_Position;
  55. }
  56. set
  57. {
  58. m_Position = value;
  59. }
  60. }
  61. /// <summary>
  62. /// 实体朝向。
  63. /// </summary>
  64. public Quaternion Rotation
  65. {
  66. get
  67. {
  68. return m_Rotation;
  69. }
  70. set
  71. {
  72. m_Rotation = value;
  73. }
  74. }
  75. }
  76. }