//------------------------------------------------------------
// 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 ResourceApplySuccessEventArgs : GameEventArgs
{
///
/// 资源应用成功事件编号。
///
public static readonly int EventId = typeof(ResourceApplySuccessEventArgs).GetHashCode();
///
/// 初始化资源应用成功事件的新实例。
///
public ResourceApplySuccessEventArgs()
{
Name = null;
ApplyPath = null;
ResourcePackPath = null;
Length = 0;
CompressedLength = 0;
}
///
/// 获取资源应用成功事件编号。
///
public override int Id
{
get
{
return EventId;
}
}
///
/// 获取资源名称。
///
public string Name
{
get;
private set;
}
///
/// 获取资源应用后存放路径。
///
public string ApplyPath
{
get;
private set;
}
///
/// 获取资源包路径。
///
public string ResourcePackPath
{
get;
private set;
}
///
/// 获取资源大小。
///
public int Length
{
get;
private set;
}
///
/// 获取压缩后大小。
///
public int CompressedLength
{
get;
private set;
}
///
/// 创建资源应用成功事件。
///
/// 内部事件。
/// 创建的资源应用成功事件。
public static ResourceApplySuccessEventArgs Create(GameFramework.Resource.ResourceApplySuccessEventArgs e)
{
ResourceApplySuccessEventArgs resourceApplySuccessEventArgs = ReferencePool.Acquire();
resourceApplySuccessEventArgs.Name = e.Name;
resourceApplySuccessEventArgs.ApplyPath = e.ApplyPath;
resourceApplySuccessEventArgs.ResourcePackPath = e.ResourcePackPath;
resourceApplySuccessEventArgs.Length = e.Length;
resourceApplySuccessEventArgs.CompressedLength = e.CompressedLength;
return resourceApplySuccessEventArgs;
}
///
/// 清理资源应用成功事件。
///
public override void Clear()
{
Name = null;
ApplyPath = null;
ResourcePackPath = null;
Length = 0;
CompressedLength = 0;
}
}
}