//------------------------------------------------------------ // 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 LoadDictionaryDependencyAssetEventArgs : GameEventArgs { /// /// 加载字典时加载依赖资源事件编号。 /// public static readonly int EventId = typeof(LoadDictionaryDependencyAssetEventArgs).GetHashCode(); /// /// 初始化加载字典时加载依赖资源事件的新实例。 /// public LoadDictionaryDependencyAssetEventArgs() { DictionaryAssetName = null; DependencyAssetName = null; LoadedCount = 0; TotalCount = 0; UserData = null; } /// /// 获取加载字典时加载依赖资源事件编号。 /// public override int Id { get { return EventId; } } /// /// 获取字典资源名称。 /// public string DictionaryAssetName { get; private set; } /// /// 获取被加载的依赖资源名称。 /// public string DependencyAssetName { get; private set; } /// /// 获取当前已加载依赖资源数量。 /// public int LoadedCount { get; private set; } /// /// 获取总共加载依赖资源数量。 /// public int TotalCount { get; private set; } /// /// 获取用户自定义数据。 /// public object UserData { get; private set; } /// /// 创建加载字典时加载依赖资源事件。 /// /// 内部事件。 /// 创建的加载字典时加载依赖资源事件。 public static LoadDictionaryDependencyAssetEventArgs Create(ReadDataDependencyAssetEventArgs e) { LoadDictionaryDependencyAssetEventArgs loadDictionaryDependencyAssetEventArgs = ReferencePool.Acquire(); loadDictionaryDependencyAssetEventArgs.DictionaryAssetName = e.DataAssetName; loadDictionaryDependencyAssetEventArgs.DependencyAssetName = e.DependencyAssetName; loadDictionaryDependencyAssetEventArgs.LoadedCount = e.LoadedCount; loadDictionaryDependencyAssetEventArgs.TotalCount = e.TotalCount; loadDictionaryDependencyAssetEventArgs.UserData = e.UserData; return loadDictionaryDependencyAssetEventArgs; } /// /// 清理加载字典时加载依赖资源事件。 /// public override void Clear() { DictionaryAssetName = null; DependencyAssetName = null; LoadedCount = 0; TotalCount = 0; UserData = null; } } }