using GameFramework;
using GameFramework.Event;
namespace SepCore.Event
{
public class DialogEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(DialogEventArgs).GetHashCode();
public override int Id => EventId;
public int ButtonId { get; private set; }
public object UserData { get; private set; }
///
/// 创建 DialogEventArgs 事件示例
///
///
///
/// - 1 为 ConfirmButton
/// - 2 为 CancelButton
/// - 3 为 OtherButton
///
///
/// 用户自定义数据
///
public static DialogEventArgs Create(int buttonId, object userData)
{
DialogEventArgs dialogEventArgs = ReferencePool.Acquire();
dialogEventArgs.ButtonId = buttonId;
dialogEventArgs.UserData = userData;
return dialogEventArgs;
}
public override void Clear()
{
UserData = null;
}
}
}