OpenUIFormSuccessEventArgs.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 OpenUIFormSuccessEventArgs : GameEventArgs
  15. {
  16. /// <summary>
  17. /// 打开界面成功事件编号。
  18. /// </summary>
  19. public static readonly int EventId = typeof(OpenUIFormSuccessEventArgs).GetHashCode();
  20. /// <summary>
  21. /// 初始化打开界面成功事件的新实例。
  22. /// </summary>
  23. public OpenUIFormSuccessEventArgs()
  24. {
  25. UIForm = null;
  26. Duration = 0f;
  27. UserData = null;
  28. }
  29. /// <summary>
  30. /// 获取打开界面成功事件编号。
  31. /// </summary>
  32. public override int Id
  33. {
  34. get
  35. {
  36. return EventId;
  37. }
  38. }
  39. /// <summary>
  40. /// 获取打开成功的界面。
  41. /// </summary>
  42. public UIForm UIForm
  43. {
  44. get;
  45. private set;
  46. }
  47. /// <summary>
  48. /// 获取加载持续时间。
  49. /// </summary>
  50. public float Duration
  51. {
  52. get;
  53. private set;
  54. }
  55. /// <summary>
  56. /// 获取用户自定义数据。
  57. /// </summary>
  58. public object UserData
  59. {
  60. get;
  61. private set;
  62. }
  63. /// <summary>
  64. /// 创建打开界面成功事件。
  65. /// </summary>
  66. /// <param name="e">内部事件。</param>
  67. /// <returns>创建的打开界面成功事件。</returns>
  68. public static OpenUIFormSuccessEventArgs Create(GameFramework.UI.OpenUIFormSuccessEventArgs e)
  69. {
  70. OpenUIFormSuccessEventArgs openUIFormSuccessEventArgs = ReferencePool.Acquire<OpenUIFormSuccessEventArgs>();
  71. openUIFormSuccessEventArgs.UIForm = (UIForm)e.UIForm;
  72. openUIFormSuccessEventArgs.Duration = e.Duration;
  73. openUIFormSuccessEventArgs.UserData = e.UserData;
  74. return openUIFormSuccessEventArgs;
  75. }
  76. /// <summary>
  77. /// 清理打开界面成功事件。
  78. /// </summary>
  79. public override void Clear()
  80. {
  81. UIForm = null;
  82. Duration = 0f;
  83. UserData = null;
  84. }
  85. }
  86. }