LoadResourceAgentHelperReadBytesCompleteEventArgs.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 LoadResourceAgentHelperReadBytesCompleteEventArgs : GameFrameworkEventArgs
  13. {
  14. private byte[] m_Bytes;
  15. /// <summary>
  16. /// 初始化加载资源代理辅助器异步读取资源二进制流完成事件的新实例。
  17. /// </summary>
  18. public LoadResourceAgentHelperReadBytesCompleteEventArgs()
  19. {
  20. m_Bytes = null;
  21. }
  22. /// <summary>
  23. /// 创建加载资源代理辅助器异步读取资源二进制流完成事件。
  24. /// </summary>
  25. /// <param name="bytes">资源的二进制流。</param>
  26. /// <returns>创建的加载资源代理辅助器异步读取资源二进制流完成事件。</returns>
  27. public static LoadResourceAgentHelperReadBytesCompleteEventArgs Create(byte[] bytes)
  28. {
  29. LoadResourceAgentHelperReadBytesCompleteEventArgs loadResourceAgentHelperReadBytesCompleteEventArgs = ReferencePool.Acquire<LoadResourceAgentHelperReadBytesCompleteEventArgs>();
  30. loadResourceAgentHelperReadBytesCompleteEventArgs.m_Bytes = bytes;
  31. return loadResourceAgentHelperReadBytesCompleteEventArgs;
  32. }
  33. /// <summary>
  34. /// 清理加载资源代理辅助器异步读取资源二进制流完成事件。
  35. /// </summary>
  36. public override void Clear()
  37. {
  38. m_Bytes = null;
  39. }
  40. /// <summary>
  41. /// 获取资源的二进制流。
  42. /// </summary>
  43. /// <returns>资源的二进制流。</returns>
  44. public byte[] GetBytes()
  45. {
  46. return m_Bytes;
  47. }
  48. }
  49. }