ResourceApplySuccessEventArgs.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. namespace GameFramework.Resource
  8. {
  9. /// <summary>
  10. /// 资源应用成功事件。
  11. /// </summary>
  12. public sealed class ResourceApplySuccessEventArgs : GameFrameworkEventArgs
  13. {
  14. /// <summary>
  15. /// 初始化资源应用成功事件的新实例。
  16. /// </summary>
  17. public ResourceApplySuccessEventArgs()
  18. {
  19. Name = null;
  20. ApplyPath = null;
  21. ResourcePackPath = null;
  22. Length = 0;
  23. CompressedLength = 0;
  24. }
  25. /// <summary>
  26. /// 获取资源名称。
  27. /// </summary>
  28. public string Name
  29. {
  30. get;
  31. private set;
  32. }
  33. /// <summary>
  34. /// 获取资源应用后存放路径。
  35. /// </summary>
  36. public string ApplyPath
  37. {
  38. get;
  39. private set;
  40. }
  41. /// <summary>
  42. /// 获取资源包路径。
  43. /// </summary>
  44. public string ResourcePackPath
  45. {
  46. get;
  47. private set;
  48. }
  49. /// <summary>
  50. /// 获取资源大小。
  51. /// </summary>
  52. public int Length
  53. {
  54. get;
  55. private set;
  56. }
  57. /// <summary>
  58. /// 获取压缩后大小。
  59. /// </summary>
  60. public int CompressedLength
  61. {
  62. get;
  63. private set;
  64. }
  65. /// <summary>
  66. /// 创建资源应用成功事件。
  67. /// </summary>
  68. /// <param name="name">资源名称。</param>
  69. /// <param name="applyPath">资源应用后存放路径。</param>
  70. /// <param name="resourcePackPath">资源包路径。</param>
  71. /// <param name="length">资源大小。</param>
  72. /// <param name="compressedLength">压缩后大小。</param>
  73. /// <returns>创建的资源应用成功事件。</returns>
  74. public static ResourceApplySuccessEventArgs Create(string name, string applyPath, string resourcePackPath, int length, int compressedLength)
  75. {
  76. ResourceApplySuccessEventArgs resourceApplySuccessEventArgs = ReferencePool.Acquire<ResourceApplySuccessEventArgs>();
  77. resourceApplySuccessEventArgs.Name = name;
  78. resourceApplySuccessEventArgs.ApplyPath = applyPath;
  79. resourceApplySuccessEventArgs.ResourcePackPath = resourcePackPath;
  80. resourceApplySuccessEventArgs.Length = length;
  81. resourceApplySuccessEventArgs.CompressedLength = compressedLength;
  82. return resourceApplySuccessEventArgs;
  83. }
  84. /// <summary>
  85. /// 清理资源应用成功事件。
  86. /// </summary>
  87. public override void Clear()
  88. {
  89. Name = null;
  90. ApplyPath = null;
  91. ResourcePackPath = null;
  92. Length = 0;
  93. CompressedLength = 0;
  94. }
  95. }
  96. }