//------------------------------------------------------------ // Game Framework // Copyright © 2013-2021 loyalsoft. All rights reserved. // Homepage: http://www.game7000.com/ // Feedback: http://www.game7000.com/ //------------------------------------------------------------ namespace GameFramework.Entity { /// /// 显示实体时加载依赖资源事件。 /// public sealed class ShowEntityDependencyAssetEventArgs : GameFrameworkEventArgs { /// /// 初始化显示实体时加载依赖资源事件的新实例。 /// public ShowEntityDependencyAssetEventArgs() { EntityId = 0; EntityAssetName = null; EntityGroupName = null; DependencyAssetName = null; LoadedCount = 0; TotalCount = 0; UserData = null; } /// /// 获取实体编号。 /// public int EntityId { get; private set; } /// /// 获取实体资源名称。 /// public string EntityAssetName { get; private set; } /// /// 获取实体组名称。 /// public string EntityGroupName { 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 ShowEntityDependencyAssetEventArgs Create(int entityId, string entityAssetName, string entityGroupName, string dependencyAssetName, int loadedCount, int totalCount, object userData) { ShowEntityDependencyAssetEventArgs showEntityDependencyAssetEventArgs = ReferencePool.Acquire(); showEntityDependencyAssetEventArgs.EntityId = entityId; showEntityDependencyAssetEventArgs.EntityAssetName = entityAssetName; showEntityDependencyAssetEventArgs.EntityGroupName = entityGroupName; showEntityDependencyAssetEventArgs.DependencyAssetName = dependencyAssetName; showEntityDependencyAssetEventArgs.LoadedCount = loadedCount; showEntityDependencyAssetEventArgs.TotalCount = totalCount; showEntityDependencyAssetEventArgs.UserData = userData; return showEntityDependencyAssetEventArgs; } /// /// 清理显示实体时加载依赖资源事件。 /// public override void Clear() { EntityId = 0; EntityAssetName = null; EntityGroupName = null; DependencyAssetName = null; LoadedCount = 0; TotalCount = 0; UserData = null; } } }