//------------------------------------------------------------ // Game Framework // Copyright © 2013-2021 Jiang Yin. All rights reserved. // Homepage: https://gameframework.cn/ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ using GameFramework; using GameFramework.Event; namespace UnityGameFramework.Runtime { /// /// 资源应用开始事件。 /// public sealed class ResourceApplyStartEventArgs : GameEventArgs { /// /// 资源应用开始事件编号。 /// public static readonly int EventId = typeof(ResourceApplyStartEventArgs).GetHashCode(); /// /// 初始化资源应用开始事件的新实例。 /// public ResourceApplyStartEventArgs() { ResourcePackPath = null; Count = 0; TotalLength = 0L; } /// /// 获取资源应用开始事件编号。 /// public override int Id { get { return EventId; } } /// /// 获取资源包路径。 /// public string ResourcePackPath { get; private set; } /// /// 获取要应用资源的数量。 /// public int Count { get; private set; } /// /// 获取要应用资源的总大小。 /// public long TotalLength { get; private set; } /// /// 创建资源应用开始事件。 /// /// 内部事件。 /// 创建的资源应用开始事件。 public static ResourceApplyStartEventArgs Create(GameFramework.Resource.ResourceApplyStartEventArgs e) { ResourceApplyStartEventArgs resourceApplyStartEventArgs = ReferencePool.Acquire(); resourceApplyStartEventArgs.ResourcePackPath = e.ResourcePackPath; resourceApplyStartEventArgs.Count = e.Count; resourceApplyStartEventArgs.TotalLength = e.TotalLength; return resourceApplyStartEventArgs; } /// /// 清理资源应用开始事件。 /// public override void Clear() { ResourcePackPath = null; Count = 0; TotalLength = 0L; } } }