对 DisplayItemInfoForm 按 5 层 UI 规范做结构整理
- 删除无用的 DisplayItemInfoUseCase,转为轻量 UI(Controller + Context + View) - RawData 类型安全:object Data 拆分为 WeaponData + PropItem - View 事件规范:回收按钮改用 UI 专用事件,由 Controller 通过回调转发 - 简化 _locked 状态管理,统一在 CloseUIAsync 中清理
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
using GameFramework;
|
||||
using GameFramework.Event;
|
||||
|
||||
namespace SepCore.Event
|
||||
{
|
||||
public class DisplayItemInfoRecycleEventArgs : GameEventArgs
|
||||
{
|
||||
public static readonly int EventId = typeof(DisplayItemInfoRecycleEventArgs).GetHashCode();
|
||||
|
||||
public override int Id => EventId;
|
||||
|
||||
public int Index;
|
||||
public int Price;
|
||||
|
||||
public DisplayItemInfoRecycleEventArgs()
|
||||
{
|
||||
Index = -1;
|
||||
Price = 0;
|
||||
}
|
||||
|
||||
public static DisplayItemInfoRecycleEventArgs Create(int index, int price)
|
||||
{
|
||||
var args = ReferencePool.Acquire<DisplayItemInfoRecycleEventArgs>();
|
||||
args.Index = index;
|
||||
args.Price = price;
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
Index = -1;
|
||||
Price = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b959bd91b2fade47990fed6ce898f4f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,37 +0,0 @@
|
||||
using GameFramework;
|
||||
using GameFramework.Event;
|
||||
|
||||
namespace SepCore.Event
|
||||
{
|
||||
public class ShopWeaponRecycleEventArgs : GameEventArgs
|
||||
{
|
||||
public static readonly int EventId = typeof(ShopWeaponRecycleEventArgs).GetHashCode();
|
||||
|
||||
public override int Id => EventId;
|
||||
|
||||
public int Index { get; private set; }
|
||||
|
||||
public int Price { get; private set; }
|
||||
|
||||
public ShopWeaponRecycleEventArgs()
|
||||
{
|
||||
Index = -1;
|
||||
Price = 0;
|
||||
}
|
||||
|
||||
public static ShopWeaponRecycleEventArgs Create(int index, int price)
|
||||
{
|
||||
var args = ReferencePool.Acquire<ShopWeaponRecycleEventArgs>();
|
||||
args.Index = index;
|
||||
args.Price = price;
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
Index = -1;
|
||||
Price = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a11aec04bee4abf85e3df1d495e9f84
|
||||
timeCreated: 1771487051
|
||||
Reference in New Issue
Block a user