//------------------------------------------------------------
// 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 ShowEntitySuccessEventArgs : GameEventArgs
{
///
/// 显示实体成功事件编号。
///
public static readonly int EventId = typeof(ShowEntitySuccessEventArgs).GetHashCode();
///
/// 初始化显示实体成功事件的新实例。
///
public ShowEntitySuccessEventArgs()
{
EntityLogicType = null;
Entity = null;
Duration = 0f;
UserData = null;
}
///
/// 获取显示实体成功事件编号。
///
public override int Id
{
get
{
return EventId;
}
}
///
/// 获取实体逻辑类型。
///
public Type EntityLogicType
{
get;
private set;
}
///
/// 获取显示成功的实体。
///
public Entity Entity
{
get;
private set;
}
///
/// 获取加载持续时间。
///
public float Duration
{
get;
private set;
}
///
/// 获取用户自定义数据。
///
public object UserData
{
get;
private set;
}
///
/// 创建显示实体成功事件。
///
/// 内部事件。
/// 创建的显示实体成功事件。
public static ShowEntitySuccessEventArgs Create(GameFramework.Entity.ShowEntitySuccessEventArgs e)
{
ShowEntityInfo showEntityInfo = (ShowEntityInfo)e.UserData;
ShowEntitySuccessEventArgs showEntitySuccessEventArgs = ReferencePool.Acquire();
showEntitySuccessEventArgs.EntityLogicType = showEntityInfo.EntityLogicType;
showEntitySuccessEventArgs.Entity = (Entity)e.Entity;
showEntitySuccessEventArgs.Duration = e.Duration;
showEntitySuccessEventArgs.UserData = showEntityInfo.UserData;
ReferencePool.Release(showEntityInfo);
return showEntitySuccessEventArgs;
}
///
/// 清理显示实体成功事件。
///
public override void Clear()
{
EntityLogicType = null;
Entity = null;
Duration = 0f;
UserData = null;
}
}
}