OpenUIFormDependencyAssetEventArgs.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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.Event;
  9. namespace UnityGameFramework.Runtime
  10. {
  11. /// <summary>
  12. /// 打开界面时加载依赖资源事件。
  13. /// </summary>
  14. public sealed class OpenUIFormDependencyAssetEventArgs : GameEventArgs
  15. {
  16. /// <summary>
  17. /// 打开界面时加载依赖资源事件编号。
  18. /// </summary>
  19. public static readonly int EventId = typeof(OpenUIFormDependencyAssetEventArgs).GetHashCode();
  20. /// <summary>
  21. /// 初始化打开界面时加载依赖资源事件的新实例。
  22. /// </summary>
  23. public OpenUIFormDependencyAssetEventArgs()
  24. {
  25. SerialId = 0;
  26. UIFormAssetName = null;
  27. UIGroupName = null;
  28. PauseCoveredUIForm = false;
  29. DependencyAssetName = null;
  30. LoadedCount = 0;
  31. TotalCount = 0;
  32. UserData = null;
  33. }
  34. /// <summary>
  35. /// 获取打开界面时加载依赖资源事件编号。
  36. /// </summary>
  37. public override int Id
  38. {
  39. get
  40. {
  41. return EventId;
  42. }
  43. }
  44. /// <summary>
  45. /// 获取界面序列编号。
  46. /// </summary>
  47. public int SerialId
  48. {
  49. get;
  50. private set;
  51. }
  52. /// <summary>
  53. /// 获取界面资源名称。
  54. /// </summary>
  55. public string UIFormAssetName
  56. {
  57. get;
  58. private set;
  59. }
  60. /// <summary>
  61. /// 获取界面组名称。
  62. /// </summary>
  63. public string UIGroupName
  64. {
  65. get;
  66. private set;
  67. }
  68. /// <summary>
  69. /// 获取是否暂停被覆盖的界面。
  70. /// </summary>
  71. public bool PauseCoveredUIForm
  72. {
  73. get;
  74. private set;
  75. }
  76. /// <summary>
  77. /// 获取被加载的依赖资源名称。
  78. /// </summary>
  79. public string DependencyAssetName
  80. {
  81. get;
  82. private set;
  83. }
  84. /// <summary>
  85. /// 获取当前已加载依赖资源数量。
  86. /// </summary>
  87. public int LoadedCount
  88. {
  89. get;
  90. private set;
  91. }
  92. /// <summary>
  93. /// 获取总共加载依赖资源数量。
  94. /// </summary>
  95. public int TotalCount
  96. {
  97. get;
  98. private set;
  99. }
  100. /// <summary>
  101. /// 获取用户自定义数据。
  102. /// </summary>
  103. public object UserData
  104. {
  105. get;
  106. private set;
  107. }
  108. /// <summary>
  109. /// 创建打开界面时加载依赖资源事件。
  110. /// </summary>
  111. /// <param name="e">内部事件。</param>
  112. /// <returns>创建的打开界面时加载依赖资源事件。</returns>
  113. public static OpenUIFormDependencyAssetEventArgs Create(GameFramework.UI.OpenUIFormDependencyAssetEventArgs e)
  114. {
  115. OpenUIFormDependencyAssetEventArgs openUIFormDependencyAssetEventArgs = ReferencePool.Acquire<OpenUIFormDependencyAssetEventArgs>();
  116. openUIFormDependencyAssetEventArgs.SerialId = e.SerialId;
  117. openUIFormDependencyAssetEventArgs.UIFormAssetName = e.UIFormAssetName;
  118. openUIFormDependencyAssetEventArgs.UIGroupName = e.UIGroupName;
  119. openUIFormDependencyAssetEventArgs.PauseCoveredUIForm = e.PauseCoveredUIForm;
  120. openUIFormDependencyAssetEventArgs.DependencyAssetName = e.DependencyAssetName;
  121. openUIFormDependencyAssetEventArgs.LoadedCount = e.LoadedCount;
  122. openUIFormDependencyAssetEventArgs.TotalCount = e.TotalCount;
  123. openUIFormDependencyAssetEventArgs.UserData = e.UserData;
  124. return openUIFormDependencyAssetEventArgs;
  125. }
  126. /// <summary>
  127. /// 清理打开界面时加载依赖资源事件。
  128. /// </summary>
  129. public override void Clear()
  130. {
  131. SerialId = 0;
  132. UIFormAssetName = null;
  133. UIGroupName = null;
  134. PauseCoveredUIForm = false;
  135. DependencyAssetName = null;
  136. LoadedCount = 0;
  137. TotalCount = 0;
  138. UserData = null;
  139. }
  140. }
  141. }