//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 loyalsoft. All rights reserved.
// Homepage: http://www.game7000.com/
// Feedback: http://www.game7000.com/
//------------------------------------------------------------
using GameFramework;
using GameFramework.Event;
namespace UnityGameFramework.Runtime
{
///
/// 资源更新开始事件。
///
public sealed class ResourceUpdateStartEventArgs : GameEventArgs
{
///
/// 资源更新开始事件编号。
///
public static readonly int EventId = typeof(ResourceUpdateStartEventArgs).GetHashCode();
///
/// 初始化资源更新开始事件的新实例。
///
public ResourceUpdateStartEventArgs()
{
Name = null;
DownloadPath = null;
DownloadUri = null;
CurrentLength = 0;
CompressedLength = 0;
RetryCount = 0;
}
///
/// 获取资源更新开始事件编号。
///
public override int Id
{
get
{
return EventId;
}
}
///
/// 获取资源名称。
///
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 int RetryCount
{
get;
private set;
}
///
/// 创建资源更新开始事件。
///
/// 内部事件。
/// 创建的资源更新开始事件。
public static ResourceUpdateStartEventArgs Create(GameFramework.Resource.ResourceUpdateStartEventArgs e)
{
ResourceUpdateStartEventArgs resourceUpdateStartEventArgs = ReferencePool.Acquire();
resourceUpdateStartEventArgs.Name = e.Name;
resourceUpdateStartEventArgs.DownloadPath = e.DownloadPath;
resourceUpdateStartEventArgs.DownloadUri = e.DownloadUri;
resourceUpdateStartEventArgs.CurrentLength = e.CurrentLength;
resourceUpdateStartEventArgs.CompressedLength = e.CompressedLength;
resourceUpdateStartEventArgs.RetryCount = e.RetryCount;
return resourceUpdateStartEventArgs;
}
///
/// 清理资源更新开始事件。
///
public override void Clear()
{
Name = null;
DownloadPath = null;
DownloadUri = null;
CurrentLength = 0;
CompressedLength = 0;
RetryCount = 0;
}
}
}