32 lines
937 B
C#
32 lines
937 B
C#
using GameFramework;
|
|
using GameFramework.Event;
|
|
using SepCore.Definition;
|
|
|
|
namespace SepCore.Event
|
|
{
|
|
/// <summary>
|
|
/// MenuForm 上所有按钮共用的点击事件,按 <see cref="Button"/> 区分来源。
|
|
/// 每新增按钮请同步扩展 <see cref="MenuButtonId"/>,并在 MenuController 中处理。
|
|
/// </summary>
|
|
public class MenuButtonClickEventArgs : GameEventArgs
|
|
{
|
|
public static readonly int EventId = typeof(MenuButtonClickEventArgs).GetHashCode();
|
|
|
|
public override int Id => EventId;
|
|
|
|
public MenuButtonId Button { get; private set; }
|
|
|
|
public static MenuButtonClickEventArgs Create(MenuButtonId button)
|
|
{
|
|
var args = ReferencePool.Acquire<MenuButtonClickEventArgs>();
|
|
args.Button = button;
|
|
return args;
|
|
}
|
|
|
|
public override void Clear()
|
|
{
|
|
Button = MenuButtonId.Undefined;
|
|
}
|
|
}
|
|
}
|