//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 loyalsoft. All rights reserved.
// Homepage: http://www.game7000.com/
// Feedback: http://www.game7000.com/
//------------------------------------------------------------
using GameFramework;
using GameFramework.Event;
using System;
namespace UnityGameFramework.Runtime
{
///
/// 显示实体更新事件。
///
public sealed class ShowEntityUpdateEventArgs : GameEventArgs
{
///
/// 显示实体更新事件编号。
///
public static readonly int EventId = typeof(ShowEntityUpdateEventArgs).GetHashCode();
///
/// 初始化显示实体更新事件的新实例。
///
public ShowEntityUpdateEventArgs()
{
EntityId = 0;
EntityLogicType = null;
EntityAssetName = null;
EntityGroupName = null;
Progress = 0f;
UserData = null;
}
///
/// 获取显示实体更新事件编号。
///
public override int Id
{
get
{
return EventId;
}
}
///
/// 获取实体编号。
///
public int EntityId
{
get;
private set;
}
///
/// 获取实体逻辑类型。
///
public Type EntityLogicType
{
get;
private set;
}
///
/// 获取实体资源名称。
///
public string EntityAssetName
{
get;
private set;
}
///
/// 获取实体组名称。
///
public string EntityGroupName
{
get;
private set;
}
///
/// 获取显示实体进度。
///
public float Progress
{
get;
private set;
}
///
/// 获取用户自定义数据。
///
public object UserData
{
get;
private set;
}
///
/// 创建显示实体更新事件。
///
/// 内部事件。
/// 创建的显示实体更新事件。
public static ShowEntityUpdateEventArgs Create(GameFramework.Entity.ShowEntityUpdateEventArgs e)
{
ShowEntityInfo showEntityInfo = (ShowEntityInfo)e.UserData;
ShowEntityUpdateEventArgs showEntityUpdateEventArgs = ReferencePool.Acquire();
showEntityUpdateEventArgs.EntityId = e.EntityId;
showEntityUpdateEventArgs.EntityLogicType = showEntityInfo.EntityLogicType;
showEntityUpdateEventArgs.EntityAssetName = e.EntityAssetName;
showEntityUpdateEventArgs.EntityGroupName = e.EntityGroupName;
showEntityUpdateEventArgs.Progress = e.Progress;
showEntityUpdateEventArgs.UserData = showEntityInfo.UserData;
return showEntityUpdateEventArgs;
}
///
/// 清理显示实体更新事件。
///
public override void Clear()
{
EntityId = 0;
EntityLogicType = null;
EntityAssetName = null;
EntityGroupName = null;
Progress = 0f;
UserData = null;
}
}
}