OpenUIFormFailureEventArgs.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 OpenUIFormFailureEventArgs : GameEventArgs
  15. {
  16. /// <summary>
  17. /// 打开界面失败事件编号。
  18. /// </summary>
  19. public static readonly int EventId = typeof(OpenUIFormFailureEventArgs).GetHashCode();
  20. /// <summary>
  21. /// 初始化打开界面失败事件的新实例。
  22. /// </summary>
  23. public OpenUIFormFailureEventArgs()
  24. {
  25. SerialId = 0;
  26. UIFormAssetName = null;
  27. UIGroupName = null;
  28. PauseCoveredUIForm = false;
  29. ErrorMessage = null;
  30. UserData = null;
  31. }
  32. /// <summary>
  33. /// 获取打开界面失败事件编号。
  34. /// </summary>
  35. public override int Id
  36. {
  37. get
  38. {
  39. return EventId;
  40. }
  41. }
  42. /// <summary>
  43. /// 获取界面序列编号。
  44. /// </summary>
  45. public int SerialId
  46. {
  47. get;
  48. private set;
  49. }
  50. /// <summary>
  51. /// 获取界面资源名称。
  52. /// </summary>
  53. public string UIFormAssetName
  54. {
  55. get;
  56. private set;
  57. }
  58. /// <summary>
  59. /// 获取界面组名称。
  60. /// </summary>
  61. public string UIGroupName
  62. {
  63. get;
  64. private set;
  65. }
  66. /// <summary>
  67. /// 获取是否暂停被覆盖的界面。
  68. /// </summary>
  69. public bool PauseCoveredUIForm
  70. {
  71. get;
  72. private set;
  73. }
  74. /// <summary>
  75. /// 获取错误信息。
  76. /// </summary>
  77. public string ErrorMessage
  78. {
  79. get;
  80. private set;
  81. }
  82. /// <summary>
  83. /// 获取用户自定义数据。
  84. /// </summary>
  85. public object UserData
  86. {
  87. get;
  88. private set;
  89. }
  90. /// <summary>
  91. /// 创建打开界面失败事件。
  92. /// </summary>
  93. /// <param name="e">内部事件。</param>
  94. /// <returns>创建的打开界面失败事件。</returns>
  95. public static OpenUIFormFailureEventArgs Create(GameFramework.UI.OpenUIFormFailureEventArgs e)
  96. {
  97. OpenUIFormFailureEventArgs openUIFormFailureEventArgs = ReferencePool.Acquire<OpenUIFormFailureEventArgs>();
  98. openUIFormFailureEventArgs.SerialId = e.SerialId;
  99. openUIFormFailureEventArgs.UIFormAssetName = e.UIFormAssetName;
  100. openUIFormFailureEventArgs.UIGroupName = e.UIGroupName;
  101. openUIFormFailureEventArgs.PauseCoveredUIForm = e.PauseCoveredUIForm;
  102. openUIFormFailureEventArgs.ErrorMessage = e.ErrorMessage;
  103. openUIFormFailureEventArgs.UserData = e.UserData;
  104. return openUIFormFailureEventArgs;
  105. }
  106. /// <summary>
  107. /// 清理打开界面失败事件。
  108. /// </summary>
  109. public override void Clear()
  110. {
  111. SerialId = 0;
  112. UIFormAssetName = null;
  113. UIGroupName = null;
  114. PauseCoveredUIForm = false;
  115. ErrorMessage = null;
  116. UserData = null;
  117. }
  118. }
  119. }