//------------------------------------------------------------ // Game Framework // Copyright © 2013-2021 loyalsoft. All rights reserved. // Homepage: http://www.game7000.com/ // Feedback: http://www.game7000.com/ //------------------------------------------------------------ namespace GameFramework.Resource { /// /// 资源更新改变事件。 /// public sealed class ResourceUpdateChangedEventArgs : GameFrameworkEventArgs { /// /// 初始化资源更新改变事件的新实例。 /// public ResourceUpdateChangedEventArgs() { Name = null; DownloadPath = null; DownloadUri = null; CurrentLength = 0; CompressedLength = 0; } /// /// 获取资源名称。 /// public string Name { get; private set; } /// /// 获取资源下载后存放路径。 /// public string DownloadPath { get; private set; } /// /// 获取下载地址。 /// public string DownloadUri { get; private set; } /// /// 获取当前下载大小。 /// public int CurrentLength { get; private set; } /// /// 获取压缩后大小。 /// public int CompressedLength { get; private set; } /// /// 创建资源更新改变事件。 /// /// 资源名称。 /// 资源下载后存放路径。 /// 资源下载地址。 /// 当前下载大小。 /// 压缩后大小。 /// 创建的资源更新改变事件。 public static ResourceUpdateChangedEventArgs Create(string name, string downloadPath, string downloadUri, int currentLength, int compressedLength) { ResourceUpdateChangedEventArgs resourceUpdateChangedEventArgs = ReferencePool.Acquire(); resourceUpdateChangedEventArgs.Name = name; resourceUpdateChangedEventArgs.DownloadPath = downloadPath; resourceUpdateChangedEventArgs.DownloadUri = downloadUri; resourceUpdateChangedEventArgs.CurrentLength = currentLength; resourceUpdateChangedEventArgs.CompressedLength = compressedLength; return resourceUpdateChangedEventArgs; } /// /// 清理资源更新改变事件。 /// public override void Clear() { Name = null; DownloadPath = null; DownloadUri = null; CurrentLength = 0; CompressedLength = 0; } } }