继续重构调整(UI)
- 引入 UniTask 和异步版本的 UIModule - 调整 Runtime/UIBase 和 Presentation 下的脚本命名空间到 SepCore.UI - 将原来的 5 层 UI 迁移到异步实现 - 规范各层的 UI 脚本命名
This commit is contained in:
@@ -12,7 +12,7 @@ namespace SepCore.Definition
|
||||
/// </summary>
|
||||
public enum UIFormType : byte
|
||||
{
|
||||
TUIForm = 0,
|
||||
Undefined = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 弹出框。
|
||||
@@ -22,7 +22,7 @@ namespace SepCore.Definition
|
||||
/// <summary>
|
||||
/// 主菜单。
|
||||
/// </summary>
|
||||
MenuForm = 100,
|
||||
MenuForm = 200,
|
||||
|
||||
/// <summary>
|
||||
/// 设置。
|
||||
@@ -33,22 +33,17 @@ namespace SepCore.Definition
|
||||
/// 关于。
|
||||
/// </summary>
|
||||
AboutForm = 102,
|
||||
|
||||
/// <summary>
|
||||
/// 主菜单。
|
||||
/// </summary>
|
||||
StartMenuForm = 200,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 选择角色。
|
||||
/// </summary>
|
||||
SelectRoleForm = 201,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 游戏商店。
|
||||
/// </summary>
|
||||
ShopForm = 202,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 游戏HUD。
|
||||
/// </summary>
|
||||
@@ -58,7 +53,7 @@ namespace SepCore.Definition
|
||||
/// 升级选择。
|
||||
/// </summary>
|
||||
LevelUpForm = 204,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 物品信息展示页
|
||||
/// </summary>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
using GameFramework;
|
||||
using GameFramework.Event;
|
||||
|
||||
namespace SepCore.Event
|
||||
{
|
||||
public class MenuSelectRoleConfirmEventArgs : GameEventArgs
|
||||
{
|
||||
public static readonly int EventId = typeof(MenuSelectRoleConfirmEventArgs).GetHashCode();
|
||||
|
||||
public override int Id => EventId;
|
||||
|
||||
public static MenuSelectRoleConfirmEventArgs Create()
|
||||
{
|
||||
return ReferencePool.Acquire<MenuSelectRoleConfirmEventArgs>();
|
||||
}
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f52f9694158bfda42a01330b373cbfe9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5592c04fe863be843948da5e161ee830
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,41 @@
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建 DialogEventArgs 事件示例
|
||||
/// </summary>
|
||||
/// <param name="buttonId">
|
||||
/// <list type="buttet">
|
||||
/// <item>1 为 ConfirmButton</item>
|
||||
/// <item>2 为 CancelButton</item>
|
||||
/// <item>3 为 OtherButton</item>
|
||||
/// </list>
|
||||
/// </param>
|
||||
/// <param name="userData">用户自定义数据</param>
|
||||
/// <returns></returns>
|
||||
public static DialogEventArgs Create(int buttonId, object userData)
|
||||
{
|
||||
DialogEventArgs dialogEventArgs = ReferencePool.Acquire<DialogEventArgs>();
|
||||
dialogEventArgs.ButtonId = buttonId;
|
||||
dialogEventArgs.UserData = userData;
|
||||
return dialogEventArgs;
|
||||
}
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
UserData = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2d4f8127d599534886d1953cfc9e2ab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
using GameFramework;
|
||||
using GameFramework.Event;
|
||||
|
||||
namespace SepCore.Event
|
||||
{
|
||||
public class SelectRoleConfirmEventArgs : GameEventArgs
|
||||
{
|
||||
public static readonly int EventId = typeof(SelectRoleConfirmEventArgs).GetHashCode();
|
||||
|
||||
public override int Id => EventId;
|
||||
|
||||
public static SelectRoleConfirmEventArgs Create()
|
||||
{
|
||||
return ReferencePool.Acquire<SelectRoleConfirmEventArgs>();
|
||||
}
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -3,17 +3,17 @@ using GameFramework.Event;
|
||||
|
||||
namespace SepCore.Event
|
||||
{
|
||||
public class MenuSelectRoleSelectedEventArgs : GameEventArgs
|
||||
public class SelectRoleHoverEventArgs : GameEventArgs
|
||||
{
|
||||
public static readonly int EventId = typeof(MenuSelectRoleSelectedEventArgs).GetHashCode();
|
||||
public static readonly int EventId = typeof(SelectRoleHoverEventArgs).GetHashCode();
|
||||
|
||||
public override int Id => EventId;
|
||||
|
||||
public int RoleId { get; private set; } = -1;
|
||||
|
||||
public static MenuSelectRoleSelectedEventArgs Create(int roleId)
|
||||
public static SelectRoleHoverEventArgs Create(int roleId)
|
||||
{
|
||||
var args = ReferencePool.Acquire<MenuSelectRoleSelectedEventArgs>();
|
||||
var args = ReferencePool.Acquire<SelectRoleHoverEventArgs>();
|
||||
args.RoleId = roleId;
|
||||
return args;
|
||||
}
|
||||
Reference in New Issue
Block a user