HideEntityCompleteEventArgs.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 loyalsoft. All rights reserved.
  4. // Homepage: http://www.game7000.com/
  5. // Feedback: http://www.game7000.com/
  6. //------------------------------------------------------------
  7. using GameFramework;
  8. using GameFramework.Entity;
  9. using GameFramework.Event;
  10. namespace UnityGameFramework.Runtime
  11. {
  12. /// <summary>
  13. /// 隐藏实体完成事件。
  14. /// </summary>
  15. public sealed class HideEntityCompleteEventArgs : GameEventArgs
  16. {
  17. /// <summary>
  18. /// 隐藏实体完成事件编号。
  19. /// </summary>
  20. public static readonly int EventId = typeof(HideEntityCompleteEventArgs).GetHashCode();
  21. /// <summary>
  22. /// 初始化隐藏实体完成事件的新实例。
  23. /// </summary>
  24. public HideEntityCompleteEventArgs()
  25. {
  26. EntityId = 0;
  27. EntityAssetName = null;
  28. EntityGroup = null;
  29. UserData = null;
  30. }
  31. /// <summary>
  32. /// 获取隐藏实体完成事件编号。
  33. /// </summary>
  34. public override int Id
  35. {
  36. get
  37. {
  38. return EventId;
  39. }
  40. }
  41. /// <summary>
  42. /// 获取实体编号。
  43. /// </summary>
  44. public int EntityId
  45. {
  46. get;
  47. private set;
  48. }
  49. /// <summary>
  50. /// 获取实体资源名称。
  51. /// </summary>
  52. public string EntityAssetName
  53. {
  54. get;
  55. private set;
  56. }
  57. /// <summary>
  58. /// 获取实体所属的实体组。
  59. /// </summary>
  60. public IEntityGroup EntityGroup
  61. {
  62. get;
  63. private set;
  64. }
  65. /// <summary>
  66. /// 获取用户自定义数据。
  67. /// </summary>
  68. public object UserData
  69. {
  70. get;
  71. private set;
  72. }
  73. /// <summary>
  74. /// 创建隐藏实体完成事件。
  75. /// </summary>
  76. /// <param name="e">内部事件。</param>
  77. /// <returns>创建的隐藏实体完成事件。</returns>
  78. public static HideEntityCompleteEventArgs Create(GameFramework.Entity.HideEntityCompleteEventArgs e)
  79. {
  80. HideEntityCompleteEventArgs hideEntityCompleteEventArgs = ReferencePool.Acquire<HideEntityCompleteEventArgs>();
  81. hideEntityCompleteEventArgs.EntityId = e.EntityId;
  82. hideEntityCompleteEventArgs.EntityAssetName = e.EntityAssetName;
  83. hideEntityCompleteEventArgs.EntityGroup = e.EntityGroup;
  84. hideEntityCompleteEventArgs.UserData = e.UserData;
  85. return hideEntityCompleteEventArgs;
  86. }
  87. /// <summary>
  88. /// 清理隐藏实体完成事件。
  89. /// </summary>
  90. public override void Clear()
  91. {
  92. EntityId = 0;
  93. EntityAssetName = null;
  94. EntityGroup = null;
  95. UserData = null;
  96. }
  97. }
  98. }