This commit is contained in:
huangjun
2026-08-30 22:25:23 +08:00
parent 92bf3e9097
commit 93a10a89c5
180 changed files with 15257 additions and 11604 deletions
@@ -22,7 +22,8 @@ namespace UnityGameFramework.Editor
"UnityGameFramework.Runtime", "UnityGameFramework.Runtime",
"SepCore.Runtime", "SepCore.Runtime",
"SepCore.Base", "SepCore.Base",
"SepC.ResolutionAdapter", "SepCore.Presentation",
"SepCore.Procedure",
#endif #endif
"Assembly-CSharp", "Assembly-CSharp",
}; };
@@ -33,7 +34,8 @@ namespace UnityGameFramework.Editor
"UnityGameFramework.Runtime", "UnityGameFramework.Runtime",
"SepCore.Runtime", "SepCore.Runtime",
"SepCore.Base", "SepCore.Base",
"SepC.ResolutionAdapter", "SepCore.Presentation",
"SepCore.Procedure",
#endif #endif
"Assembly-CSharp", "Assembly-CSharp",
#if UNITY_2017_3_OR_NEWER #if UNITY_2017_3_OR_NEWER
@@ -0,0 +1 @@
␍ATKFormatText ATK {0}␍MATFormatText MAT {0}␍SPDFormatText SPD {0} HPFormatTextHP {0} MPFormatTextMP {0}␍STAFormatText STA {0}WarehouseCapacity{0} ITEMS / {1} TOTAL UNITS
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 664fd26c0b8e44b59bb3f73e09f7b80f
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,30 @@
[
{
"name": "ATKFormatText",
"format": "ATK {0}"
},
{
"name": "MATFormatText",
"format": "MAT {0}"
},
{
"name": "SPDFormatText",
"format": "SPD {0}"
},
{
"name": "HPFormatText",
"format": "HP {0}"
},
{
"name": "MPFormatText",
"format": "MP {0}"
},
{
"name": "STAFormatText",
"format": "STA {0}"
},
{
"name": "WarehouseCapacity",
"format": "{0} ITEMS / {1} TOTAL UNITS"
}
]
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 592aec89b64d24796a78d88763c22412
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -6,6 +6,7 @@
"enemyLoseTargetMs": 3000, "enemyLoseTargetMs": 3000,
"enemyFrontViewAngle": 180, "enemyFrontViewAngle": 180,
"alertMax": 1000, "alertMax": 1000,
"warehouseSlotCount": 120,
"backpackSlotCount": 30, "backpackSlotCount": 30,
"secureSlotCount": 5, "secureSlotCount": 5,
"minPlayerPartySize": 1, "minPlayerPartySize": 1,
Binary file not shown.
+20 -10
View File
@@ -9,7 +9,8 @@
"maxHpBonus": 0, "maxHpBonus": 0,
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0 "matBonus": 0,
"speedBonus": 0
}, },
{ {
"id": 5002, "id": 5002,
@@ -21,7 +22,8 @@
"maxHpBonus": 0, "maxHpBonus": 0,
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0 "matBonus": 0,
"speedBonus": 0
}, },
{ {
"id": 5003, "id": 5003,
@@ -33,7 +35,8 @@
"maxHpBonus": 0, "maxHpBonus": 0,
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0 "matBonus": 0,
"speedBonus": 0
}, },
{ {
"id": 5004, "id": 5004,
@@ -45,7 +48,8 @@
"maxHpBonus": 0, "maxHpBonus": 0,
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0 "matBonus": 0,
"speedBonus": 0
}, },
{ {
"id": 5005, "id": 5005,
@@ -57,7 +61,8 @@
"maxHpBonus": 0, "maxHpBonus": 0,
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0 "matBonus": 0,
"speedBonus": 0
}, },
{ {
"id": 5101, "id": 5101,
@@ -69,7 +74,8 @@
"maxHpBonus": 0, "maxHpBonus": 0,
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 5, "atkBonus": 5,
"matBonus": 0 "matBonus": 0,
"speedBonus": 0
}, },
{ {
"id": 5102, "id": 5102,
@@ -81,7 +87,8 @@
"maxHpBonus": 0, "maxHpBonus": 0,
"maxMpBonus": 10, "maxMpBonus": 10,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 8 "matBonus": 8,
"speedBonus": 0
}, },
{ {
"id": 5201, "id": 5201,
@@ -93,7 +100,8 @@
"maxHpBonus": 20, "maxHpBonus": 20,
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0 "matBonus": 0,
"speedBonus": 1
}, },
{ {
"id": 5202, "id": 5202,
@@ -105,7 +113,8 @@
"maxHpBonus": 10, "maxHpBonus": 10,
"maxMpBonus": 30, "maxMpBonus": 30,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 5 "matBonus": 5,
"speedBonus": 0
}, },
{ {
"id": 5301, "id": 5301,
@@ -117,6 +126,7 @@
"maxHpBonus": 0, "maxHpBonus": 0,
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0 "matBonus": 0,
"speedBonus": 0
} }
] ]
Binary file not shown.
@@ -8,7 +8,7 @@
}, },
{ {
"id": 100, "id": 100,
"assetName": "MenuForm", "assetName": "LobbyForm",
"UIGroupName": "Default", "UIGroupName": "Default",
"allowMultiInstance": false, "allowMultiInstance": false,
"pauseCoveredUIForm": true "pauseCoveredUIForm": true
@@ -0,0 +1,31 @@
namespace SepCore.Definition
{
/// <summary>
/// 存档中的角色。
/// </summary>
[System.Serializable]
public struct CharacterSave
{
/// <summary>
/// 角色 ID,对应 CharacterConfig.Id。
/// </summary>
public int characterId;
/// <summary>
/// 武器栏物品 ID,0 表示空栏。
/// </summary>
public int weaponItemId;
/// <summary>
/// 防具栏物品 ID,0 表示空栏。
/// </summary>
public int armorItemId;
public CharacterSave(int characterId, int weaponItemId, int armorItemId)
{
this.characterId = characterId;
this.weaponItemId = weaponItemId;
this.armorItemId = armorItemId;
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: f585fae70a14d446ba433f3244efded1 guid: 431023ff1288d45a9a8a3713cd38593e
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
@@ -0,0 +1,25 @@
namespace SepCore.Definition
{
/// <summary>
/// 物品堆叠。
/// </summary>
[System.Serializable]
public struct ItemStack
{
/// <summary>
/// 物品 ID,对应 ItemConfig.Id。
/// </summary>
public int itemId;
/// <summary>
/// 数量,不超过配表 ItemConfig.StackLimit。
/// </summary>
public int count;
public ItemStack(int itemId, int count)
{
this.itemId = itemId;
this.count = count;
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 4774c8ef6d24f489c8c5858aa014ff13 guid: 48bca35b200a444218a36ce1a49a76ea
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
@@ -0,0 +1,42 @@
using System.Collections.Generic;
namespace SepCore.Definition
{
/// <summary>
/// 战备配置。
/// </summary>
[System.Serializable]
public sealed class LoadoutSave
{
/// <summary>
/// 出战角色 ID 及顺序,1~4 人,顺序决定同速时的行动次序。
/// </summary>
public int[] partyCharacterIds;
/// <summary>
/// 携带进入地图的物品,开局时填充共享背包;首版无局内效果。
/// </summary>
public List<ItemStack> carriedItems;
/// <summary>
/// 本局难度,对应 DifficultyConfig 主键。
/// </summary>
public DifficultyTier difficultyId;
/// <summary>
/// 补齐缺失字段,避免反序列化后出现空引用。
/// </summary>
public void Normalize()
{
if (partyCharacterIds == null)
{
partyCharacterIds = System.Array.Empty<int>();
}
if (carriedItems == null)
{
carriedItems = new List<ItemStack>();
}
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: ba271361c636f48edb5d7d8ba15a595c guid: bb9f7c288b0da4b88b83e82c87418550
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
@@ -0,0 +1,43 @@
namespace SepCore.Definition
{
/// <summary>
/// 已结束单局的结算记录。
/// </summary>
[System.Serializable]
public struct RunRecord
{
/// <summary>
/// 结算结果。
/// </summary>
public RunResultType outcome;
/// <summary>
/// 本局难度。
/// </summary>
public DifficultyTier difficultyId;
/// <summary>
/// 本局使用的随机数。
/// </summary>
public long seed;
/// <summary>
/// 进入单局时间,Unix 毫秒。
/// </summary>
public long startedAt;
/// <summary>
/// 结算时间,Unix 毫秒。
/// </summary>
public long endedAt;
public RunRecord(RunResultType outcome, DifficultyTier difficultyId, long seed, long startedAt, long endedAt)
{
this.outcome = outcome;
this.difficultyId = difficultyId;
this.seed = seed;
this.startedAt = startedAt;
this.endedAt = endedAt;
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: bffe339530c484a4b83162e20f163ed8 guid: 591a205ef9e5c4f5f9fadcbc5b0db979
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
@@ -0,0 +1,104 @@
using System.Collections.Generic;
using GameFramework;
namespace SepCore.Definition
{
/// <summary>
/// 游戏存档根数据。
/// 对应 Docs/Tech/02_SaveData.md。
/// </summary>
[System.Serializable]
public sealed class SaveData
{
/// <summary>
/// 当前存档结构版本。
/// </summary>
public const int CurrentVersion = 1;
/// <summary>
/// 存档结构版本。
/// </summary>
public int version = CurrentVersion;
/// <summary>
/// 最后写入时间,Unix 毫秒。
/// </summary>
public long updatedAt;
/// <summary>
/// 主仓库内容,无容量上限。
/// </summary>
public List<ItemStack> mainWarehouse;
/// <summary>
/// 拥有的角色,数组顺序即入队顺序。
/// </summary>
public List<CharacterSave> characters;
/// <summary>
/// 当前战备配置。
/// </summary>
public LoadoutSave loadout;
/// <summary>
/// 已结束单局的结算记录。
/// </summary>
public List<RunRecord> runHistory;
/// <summary>
/// 序列化为 JSON 字符串。
/// </summary>
public string ToJson()
{
return GameFramework.Utility.Json.ToJson(this);
}
/// <summary>
/// 从 JSON 字符串反序列化;json 为空或反序列化失败时返回 null。
/// </summary>
public static SaveData FromJson(string json)
{
if (string.IsNullOrEmpty(json))
{
return null;
}
SaveData saveData = GameFramework.Utility.Json.ToObject<SaveData>(json);
if (saveData == null)
{
return null;
}
saveData.Normalize();
return saveData;
}
/// <summary>
/// 补齐缺失字段,避免反序列化后出现空引用。
/// </summary>
private void Normalize()
{
if (mainWarehouse == null)
{
mainWarehouse = new List<ItemStack>();
}
if (characters == null)
{
characters = new List<CharacterSave>();
}
if (loadout == null)
{
loadout = new LoadoutSave();
}
loadout.Normalize();
if (runHistory == null)
{
runHistory = new List<RunRecord>();
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d2bfe2058edce460abc5e5054b5f7a7a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,9 +0,0 @@
namespace SepCore.Definition
{
public enum SceneType : byte
{
Launch = 0,
Menu = 1,
Main = 2,
}
}
@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 20fc28f41ef04f8fa4fbfb9189b58d0d
timeCreated: 1768899171
@@ -1,30 +0,0 @@
namespace SepCore.Definition
{
/// <summary>
/// 界面编号。
/// </summary>
public enum UIFormType : byte
{
Undefined = 0,
/// <summary>
/// 弹出框。
/// </summary>
DialogForm = 1,
/// <summary>
/// 主菜单。
/// </summary>
MenuForm = 100,
/// <summary>
/// 设置。
/// </summary>
SettingForm = 101,
/// <summary>
/// 关于。
/// </summary>
AboutForm = 102,
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: ceade84509cfa498a91c9a2fe55cc189 guid: ef320c3d6ef364abc8210ec6e2be2be6
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9618a0e69480c40b383585e41cda54a1 guid: 4dccdfac7eea44c07b87a556527040b6
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
@@ -0,0 +1,34 @@
using GameFramework;
using GameFramework.Event;
namespace SepCore.Base
{
public class WarehouseSlotItemClickEventArgs : GameEventArgs
{
public static int EventId => typeof(WarehouseSlotItemClickEventArgs).GetHashCode();
public override int Id => EventId;
/// <summary>
/// 被点击格子在整个固定网格中的索引,唯一对应一个格子。
/// </summary>
public int SlotId { get; private set; }
public WarehouseSlotItemClickEventArgs()
{
SlotId = 0;
}
public static WarehouseSlotItemClickEventArgs Create(int slotId)
{
var args = ReferencePool.Acquire<WarehouseSlotItemClickEventArgs>();
args.SlotId = slotId;
return args;
}
public override void Clear()
{
SlotId = 0;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 196c6541cd4d447d6b951f3e8f06c083
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,55 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using Luban;
namespace SepCore.Definition
{
public sealed partial class FormatText : Luban.BeanBase
{
public FormatText(ByteBuf _buf)
{
Name = _buf.ReadString();
Format = _buf.ReadString();
}
public static FormatText DeserializeFormatText(ByteBuf _buf)
{
return new FormatText(_buf);
}
/// <summary>
/// 文本名
/// </summary>
public readonly string Name;
/// <summary>
/// 格式化字符串
/// </summary>
public readonly string Format;
public const int __ID__ = -1977697820;
public override int GetTypeId() => __ID__;
public void ResolveRef(Tables tables)
{
}
public override string ToString()
{
return "{ "
+ "name:" + Name + ","
+ "format:" + Format + ","
+ "}";
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c5b0b070e5621408e9aa0b909cab1f1b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -22,6 +22,7 @@ public sealed partial class GlobalConfig : Luban.BeanBase
EnemyLoseTargetMs = _buf.ReadInt(); EnemyLoseTargetMs = _buf.ReadInt();
EnemyFrontViewAngle = _buf.ReadInt(); EnemyFrontViewAngle = _buf.ReadInt();
AlertMax = _buf.ReadInt(); AlertMax = _buf.ReadInt();
WarehouseSlotCount = _buf.ReadInt();
BackpackSlotCount = _buf.ReadInt(); BackpackSlotCount = _buf.ReadInt();
SecureSlotCount = _buf.ReadInt(); SecureSlotCount = _buf.ReadInt();
MinPlayerPartySize = _buf.ReadInt(); MinPlayerPartySize = _buf.ReadInt();
@@ -67,6 +68,10 @@ public sealed partial class GlobalConfig : Luban.BeanBase
/// </summary> /// </summary>
public readonly int AlertMax; public readonly int AlertMax;
/// <summary> /// <summary>
/// 仓库格子数
/// </summary>
public readonly int WarehouseSlotCount;
/// <summary>
/// 共享背包格子数 /// 共享背包格子数
/// </summary> /// </summary>
public readonly int BackpackSlotCount; public readonly int BackpackSlotCount;
@@ -143,6 +148,7 @@ public sealed partial class GlobalConfig : Luban.BeanBase
} }
public override string ToString() public override string ToString()
@@ -154,6 +160,7 @@ public sealed partial class GlobalConfig : Luban.BeanBase
+ "enemyLoseTargetMs:" + EnemyLoseTargetMs + "," + "enemyLoseTargetMs:" + EnemyLoseTargetMs + ","
+ "enemyFrontViewAngle:" + EnemyFrontViewAngle + "," + "enemyFrontViewAngle:" + EnemyFrontViewAngle + ","
+ "alertMax:" + AlertMax + "," + "alertMax:" + AlertMax + ","
+ "warehouseSlotCount:" + WarehouseSlotCount + ","
+ "backpackSlotCount:" + BackpackSlotCount + "," + "backpackSlotCount:" + BackpackSlotCount + ","
+ "secureSlotCount:" + SecureSlotCount + "," + "secureSlotCount:" + SecureSlotCount + ","
+ "minPlayerPartySize:" + MinPlayerPartySize + "," + "minPlayerPartySize:" + MinPlayerPartySize + ","
@@ -26,6 +26,7 @@ public sealed partial class ItemConfig : Luban.BeanBase
MaxMpBonus = _buf.ReadInt(); MaxMpBonus = _buf.ReadInt();
AtkBonus = _buf.ReadInt(); AtkBonus = _buf.ReadInt();
MatBonus = _buf.ReadInt(); MatBonus = _buf.ReadInt();
SpeedBonus = _buf.ReadInt();
} }
public static ItemConfig DeserializeItemConfig(ByteBuf _buf) public static ItemConfig DeserializeItemConfig(ByteBuf _buf)
@@ -73,6 +74,10 @@ public sealed partial class ItemConfig : Luban.BeanBase
/// MAT修正 /// MAT修正
/// </summary> /// </summary>
public readonly int MatBonus; public readonly int MatBonus;
/// <summary>
/// SPD修正
/// </summary>
public readonly int SpeedBonus;
public const int __ID__ = -764023723; public const int __ID__ = -764023723;
public override int GetTypeId() => __ID__; public override int GetTypeId() => __ID__;
@@ -89,6 +94,7 @@ public sealed partial class ItemConfig : Luban.BeanBase
} }
public override string ToString() public override string ToString()
@@ -104,6 +110,7 @@ public sealed partial class ItemConfig : Luban.BeanBase
+ "maxMpBonus:" + MaxMpBonus + "," + "maxMpBonus:" + MaxMpBonus + ","
+ "atkBonus:" + AtkBonus + "," + "atkBonus:" + AtkBonus + ","
+ "matBonus:" + MatBonus + "," + "matBonus:" + MatBonus + ","
+ "speedBonus:" + SpeedBonus + ","
+ "}"; + "}";
} }
} }
@@ -16,7 +16,7 @@ public sealed partial class SceneConfig : Luban.BeanBase
{ {
public SceneConfig(ByteBuf _buf) public SceneConfig(ByteBuf _buf)
{ {
Id = _buf.ReadInt(); Id = (SceneType)_buf.ReadInt();
AssetName = _buf.ReadString(); AssetName = _buf.ReadString();
BackgroundMusicId = _buf.ReadInt(); BackgroundMusicId = _buf.ReadInt();
} }
@@ -29,7 +29,7 @@ public sealed partial class SceneConfig : Luban.BeanBase
/// <summary> /// <summary>
/// 场景编号 /// 场景编号
/// </summary> /// </summary>
public readonly int Id; public readonly SceneType Id;
/// <summary> /// <summary>
/// 资源名称 /// 资源名称
/// </summary> /// </summary>
@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SepCore.Definition
{
/// <summary>
/// 场景类型
/// </summary>
public enum SceneType : byte
{
/// <summary>
/// 启动场景
/// </summary>
Launch = 0,
/// <summary>
/// 菜单场景
/// </summary>
Menu = 1,
/// <summary>
/// 主场景
/// </summary>
Main = 2,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ab1610b60f3ea4315a395afa38cc1ca5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+4 -1
View File
@@ -14,9 +14,10 @@ namespace SepCore.Definition
public partial class Tables public partial class Tables
{ {
/// <summary> /// <summary>
/// 全局固定规则 /// 全局零散配置(单例)
/// </summary> /// </summary>
public TbGlobalConfig TbGlobalConfig {get; } public TbGlobalConfig TbGlobalConfig {get; }
public TbFormatText TbFormatText {get; }
/// <summary> /// <summary>
/// 稀有度搜索时间 /// 稀有度搜索时间
/// </summary> /// </summary>
@@ -85,6 +86,7 @@ public partial class Tables
public Tables(System.Func<string, ByteBuf> loader) public Tables(System.Func<string, ByteBuf> loader)
{ {
TbGlobalConfig = new TbGlobalConfig(loader("tbglobalconfig")); TbGlobalConfig = new TbGlobalConfig(loader("tbglobalconfig"));
TbFormatText = new TbFormatText(loader("tbformattext"));
TbRarityConfig = new TbRarityConfig(loader("tbrarityconfig")); TbRarityConfig = new TbRarityConfig(loader("tbrarityconfig"));
TbDifficultyConfig = new TbDifficultyConfig(loader("tbdifficultyconfig")); TbDifficultyConfig = new TbDifficultyConfig(loader("tbdifficultyconfig"));
TbCharacterConfig = new TbCharacterConfig(loader("tbcharacterconfig")); TbCharacterConfig = new TbCharacterConfig(loader("tbcharacterconfig"));
@@ -107,6 +109,7 @@ public partial class Tables
private void ResolveRef() private void ResolveRef()
{ {
TbGlobalConfig.ResolveRef(this); TbGlobalConfig.ResolveRef(this);
TbFormatText.ResolveRef(this);
TbRarityConfig.ResolveRef(this); TbRarityConfig.ResolveRef(this);
TbDifficultyConfig.ResolveRef(this); TbDifficultyConfig.ResolveRef(this);
TbCharacterConfig.ResolveRef(this); TbCharacterConfig.ResolveRef(this);
@@ -0,0 +1,52 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using Luban;
namespace SepCore.Definition
{
public partial class TbFormatText
{
private readonly System.Collections.Generic.Dictionary<string, FormatText> _dataMap;
private readonly System.Collections.Generic.List<FormatText> _dataList;
public TbFormatText(ByteBuf _buf)
{
_dataMap = new System.Collections.Generic.Dictionary<string, FormatText>();
_dataList = new System.Collections.Generic.List<FormatText>();
for(int n = _buf.ReadSize() ; n > 0 ; --n)
{
FormatText _v;
_v = FormatText.DeserializeFormatText(_buf);
_dataList.Add(_v);
_dataMap.Add(_v.Name, _v);
}
}
public System.Collections.Generic.Dictionary<string, FormatText> DataMap => _dataMap;
public System.Collections.Generic.List<FormatText> DataList => _dataList;
public FormatText GetOrDefault(string key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public FormatText Get(string key) => _dataMap[key];
public FormatText this[string key] => _dataMap[key];
public void ResolveRef(Tables tables)
{
foreach(var _v in _dataList)
{
_v.ResolveRef(tables);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d39bcaec55e074ab7a226678e837d3e9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -13,7 +13,7 @@ using Luban;
namespace SepCore.Definition namespace SepCore.Definition
{ {
/// <summary> /// <summary>
/// 全局固定规则 /// 全局零散配置(单例)
/// </summary> /// </summary>
public partial class TbGlobalConfig public partial class TbGlobalConfig
{ {
@@ -55,6 +55,10 @@ public partial class TbGlobalConfig
/// </summary> /// </summary>
public int AlertMax => _data.AlertMax; public int AlertMax => _data.AlertMax;
/// <summary> /// <summary>
/// 仓库格子数
/// </summary>
public int WarehouseSlotCount => _data.WarehouseSlotCount;
/// <summary>
/// 共享背包格子数 /// 共享背包格子数
/// </summary> /// </summary>
public int BackpackSlotCount => _data.BackpackSlotCount; public int BackpackSlotCount => _data.BackpackSlotCount;
@@ -17,12 +17,12 @@ namespace SepCore.Definition
/// </summary> /// </summary>
public partial class TbSceneConfig public partial class TbSceneConfig
{ {
private readonly System.Collections.Generic.Dictionary<int, SceneConfig> _dataMap; private readonly System.Collections.Generic.Dictionary<SceneType, SceneConfig> _dataMap;
private readonly System.Collections.Generic.List<SceneConfig> _dataList; private readonly System.Collections.Generic.List<SceneConfig> _dataList;
public TbSceneConfig(ByteBuf _buf) public TbSceneConfig(ByteBuf _buf)
{ {
_dataMap = new System.Collections.Generic.Dictionary<int, SceneConfig>(); _dataMap = new System.Collections.Generic.Dictionary<SceneType, SceneConfig>();
_dataList = new System.Collections.Generic.List<SceneConfig>(); _dataList = new System.Collections.Generic.List<SceneConfig>();
for(int n = _buf.ReadSize() ; n > 0 ; --n) for(int n = _buf.ReadSize() ; n > 0 ; --n)
@@ -34,12 +34,12 @@ public partial class TbSceneConfig
} }
} }
public System.Collections.Generic.Dictionary<int, SceneConfig> DataMap => _dataMap; public System.Collections.Generic.Dictionary<SceneType, SceneConfig> DataMap => _dataMap;
public System.Collections.Generic.List<SceneConfig> DataList => _dataList; public System.Collections.Generic.List<SceneConfig> DataList => _dataList;
public SceneConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null; public SceneConfig GetOrDefault(SceneType key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public SceneConfig Get(int key) => _dataMap[key]; public SceneConfig Get(SceneType key) => _dataMap[key];
public SceneConfig this[int key] => _dataMap[key]; public SceneConfig this[SceneType key] => _dataMap[key];
public void ResolveRef(Tables tables) public void ResolveRef(Tables tables)
{ {
@@ -17,12 +17,12 @@ namespace SepCore.Definition
/// </summary> /// </summary>
public partial class TbUIFormConfig public partial class TbUIFormConfig
{ {
private readonly System.Collections.Generic.Dictionary<int, UIFormConfig> _dataMap; private readonly System.Collections.Generic.Dictionary<UIFormType, UIFormConfig> _dataMap;
private readonly System.Collections.Generic.List<UIFormConfig> _dataList; private readonly System.Collections.Generic.List<UIFormConfig> _dataList;
public TbUIFormConfig(ByteBuf _buf) public TbUIFormConfig(ByteBuf _buf)
{ {
_dataMap = new System.Collections.Generic.Dictionary<int, UIFormConfig>(); _dataMap = new System.Collections.Generic.Dictionary<UIFormType, UIFormConfig>();
_dataList = new System.Collections.Generic.List<UIFormConfig>(); _dataList = new System.Collections.Generic.List<UIFormConfig>();
for(int n = _buf.ReadSize() ; n > 0 ; --n) for(int n = _buf.ReadSize() ; n > 0 ; --n)
@@ -34,12 +34,12 @@ public partial class TbUIFormConfig
} }
} }
public System.Collections.Generic.Dictionary<int, UIFormConfig> DataMap => _dataMap; public System.Collections.Generic.Dictionary<UIFormType, UIFormConfig> DataMap => _dataMap;
public System.Collections.Generic.List<UIFormConfig> DataList => _dataList; public System.Collections.Generic.List<UIFormConfig> DataList => _dataList;
public UIFormConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null; public UIFormConfig GetOrDefault(UIFormType key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public UIFormConfig Get(int key) => _dataMap[key]; public UIFormConfig Get(UIFormType key) => _dataMap[key];
public UIFormConfig this[int key] => _dataMap[key]; public UIFormConfig this[UIFormType key] => _dataMap[key];
public void ResolveRef(Tables tables) public void ResolveRef(Tables tables)
{ {
@@ -16,7 +16,7 @@ public sealed partial class UIFormConfig : Luban.BeanBase
{ {
public UIFormConfig(ByteBuf _buf) public UIFormConfig(ByteBuf _buf)
{ {
Id = _buf.ReadInt(); Id = (UIFormType)_buf.ReadInt();
AssetName = _buf.ReadString(); AssetName = _buf.ReadString();
UIGroupName = _buf.ReadString(); UIGroupName = _buf.ReadString();
AllowMultiInstance = _buf.ReadBool(); AllowMultiInstance = _buf.ReadBool();
@@ -31,7 +31,7 @@ public sealed partial class UIFormConfig : Luban.BeanBase
/// <summary> /// <summary>
/// 界面编号 /// 界面编号
/// </summary> /// </summary>
public readonly int Id; public readonly UIFormType Id;
/// <summary> /// <summary>
/// 资源名称 /// 资源名称
/// </summary> /// </summary>
@@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SepCore.Definition
{
/// <summary>
/// 界面类型
/// </summary>
public enum UIFormType : byte
{
/// <summary>
/// 未定义
/// </summary>
Undefined = 0,
/// <summary>
/// 弹出框
/// </summary>
DialogForm = 1,
/// <summary>
/// 大厅界面
/// </summary>
LobbyForm = 100,
/// <summary>
/// 设置
/// </summary>
SettingForm = 101,
/// <summary>
/// 关于
/// </summary>
AboutForm = 102,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1d9c04bb114b74ef4a6c4e0985d7b31a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -326,14 +326,14 @@ namespace SepCore.Editor
for (int i = 0; i < batch.entries.Count; i++) for (int i = 0; i < batch.entries.Count; i++)
{ {
PendingGeneration pending = batch.entries[i]; PendingGeneration pending = batch.entries[i];
Type viewType = FindViewType(pending.viewClassFullName); Type viewType = FindGeneratedType(pending.viewClassFullName);
if (viewType == null) if (viewType == null)
{ {
Debug.LogError("Generated UI view type was not found after compilation: " + pending.viewClassFullName); Debug.LogError("Generated UI view type was not found after compilation: " + pending.viewClassFullName);
return; return;
} }
Type formType = FindViewType(pending.formClassFullName); Type formType = FindGeneratedType(pending.formClassFullName);
if (formType == null) if (formType == null)
{ {
Debug.LogError("Generated UI form type was not found after compilation: " + pending.formClassFullName); Debug.LogError("Generated UI form type was not found after compilation: " + pending.formClassFullName);
@@ -401,9 +401,9 @@ namespace SepCore.Editor
} }
current.RefreshItems(); current.RefreshItems();
for (int i = 0; i < current.NestedViewReferences.Count; i++) for (int i = 0; i < current.NestedFormReferences.Count; i++)
{ {
UISerializationRoot nestedRoot = current.NestedViewReferences[i].Root; UISerializationRoot nestedRoot = current.NestedFormReferences[i].Root;
if (nestedRoot != null) if (nestedRoot != null)
{ {
CollectGenerationRootsRecursive(nestedRoot, persistentContext, visited, result); CollectGenerationRootsRecursive(nestedRoot, persistentContext, visited, result);
@@ -519,9 +519,9 @@ namespace SepCore.Editor
} }
} }
for (int i = 0; i < root.NestedViewReferences.Count; i++) for (int i = 0; i < root.NestedFormReferences.Count; i++)
{ {
UISerializationRoot.NestedViewReference reference = root.NestedViewReferences[i]; UISerializationRoot.NestedFormReference reference = root.NestedFormReferences[i];
if (reference == null || !reference.GenerateReference) if (reference == null || !reference.GenerateReference)
{ {
continue; continue;
@@ -530,7 +530,7 @@ namespace SepCore.Editor
UISerializationRoot nestedRoot = reference.Root; UISerializationRoot nestedRoot = reference.Root;
if (nestedRoot == null) if (nestedRoot == null)
{ {
throw new InvalidOperationException("A nested UI View reference is missing below " + GetHierarchyPath(root.transform) + "."); throw new InvalidOperationException("A nested UI Form reference is missing below " + GetHierarchyPath(root.transform) + ".");
} }
string variableName = NormalizeAndValidateVariableName(reference.VariableName, nestedRoot.transform, names); string variableName = NormalizeAndValidateVariableName(reference.VariableName, nestedRoot.transform, names);
@@ -538,7 +538,7 @@ namespace SepCore.Editor
{ {
nestedRoot = nestedRoot, nestedRoot = nestedRoot,
variableName = variableName, variableName = variableName,
csharpTypeName = "global::" + GeneratedNamespace + "." + GetViewClassName(nestedRoot) csharpTypeName = "global::" + GeneratedNamespace + "." + GetFormClassName(nestedRoot)
}); });
} }
@@ -679,17 +679,17 @@ namespace SepCore.Editor
} }
root.RefreshItems(); root.RefreshItems();
for (int i = 0; i < root.NestedViewReferences.Count; i++) for (int i = 0; i < root.NestedFormReferences.Count; i++)
{ {
UISerializationRoot nestedRoot = root.NestedViewReferences[i].Root; UISerializationRoot nestedRoot = root.NestedFormReferences[i].Root;
if (nestedRoot != null) if (nestedRoot != null)
{ {
ApplyGeneratedComponentsToRoot(nestedRoot); ApplyGeneratedComponentsToRoot(nestedRoot);
} }
} }
Type viewType = FindViewType(GeneratedNamespace + "." + GetViewClassName(root)); Type viewType = FindGeneratedType(GeneratedNamespace + "." + GetViewClassName(root));
Type formType = FindViewType(GeneratedNamespace + "." + GetFormClassName(root)); Type formType = FindGeneratedType(GeneratedNamespace + "." + GetFormClassName(root));
if (viewType == null || formType == null) if (viewType == null || formType == null)
{ {
return; return;
@@ -757,19 +757,19 @@ namespace SepCore.Editor
UnityEngine.Object target = binding.component; UnityEngine.Object target = binding.component;
if (binding.nestedRoot != null) if (binding.nestedRoot != null)
{ {
string nestedViewFullName = GeneratedNamespace + "." + GetViewClassName(binding.nestedRoot); string nestedFormFullName = GeneratedNamespace + "." + GetFormClassName(binding.nestedRoot);
Type nestedViewType = FindViewType(nestedViewFullName); Type nestedFormType = FindGeneratedType(nestedFormFullName);
if (nestedViewType == null) if (nestedFormType == null)
{ {
throw new InvalidOperationException("Nested UI view type was not found: " + nestedViewFullName + "."); throw new InvalidOperationException("Nested UI form type was not found: " + nestedFormFullName + ".");
} }
target = binding.nestedRoot.GetComponent(nestedViewType); target = binding.nestedRoot.GetComponent(nestedFormType);
if (target == null) if (target == null)
{ {
throw new InvalidOperationException( throw new InvalidOperationException(
"Nested UI root '" + GetHierarchyPath(binding.nestedRoot.transform) + "Nested UI root '" + GetHierarchyPath(binding.nestedRoot.transform) +
"' does not have its generated View component '" + nestedViewFullName + "'."); "' does not have its generated Form component '" + nestedFormFullName + "'.");
} }
} }
@@ -786,7 +786,7 @@ namespace SepCore.Editor
return view; return view;
} }
private static Type FindViewType(string fullName) private static Type FindGeneratedType(string fullName)
{ {
return TypeCache.GetTypesDerivedFrom<MonoBehaviour>() return TypeCache.GetTypesDerivedFrom<MonoBehaviour>()
.FirstOrDefault(type => type.FullName == fullName); .FirstOrDefault(type => type.FullName == fullName);
@@ -40,10 +40,10 @@ namespace SepCore.Editor
} }
} }
SerializedProperty nestedViews = serializedObject.FindProperty("nestedViewReferences"); SerializedProperty nestedForms = serializedObject.FindProperty("nestedFormReferences");
for (int i = 0; i < nestedViews.arraySize; i++) for (int i = 0; i < nestedForms.arraySize; i++)
{ {
SerializedProperty entry = nestedViews.GetArrayElementAtIndex(i); SerializedProperty entry = nestedForms.GetArrayElementAtIndex(i);
if (entry.FindPropertyRelative("generateReference").boolValue) if (entry.FindPropertyRelative("generateReference").boolValue)
{ {
referenceCount++; referenceCount++;
@@ -53,7 +53,7 @@ namespace SepCore.Editor
EditorGUILayout.LabelField("View Class", UIAssetsTools.GetViewClassName(root)); EditorGUILayout.LabelField("View Class", UIAssetsTools.GetViewClassName(root));
EditorGUILayout.LabelField("Form Class", UIAssetsTools.GetFormClassName(root)); EditorGUILayout.LabelField("Form Class", UIAssetsTools.GetFormClassName(root));
EditorGUILayout.LabelField("Owned Items", root.SerializationItems.Count.ToString()); EditorGUILayout.LabelField("Owned Items", root.SerializationItems.Count.ToString());
EditorGUILayout.LabelField("Nested Views", nestedViews.arraySize.ToString()); EditorGUILayout.LabelField("Nested Forms", nestedForms.arraySize.ToString());
EditorGUILayout.LabelField("Generated References", referenceCount.ToString()); EditorGUILayout.LabelField("Generated References", referenceCount.ToString());
EditorGUILayout.Space(4f); EditorGUILayout.Space(4f);
@@ -77,15 +77,15 @@ namespace SepCore.Editor
} }
EditorGUILayout.Space(4f); EditorGUILayout.Space(4f);
EditorGUILayout.LabelField("Nested Views", EditorStyles.boldLabel); EditorGUILayout.LabelField("Nested Forms", EditorStyles.boldLabel);
if (nestedViews.arraySize == 0) if (nestedForms.arraySize == 0)
{ {
EditorGUILayout.HelpBox("Nested UISerializationRoot components will appear here and form serialization boundaries.", MessageType.Info); EditorGUILayout.HelpBox("Nested UISerializationRoot components will appear here as child Form references and form serialization boundaries.", MessageType.Info);
} }
for (int i = 0; i < nestedViews.arraySize; i++) for (int i = 0; i < nestedForms.arraySize; i++)
{ {
SerializedProperty entry = nestedViews.GetArrayElementAtIndex(i); SerializedProperty entry = nestedForms.GetArrayElementAtIndex(i);
SerializedProperty nestedRootProperty = entry.FindPropertyRelative("root"); SerializedProperty nestedRootProperty = entry.FindPropertyRelative("root");
SerializedProperty generate = entry.FindPropertyRelative("generateReference"); SerializedProperty generate = entry.FindPropertyRelative("generateReference");
SerializedProperty variableName = entry.FindPropertyRelative("variableName"); SerializedProperty variableName = entry.FindPropertyRelative("variableName");
@@ -107,7 +107,7 @@ namespace SepCore.Editor
if (nestedRoot != null) if (nestedRoot != null)
{ {
EditorGUILayout.LabelField("View Class", UIAssetsTools.GetViewClassName(nestedRoot)); EditorGUILayout.LabelField("Form Class", UIAssetsTools.GetFormClassName(nestedRoot));
} }
if (generate.boolValue) if (generate.boolValue)
@@ -68,6 +68,14 @@ namespace SepCore.Procedure
() => () =>
{ {
_loadedFlag[LubanTablesFlag] = true; _loadedFlag[LubanTablesFlag] = true;
// Load save data; create a new game if no save exists
GameEntry.Save.Load();
if (!GameEntry.Save.HasSave && !GameEntry.Save.IsReady)
{
GameEntry.Save.CreateNewGame();
}
Log.Info("Load Luban data tables OK."); Log.Info("Load Luban data tables OK.");
}, },
errorMessage => errorMessage =>
@@ -1,5 +1,6 @@
using GameFramework.Fsm; using GameFramework.Fsm;
using GameFramework.Procedure; using GameFramework.Procedure;
using SepCore.Definition;
using SepCore.UI; using SepCore.UI;
namespace SepCore.Procedure namespace SepCore.Procedure
@@ -15,15 +16,7 @@ namespace SepCore.Procedure
{ {
base.OnEnter(procedureOwner); base.OnEnter(procedureOwner);
DialogParams context = new DialogParams() GameEntry.UI.OpenUIForm(UIFormType.LobbyForm);
{
Message = "This is a test dialog.",
Title = "This is a test dialog.",
Mode = 2,
ConfirmText = "确认",
CancelText = "取消",
};
GameEntry.UI.OpenDialog(context);
} }
protected override void OnUpdate(IFsm<IProcedureManager> procedureOwner, float elapseSeconds, protected override void OnUpdate(IFsm<IProcedureManager> procedureOwner, float elapseSeconds,
@@ -34,6 +27,8 @@ namespace SepCore.Procedure
protected override void OnLeave(IFsm<IProcedureManager> procedureOwner, bool isShutdown) protected override void OnLeave(IFsm<IProcedureManager> procedureOwner, bool isShutdown)
{ {
GameEntry.UI.CloseAllLoadedUIForms();
base.OnLeave(procedureOwner, isShutdown); base.OnLeave(procedureOwner, isShutdown);
} }
@@ -10,9 +10,12 @@ public partial class GameEntry : MonoBehaviour
public static LubanComponent Luban { get; private set; } public static LubanComponent Luban { get; private set; }
public static SaveComponent Save { get; private set; }
private static void InitCustomComponents() private static void InitCustomComponents()
{ {
BuiltinData = UnityGameFramework.Runtime.GameEntry.GetComponent<BuiltinDataComponent>(); BuiltinData = UnityGameFramework.Runtime.GameEntry.GetComponent<BuiltinDataComponent>();
Luban = UnityGameFramework.Runtime.GameEntry.GetComponent<LubanComponent>(); Luban = UnityGameFramework.Runtime.GameEntry.GetComponent<LubanComponent>();
Save = UnityGameFramework.Runtime.GameEntry.GetComponent<SaveComponent>();
} }
} }
@@ -1,4 +1,7 @@
using System;
using System.Threading;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using GameFramework.Resource;
using UnityGameFramework.Runtime; using UnityGameFramework.Runtime;
using ResourceApplySuccessEventArgs = UnityGameFramework.Runtime.ResourceApplySuccessEventArgs; using ResourceApplySuccessEventArgs = UnityGameFramework.Runtime.ResourceApplySuccessEventArgs;
using ResourceUpdateAllCompleteEventArgs = UnityGameFramework.Runtime.ResourceUpdateAllCompleteEventArgs; using ResourceUpdateAllCompleteEventArgs = UnityGameFramework.Runtime.ResourceUpdateAllCompleteEventArgs;
@@ -58,5 +61,42 @@ namespace SepCore.AsyncTask
timeout timeout
); );
} }
/// <summary>
/// 异步加载资源
/// </summary>
/// <typeparam name="T">资源类型</typeparam>
/// <param name="resourceComponent">资源组件</param>
/// <param name="assetName">资源名称</param>
/// <param name="priority">加载优先级</param>
/// <param name="userData">用户自定义数据</param>
/// <param name="progress">加载进度</param>
/// <param name="timeout">超时时间(秒),0表示不超时</param>
/// <returns>加载的资源</returns>
public static UniTask<T> LoadAssetAsync<T>(this ResourceComponent resourceComponent,
string assetName,
int priority = 0,
object userData = null,
IProgress<float> progress = null,
float timeout = 0f) where T : class
{
var tcs = new UniTaskCompletionSource<T>();
var callbacks = new LoadAssetCallbacks(
(name, asset, duration, ud) => tcs.TrySetResult((T)asset),
(name, status, errorMessage, ud) => tcs.TrySetException(new Exception($"加载资源失败: {name}, status: {status}, error: {errorMessage}")),
(name, p, ud) => progress?.Report(p)
);
resourceComponent.LoadAsset(assetName, typeof(T), priority, callbacks, userData);
if (timeout > 0f)
{
UniTask.Delay(TimeSpan.FromSeconds(timeout), cancellationToken: CancellationToken.None)
.ContinueWith(() => tcs.TrySetException(new TimeoutException($"加载资源超时: {assetName}, {timeout}秒")));
}
return tcs.Task;
}
} }
} }
@@ -35,6 +35,7 @@ namespace SepCore.CustomComponent
"tbsoundconfig", "tbsoundconfig",
"tbuiformconfig", "tbuiformconfig",
"tbuisoundconfig", "tbuisoundconfig",
"tbformattext"
}; };
private sealed class TableAccessor private sealed class TableAccessor
@@ -44,24 +45,88 @@ namespace SepCore.CustomComponent
} }
private static readonly Dictionary<Type, TableAccessor> TableAccessors = private static readonly Dictionary<Type, TableAccessor> TableAccessors =
new Dictionary<Type, TableAccessor> new()
{ {
{ typeof(CharacterConfig), Accessor(tables => id => tables.TbCharacterConfig.GetOrDefault(id), tables => tables.TbCharacterConfig.DataList) }, {
{ typeof(BattleActionConfig), Accessor(tables => id => tables.TbBattleActionConfig.GetOrDefault(id), tables => tables.TbBattleActionConfig.DataList) }, typeof(CharacterConfig),
{ typeof(ThreatLevelConfig), Accessor(tables => id => tables.TbThreatLevelConfig.GetOrDefault(id), tables => tables.TbThreatLevelConfig.DataList) }, Accessor(tables => id => tables.TbCharacterConfig.GetOrDefault(id),
{ typeof(EnemyConfig), Accessor(tables => id => tables.TbEnemyConfig.GetOrDefault(id), tables => tables.TbEnemyConfig.DataList) }, tables => tables.TbCharacterConfig.DataList)
{ typeof(EnemyPartyConfig), Accessor(tables => id => tables.TbEnemyPartyConfig.GetOrDefault(id), tables => tables.TbEnemyPartyConfig.DataList) }, },
{ typeof(ItemConfig), Accessor(tables => id => tables.TbItemConfig.GetOrDefault(id), tables => tables.TbItemConfig.DataList) }, {
{ typeof(ResourcePointConfig), Accessor(tables => id => tables.TbResourcePointConfig.GetOrDefault(id), tables => tables.TbResourcePointConfig.DataList) }, typeof(BattleActionConfig),
{ typeof(EnemyDropConfig), Accessor(tables => id => tables.TbEnemyDropConfig.GetOrDefault(id), tables => tables.TbEnemyDropConfig.DataList) }, Accessor(tables => id => tables.TbBattleActionConfig.GetOrDefault(id),
{ typeof(RarityConfig), Accessor(tables => id => tables.TbRarityConfig.GetOrDefault((Rarity)id), tables => tables.TbRarityConfig.DataList) }, tables => tables.TbBattleActionConfig.DataList)
{ typeof(DifficultyConfig), Accessor(tables => id => tables.TbDifficultyConfig.GetOrDefault((DifficultyTier)id), tables => tables.TbDifficultyConfig.DataList) }, },
{ typeof(EntityConfig), Accessor(tables => id => tables.TbEntityConfig.GetOrDefault(id), tables => tables.TbEntityConfig.DataList) }, {
{ typeof(MusicConfig), Accessor(tables => id => tables.TbMusicConfig.GetOrDefault(id), tables => tables.TbMusicConfig.DataList) }, typeof(ThreatLevelConfig),
{ typeof(SceneConfig), Accessor(tables => id => tables.TbSceneConfig.GetOrDefault(id), tables => tables.TbSceneConfig.DataList) }, Accessor(tables => id => tables.TbThreatLevelConfig.GetOrDefault(id),
{ typeof(SoundConfig), Accessor(tables => id => tables.TbSoundConfig.GetOrDefault(id), tables => tables.TbSoundConfig.DataList) }, tables => tables.TbThreatLevelConfig.DataList)
{ typeof(UIFormConfig), Accessor(tables => id => tables.TbUIFormConfig.GetOrDefault(id), tables => tables.TbUIFormConfig.DataList) }, },
{ typeof(UISoundConfig), Accessor(tables => id => tables.TbUISoundConfig.GetOrDefault(id), tables => tables.TbUISoundConfig.DataList) }, {
typeof(EnemyConfig),
Accessor(tables => id => tables.TbEnemyConfig.GetOrDefault(id),
tables => tables.TbEnemyConfig.DataList)
},
{
typeof(EnemyPartyConfig),
Accessor(tables => id => tables.TbEnemyPartyConfig.GetOrDefault(id),
tables => tables.TbEnemyPartyConfig.DataList)
},
{
typeof(ItemConfig),
Accessor(tables => id => tables.TbItemConfig.GetOrDefault(id),
tables => tables.TbItemConfig.DataList)
},
{
typeof(ResourcePointConfig),
Accessor(tables => id => tables.TbResourcePointConfig.GetOrDefault(id),
tables => tables.TbResourcePointConfig.DataList)
},
{
typeof(EnemyDropConfig),
Accessor(tables => id => tables.TbEnemyDropConfig.GetOrDefault(id),
tables => tables.TbEnemyDropConfig.DataList)
},
{
typeof(RarityConfig),
Accessor(tables => id => tables.TbRarityConfig.GetOrDefault((Rarity)id),
tables => tables.TbRarityConfig.DataList)
},
{
typeof(DifficultyConfig),
Accessor(tables => id => tables.TbDifficultyConfig.GetOrDefault((DifficultyTier)id),
tables => tables.TbDifficultyConfig.DataList)
},
{
typeof(EntityConfig),
Accessor(tables => id => tables.TbEntityConfig.GetOrDefault(id),
tables => tables.TbEntityConfig.DataList)
},
{
typeof(MusicConfig),
Accessor(tables => id => tables.TbMusicConfig.GetOrDefault(id),
tables => tables.TbMusicConfig.DataList)
},
{
typeof(SceneConfig),
Accessor(tables => id => tables.TbSceneConfig.GetOrDefault((SceneType)id),
tables => tables.TbSceneConfig.DataList)
},
{
typeof(SoundConfig),
Accessor(tables => id => tables.TbSoundConfig.GetOrDefault(id),
tables => tables.TbSoundConfig.DataList)
},
{
typeof(UIFormConfig),
Accessor(tables => id => tables.TbUIFormConfig.GetOrDefault((UIFormType)id),
tables => tables.TbUIFormConfig.DataList)
},
{
typeof(UISoundConfig),
Accessor(tables => id => tables.TbUISoundConfig.GetOrDefault(id),
tables => tables.TbUISoundConfig.DataList)
},
}; };
private static TableAccessor Accessor<TValue>(Func<Tables, Func<int, object>> rowGetterFactory, private static TableAccessor Accessor<TValue>(Func<Tables, Func<int, object>> rowGetterFactory,
@@ -82,13 +147,15 @@ namespace SepCore.CustomComponent
/// <summary> /// <summary>
/// 获取 Luban 数据表管理器,加载完成后可用。 /// 获取 Luban 数据表管理器,加载完成后可用。
/// </summary> /// </summary>
public SepCore.Definition.Tables Tables { get; private set; } public Tables Tables { get; private set; }
/// <summary> /// <summary>
/// 获取数据表是否已加载完成。 /// 获取数据表是否已加载完成。
/// </summary> /// </summary>
public bool IsReady => Tables != null; public bool IsReady => Tables != null;
public TbGlobalConfig Global => Tables.TbGlobalConfig;
/// <summary> /// <summary>
/// 按 id 获取数据行,未找到时返回 null。 /// 按 id 获取数据行,未找到时返回 null。
/// </summary> /// </summary>
@@ -193,7 +260,8 @@ namespace SepCore.CustomComponent
} }
} }
private void OnLoadTableFailure(string assetName, LoadResourceStatus status, string errorMessage, object userData) private void OnLoadTableFailure(string assetName, LoadResourceStatus status, string errorMessage,
object userData)
{ {
Log.Error("Can not load data table '{0}' from '{1}' with error message '{2}'.", (string)userData, assetName, Log.Error("Can not load data table '{0}' from '{1}' with error message '{2}'.", (string)userData, assetName,
errorMessage); errorMessage);
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 233579b69c85c4f9db143fcf0368c36a guid: 8247612c245cc47be82009199a823d68
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
@@ -0,0 +1,192 @@
using System;
using System.Collections.Generic;
using System.IO;
using SepCore.Definition;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace SepCore.CustomComponent
{
/// <summary>
/// 存档组件。
/// 负责游戏存档的读取与写入,数据结构见 Docs/Tech/02_SaveData.md。
/// 存档只包含局外状态与已结束单局的结算记录;进行中的单局使用临时状态,不写入存档。
/// </summary>
public class SaveComponent : GameFrameworkComponent
{
/// <summary>
/// 存档文件名。
/// </summary>
[SerializeField] private string _fileName = "save.json";
private SaveData _data = null;
private bool _hasSave = false;
/// <summary>
/// 获取当前内存中的存档数据;未加载或未创建时为 null。
/// </summary>
public SaveData Data => _data;
/// <summary>
/// 获取磁盘上是否已存在存档文件。
/// </summary>
public bool HasSave => _hasSave;
/// <summary>
/// 获取存档数据是否可用。
/// </summary>
public bool IsReady => _data != null;
/// <summary>
/// 获取存档文件的完整路径。
/// </summary>
public string SaveFilePath => GameFramework.Utility.Path.GetRegularPath(
Path.Combine(Application.persistentDataPath, _fileName));
/// <summary>
/// 从磁盘加载存档。
/// 文件不存在时返回 true 且 HasSave 为 false;解析失败时返回 false。
/// </summary>
public bool Load()
{
string path = SaveFilePath;
if (!File.Exists(path))
{
_hasSave = false;
_data = null;
Log.Info("Save file '{0}' does not exist.", path);
return true;
}
try
{
string json = File.ReadAllText(path);
SaveData data = SaveData.FromJson(json);
if (data == null)
{
Log.Error("Parse save file '{0}' failure.", path);
_hasSave = true;
_data = null;
return false;
}
if (data.version != SaveData.CurrentVersion)
{
Log.Warning("Save file '{0}' version '{1}' does not match current version '{2}'.",
path, data.version, SaveData.CurrentVersion);
}
_data = data;
_hasSave = true;
Log.Info("Load save file '{0}' OK.", path);
return true;
}
catch (Exception exception)
{
Log.Error("Load save file '{0}' failure with exception '{1}'.", path, exception);
_hasSave = true;
_data = null;
return false;
}
}
/// <summary>
/// 创建新存档数据(不写盘)。
/// 角色与初始装备来自配表:GlobalConfig.NewGameCharacterIds 与 CharacterConfig 的初始装备栏。
/// </summary>
public bool CreateNewGame()
{
if (!GameEntry.Luban.IsReady)
{
Log.Error("Can not create new game before Luban data tables are loaded.");
return false;
}
GlobalConfig global = GameEntry.Luban.Global.Data;
SaveData data = new SaveData
{
version = SaveData.CurrentVersion,
updatedAt = GetTimestamp(),
mainWarehouse = CreateInitialWarehouse(),
characters = new List<CharacterSave>(),
loadout = new LoadoutSave(),
runHistory = new List<RunRecord>(),
};
foreach (int characterId in global.NewGameCharacterIds)
{
CharacterConfig config = GameEntry.Luban.Get<CharacterConfig>(characterId);
int weaponItemId = config != null ? config.WeaponItemId : 0;
int armorItemId = config != null ? config.ArmorItemId : 0;
data.characters.Add(new CharacterSave(characterId, weaponItemId, armorItemId));
}
data.loadout.Normalize();
_data = data;
_hasSave = false;
Log.Info("Create new game save data OK.");
return true;
}
/// <summary>
/// 将当前存档数据写入磁盘。
/// 写入前自动更新 updatedAt;使用临时文件替换,避免写入中断损坏存档。
/// </summary>
public bool Save()
{
if (_data == null)
{
Log.Warning("Can not save because save data does not exist.");
return false;
}
_data.updatedAt = GetTimestamp();
string json = _data.ToJson();
string path = SaveFilePath;
string tempPath = path + ".tmp";
try
{
File.WriteAllText(tempPath, json);
if (File.Exists(path))
{
File.Delete(path);
}
File.Move(tempPath, path);
_hasSave = true;
Log.Info("Save save file '{0}' OK.", path);
return true;
}
catch (Exception exception)
{
Log.Error("Save save file '{0}' failure with exception '{1}'.", path, exception);
return false;
}
}
private static List<ItemStack> CreateInitialWarehouse()
{
// 原型调试种子:覆盖全部物品类型与稀有度,用于筛选等功能开发。
// 后续由配表或正式新存档规则替代。
return new List<ItemStack>
{
new ItemStack(5001, 20), // 旧硬币 战利品/白
new ItemStack(5002, 7), // 宝石碎片 战利品/绿
new ItemStack(5003, 3), // 古代零件 战利品/蓝
new ItemStack(5004, 1), // 精致核心 战利品/金
new ItemStack(5005, 1), // 神秘遗物 战利品/红
new ItemStack(5101, 1), // 训练剑 装备/白
new ItemStack(5102, 1), // 法杖 装备/蓝
new ItemStack(5201, 1), // 布甲 装备/绿
new ItemStack(5202, 1), // 术士长袍 装备/金
new ItemStack(5301, 5), // 恢复药 消耗品/白
};
}
private static long GetTimestamp()
{
return DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e65ab245d7674846b4409282a610b3a9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -101,10 +101,6 @@ namespace SepCore.UI
foreach (var text in tmp_texts) foreach (var text in tmp_texts)
{ {
text.font = _mainTMPFont; text.font = _mainTMPFont;
if (!string.IsNullOrEmpty(text.text))
{
text.text = GameEntry.Localization.GetString(text.text);
}
} }
} }
@@ -1,9 +1,8 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2fc27161191c61549a74f80fd54e9645 guid: 4df8f90e8698941068b8d0dd7c3af46e
folderAsset: yes folderAsset: yes
timeCreated: 1528026150
licenseType: Pro
DefaultImporter: DefaultImporter:
externalObjects: {}
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
@@ -0,0 +1,41 @@
using SepCore.Definition;
using TMPro;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace SepCore.UI
{
/// <summary>
/// 使用 Luban 格式化文本表(TbFormatText)驱动 TextMeshProUGUI 的组件。
/// 在 Inspector 上填写 Key,调用 Set 传入格式化参数即可更新文本。
/// </summary>
[RequireComponent(typeof(TextMeshProUGUI))]
public class FormatTextUI : MonoBehaviour
{
[SerializeField] private string key;
private TextMeshProUGUI _text;
private void Awake()
{
_text = GetComponent<TextMeshProUGUI>();
}
public void Set(params object[] args)
{
FormatText format = GameEntry.Luban.Tables.TbFormatText.GetOrDefault(key);
if (format == null)
{
Log.Warning("Can not find format text '{0}'.", key);
return;
}
_text.SetText(string.Format(format.Format, args));
}
public void Clear()
{
_text.SetText(string.Empty);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6566a3a7cfd184008ab2282feea295f8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -6,16 +6,8 @@ namespace SepCore.UI
[DisallowMultipleComponent] [DisallowMultipleComponent]
public partial class CombatReadinessView : MonoBehaviour public partial class CombatReadinessView : MonoBehaviour
{ {
[SerializeField] public global::TMPro.TextMeshProUGUI squadMemberText;
[SerializeField] public global::UnityEngine.RectTransform characterSlotRoot;
[SerializeField] public global::SepCore.UI.CharacterSlotItem characterSlotTemplate;
[SerializeField] public global::UnityEngine.UI.ToggleGroup difficultyTabsToggleGroup;
[SerializeField] public global::TMPro.TMP_InputField seedInput;
[SerializeField] public global::UnityEngine.UI.Button randomizeButton;
[SerializeField] public global::TMPro.TextMeshProUGUI partySizeText;
[SerializeField] public global::TMPro.TextMeshProUGUI mapIdText;
[SerializeField] public global::TMPro.TextMeshProUGUI timeLimitText;
[SerializeField] public global::UnityEngine.UI.Button beginRunButton;
[SerializeField] public global::TMPro.TextMeshProUGUI storageText; [SerializeField] public global::TMPro.TextMeshProUGUI storageText;
[SerializeField] public global::SepCore.UI.SquadForm squadForm;
[SerializeField] public global::SepCore.UI.DeploymentForm deploymentForm;
} }
} }
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e9d3ff59008964126bb0c8052f0626e0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,13 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class DeploymentForm : UGuiForm
{
[SerializeField] private DeploymentView _view = null;
public DeploymentView View => _view;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 37901c3791a804ff6b35692ab2f67f04
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class DeploymentView : MonoBehaviour
{
[SerializeField] public global::UnityEngine.UI.Toggle tier1Toggle;
[SerializeField] public global::UnityEngine.UI.Toggle tier2Toggle;
[SerializeField] public global::UnityEngine.UI.Toggle tier3Toggle;
[SerializeField] public global::TMPro.TMP_InputField seedInput;
[SerializeField] public global::UnityEngine.UI.Button randomizeButton;
[SerializeField] public global::TMPro.TextMeshProUGUI partySizeText;
[SerializeField] public global::TMPro.TextMeshProUGUI mapIdText;
[SerializeField] public global::TMPro.TextMeshProUGUI timeLimitText;
[SerializeField] public global::UnityEngine.UI.Button beginRunButton;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0e9a8d6edf3794bc69f3b822e538ff96
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,195 @@
using System.Collections.Generic;
using SepCore.Base;
using SepCore.Definition;
using UnityEngine;
using UnityEngine.UI;
using UnityGameFramework.Runtime;
namespace SepCore.UI
{
/// <summary>
/// 物品列表界面逻辑(手写 partial,与自动生成的 InventoryForm.cs 合并)。
/// 支持按物品类型筛选(ALL / 战利品 / 装备 / 消耗品)。
/// 注意:本表单作为嵌套表单挂在 LobbyForm/WarehouseForm 下,UGF 生命周期(OnInit/OnOpen)
/// 不会被框架调用,事件绑定改为幂等式(EnsureListenersBound)。
/// </summary>
public partial class InventoryForm : UGuiForm
{
private bool _listenersBound = false;
private IReadOnlyList<ItemStack> _stacks = null;
private ItemType? _filterType = null;
private List<ItemStack> _visibleStacks = new List<ItemStack>();
private readonly List<WarehouseSlotItem> _slots = new List<WarehouseSlotItem>();
private void EnsureListenersBound()
{
if (_listenersBound)
{
return;
}
_listenersBound = true;
View.allToggle.onValueChanged.AddListener(OnAllToggleValueChanged);
View.lootToggle.onValueChanged.AddListener(OnLootToggleValueChanged);
View.equipmentToggle.onValueChanged.AddListener(OnEquipmentToggleValueChanged);
View.consumablesToggle.onValueChanged.AddListener(OnConsumablesToggleValueChanged);
}
private void OnAllToggleValueChanged(bool isOn)
{
if (isOn)
{
SetFilter(null);
}
}
private void OnLootToggleValueChanged(bool isOn)
{
if (isOn)
{
SetFilter(ItemType.Loot);
}
}
private void OnEquipmentToggleValueChanged(bool isOn)
{
if (isOn)
{
SetFilter(ItemType.Equipment);
}
}
private void OnConsumablesToggleValueChanged(bool isOn)
{
if (isOn)
{
SetFilter(ItemType.Consumable);
}
}
private void SetFilter(ItemType? filterType)
{
_filterType = filterType;
RebuildGrid();
}
/// <summary>
/// 设置列表数据并重建网格,保留当前筛选。
/// </summary>
public void RefreshList(IReadOnlyList<ItemStack> stacks)
{
EnsureListenersBound();
_stacks = stacks;
RebuildGrid();
}
private void RebuildGrid()
{
InventoryView inventoryView = View;
if (inventoryView == null || inventoryView.warehouseSlotRoot == null ||
inventoryView.warehouseSlotTemplate == null)
{
Log.Warning("InventoryForm is not fully configured.");
return;
}
int slotCount = GameEntry.Luban.Global.Data.WarehouseSlotCount;
if (slotCount <= 0)
{
Log.Warning("Warehouse slot count from global config is invalid: {0}.", slotCount);
return;
}
_visibleStacks = CollectVisibleStacks();
_slots.Clear();
WarehouseSlotItem template = inventoryView.warehouseSlotTemplate;
template.gameObject.SetActive(false);
for (int i = inventoryView.warehouseSlotRoot.childCount - 1; i >= 0; i--)
{
Transform child = inventoryView.warehouseSlotRoot.GetChild(i);
if (child == template.transform)
{
continue;
}
Destroy(child.gameObject);
}
for (int i = 0; i < slotCount; i++)
{
WarehouseSlotItem slot = Instantiate(template, inventoryView.warehouseSlotRoot);
slot.gameObject.SetActive(true);
slot.SetSlotId(i);
if (i < _visibleStacks.Count)
{
slot.SetItem(_visibleStacks[i]);
}
else
{
slot.SetEmpty();
}
_slots.Add(slot);
}
if (inventoryView.itemCountFormatText != null)
{
int usedSlotCount = _stacks != null ? _stacks.Count : 0;
inventoryView.itemCountFormatText.Set(usedSlotCount, slotCount);
}
}
/// <summary>
/// 按网格索引高亮对应格子,其余格子清除选中。
/// </summary>
public void SetSelectedSlot(int slotId)
{
for (int i = 0; i < _slots.Count; i++)
{
_slots[i].SetSelected(i == slotId);
}
}
/// <summary>
/// 获取指定网格索引对应的物品 ID;空格或越界返回 0。
/// </summary>
public int GetItemIdAtSlot(int slotId)
{
if (slotId < 0 || slotId >= _visibleStacks.Count)
{
return 0;
}
return _visibleStacks[slotId].itemId;
}
private List<ItemStack> CollectVisibleStacks()
{
List<ItemStack> visible = new List<ItemStack>();
if (_stacks == null)
{
return visible;
}
for (int i = 0; i < _stacks.Count; i++)
{
ItemStack stack = _stacks[i];
if (_filterType.HasValue)
{
ItemConfig config = GameEntry.Luban.Get<ItemConfig>(stack.itemId);
if (config == null || config.ItemType != _filterType.Value)
{
continue;
}
}
visible.Add(stack);
}
return visible;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0452e5e692a1e42118fa2097e6575eaa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -6,10 +6,15 @@ namespace SepCore.UI
[DisallowMultipleComponent] [DisallowMultipleComponent]
public partial class InventoryView : MonoBehaviour public partial class InventoryView : MonoBehaviour
{ {
[SerializeField] public global::UnityEngine.UI.Toggle allToggle;
[SerializeField] public global::UnityEngine.UI.Toggle lootToggle;
[SerializeField] public global::UnityEngine.UI.Toggle equipmentToggle;
[SerializeField] public global::UnityEngine.UI.Toggle consumablesToggle;
[SerializeField] public global::TMPro.TMP_InputField searchInput; [SerializeField] public global::TMPro.TMP_InputField searchInput;
[SerializeField] public global::UnityEngine.UI.Button sortButton; [SerializeField] public global::UnityEngine.UI.Button sortButton;
[SerializeField] public global::UnityEngine.UI.ScrollRect itemScroll; [SerializeField] public global::UnityEngine.UI.ScrollRect itemScroll;
[SerializeField] public global::UnityEngine.RectTransform warehouseSlotRoot; [SerializeField] public global::UnityEngine.RectTransform warehouseSlotRoot;
[SerializeField] public global::SepCore.UI.WarehouseSlotItem warehouseSlotTemplate; [SerializeField] public global::SepCore.UI.WarehouseSlotItem warehouseSlotTemplate;
[SerializeField] public global::SepCore.UI.FormatTextUI itemCountFormatText;
} }
} }
@@ -1,13 +0,0 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class InventoryPanelForm : UGuiForm
{
[SerializeField] private InventoryPanelView _view = null;
public InventoryPanelView View => _view;
}
}
@@ -1,16 +0,0 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class InventoryPanelView : MonoBehaviour
{
[SerializeField] public global::UnityEngine.UI.InputField searchInput;
[SerializeField] public global::UnityEngine.UI.Button sortButton;
[SerializeField] public global::UnityEngine.UI.ScrollRect itemScroll;
[SerializeField] public global::UnityEngine.RectTransform warehouseSlotRoot;
[SerializeField] public global::SepCore.UI.WarehouseSlotItem warehouseSlotTemplate;
[SerializeField] public global::UnityEngine.UI.Text itemCountText;
}
}
@@ -1,8 +1,8 @@
using System.Collections; using SepCore.Definition;
using System.Collections.Generic;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using UnityGameFramework.Runtime;
namespace SepCore.UI namespace SepCore.UI
{ {
@@ -11,10 +11,57 @@ namespace SepCore.UI
[SerializeField] private Image bg; [SerializeField] private Image bg;
[SerializeField] private Image icon; [SerializeField] private Image icon;
[SerializeField] private TextMeshProUGUI characterName; [SerializeField] private TextMeshProUGUI characterName;
[SerializeField] private TextMeshProUGUI hpText; [SerializeField] private FormatTextUI hpText;
[SerializeField] private TextMeshProUGUI mpText; [SerializeField] private FormatTextUI mpText;
[SerializeField] private TextMeshProUGUI speedText; [SerializeField] private FormatTextUI speedText;
[SerializeField] private TextMeshProUGUI atkText; [SerializeField] private FormatTextUI atkText;
[SerializeField] private TextMeshProUGUI matText; [SerializeField] private FormatTextUI matText;
/// <summary>
/// 用存档角色填充格子;角色配置不存在时按空格子显示。
/// </summary>
public void SetCharacter(CharacterSave save)
{
CharacterConfig config = GameEntry.Luban.Get<CharacterConfig>(save.characterId);
if (config == null)
{
Log.Warning("Can not find character config '{0}' for squad slot.", save.characterId);
SetEmpty();
return;
}
characterName.text = config.Name;
hpText.Set(config.MaxHp);
mpText.Set(config.MaxMp);
speedText.Set(config.Speed);
atkText.Set(config.Atk);
matText.Set(config.Mat);
HideIcon();
}
/// <summary>
/// 显示为空格子。
/// </summary>
public void SetEmpty()
{
characterName.text = string.Empty;
hpText.Clear();
mpText.Clear();
speedText.Clear();
atkText.Clear();
matText.Clear();
HideIcon();
}
private void HideIcon()
{
if (icon == null)
{
return;
}
icon.sprite = null;
icon.gameObject.SetActive(false);
}
} }
} }
@@ -1,15 +1,137 @@
using SepCore.Base;
using SepCore.Definition;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using UnityGameFramework.Runtime;
namespace SepCore.UI namespace SepCore.UI
{ {
public class WarehouseSlotItem : MonoBehaviour public class WarehouseSlotItem : MonoBehaviour
{ {
private static readonly Color RarityWhite = new Color32(245, 247, 248, 255);
private static readonly Color RarityGreen = new Color32(93, 155, 97, 255);
private static readonly Color RarityBlue = new Color32(52, 127, 168, 255);
private static readonly Color RarityGold = new Color32(214, 169, 61, 255);
private static readonly Color RarityRed = new Color32(185, 87, 79, 255);
private static readonly Color RarityEmpty = new Color32(111, 101, 90, 255);
private static readonly Color SelectedBgColor = new Color(0.86f, 0.95f, 1f, 1f);
[SerializeField] private Image bg; [SerializeField] private Image bg;
[SerializeField] private Button button; [SerializeField] private Button button;
[SerializeField] private Image icon; [SerializeField] private Image icon;
[SerializeField] private Image rarity; [SerializeField] private Image rarity;
[SerializeField] private TextMeshProUGUI quantityText; [SerializeField] private TextMeshProUGUI quantityText;
private int _slotId = 0;
private bool _filled = false;
private bool _clickBound = false;
/// <summary>
/// 设置格子在固定网格中的索引,点击事件以此作为唯一标识。
/// </summary>
public void SetSlotId(int slotId)
{
_slotId = slotId;
}
/// <summary>
/// 用物品堆叠填充格子;物品配置不存在时按空格子显示。
/// </summary>
public void SetItem(ItemStack stack)
{
ItemConfig config = GameEntry.Luban.Get<ItemConfig>(stack.itemId);
if (config == null)
{
Log.Warning("Can not find item config '{0}' for warehouse slot.", stack.itemId);
SetEmpty();
return;
}
_filled = true;
rarity.color = GetRarityColor(config.Rarity);
quantityText.text = stack.count.ToString();
HideIcon();
BindClick();
if (button != null)
{
button.interactable = true;
}
}
/// <summary>
/// 显示为空格子。
/// </summary>
public void SetEmpty()
{
_filled = false;
rarity.color = RarityEmpty;
quantityText.text = string.Empty;
HideIcon();
if (button != null)
{
button.interactable = false;
}
}
/// <summary>
/// 设置选中高亮。
/// </summary>
public void SetSelected(bool selected)
{
if (bg != null)
{
bg.color = selected ? SelectedBgColor : Color.white;
}
}
private void BindClick()
{
if (_clickBound || button == null)
{
return;
}
_clickBound = true;
button.onClick.AddListener(OnClick);
}
private void OnClick()
{
if (!_filled)
{
return;
}
GameEntry.Event.Fire(this, WarehouseSlotItemClickEventArgs.Create(_slotId));
}
private void HideIcon()
{
if (icon == null)
{
return;
}
icon.sprite = null;
icon.gameObject.SetActive(false);
}
private static Color GetRarityColor(Rarity rarity)
{
switch (rarity)
{
case Rarity.Green:
return RarityGreen;
case Rarity.Blue:
return RarityBlue;
case Rarity.Gold:
return RarityGold;
case Rarity.Red:
return RarityRed;
default:
return RarityWhite;
}
}
} }
} }
@@ -0,0 +1,136 @@
using SepCore.Definition;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace SepCore.UI
{
/// <summary>
/// 道具详情界面逻辑(手写 partial,与自动生成的 ItemDetailsForm.cs 合并)。
/// 只提供详情显示能力,由调用方(WarehouseForm)传入物品 ID 后刷新。
/// </summary>
public partial class ItemDetailsForm : UGuiForm
{
/// <summary>
/// 按物品 ID 刷新详情界面;配置不存在时清空显示。
/// </summary>
public void Refresh(int itemId)
{
ItemDetailsView view = View;
if (view == null)
{
Log.Warning("ItemDetailsForm view is not configured.");
return;
}
ItemConfig config = GameEntry.Luban.Get<ItemConfig>(itemId);
if (config == null)
{
Log.Warning("Can not find item config '{0}' for item details.", itemId);
ClearDetails(view);
return;
}
if (view.itemDetailNameText != null)
{
view.itemDetailNameText.text = config.Name;
}
if (view.itemDetailTypeText != null)
{
view.itemDetailTypeText.text = GetItemTypeName(config.ItemType) + " / " + GetRarityName(config.Rarity);
}
if (view.hpFormatText != null)
{
view.hpFormatText.Set(config.MaxHpBonus);
}
if (view.atkFormatText != null)
{
view.atkFormatText.Set(config.AtkBonus);
}
if (view.mpFormatText != null)
{
view.mpFormatText.Set(config.MaxMpBonus);
}
if (view.matFormatText != null)
{
view.matFormatText.Set(config.MatBonus);
}
if (view.speedFormatText != null)
{
view.speedFormatText.Set(0);
}
if (view.stackFormatText != null)
{
view.stackFormatText.Set(config.StackLimit);
}
if (view.itemDetailDescriptionText != null)
{
view.itemDetailDescriptionText.text = string.Empty;
}
if (view.itemDetailIcon != null)
{
view.itemDetailIcon.gameObject.SetActive(false);
}
}
private static void ClearDetails(ItemDetailsView view)
{
if (view.itemDetailNameText != null)
{
view.itemDetailNameText.text = string.Empty;
}
if (view.itemDetailTypeText != null)
{
view.itemDetailTypeText.text = string.Empty;
}
if (view.itemDetailDescriptionText != null)
{
view.itemDetailDescriptionText.text = string.Empty;
}
}
private static string GetItemTypeName(ItemType itemType)
{
switch (itemType)
{
case ItemType.Loot:
return "战利品";
case ItemType.Equipment:
return "装备";
case ItemType.Consumable:
return "消耗品";
default:
return "未知";
}
}
private static string GetRarityName(Rarity rarity)
{
switch (rarity)
{
case Rarity.White:
return "白";
case Rarity.Green:
return "绿";
case Rarity.Blue:
return "蓝";
case Rarity.Gold:
return "金";
case Rarity.Red:
return "红";
default:
return "无";
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 33d70aa8e73294a65b7b132a8a0619af
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -9,12 +9,12 @@ namespace SepCore.UI
[SerializeField] public global::UnityEngine.UI.Image itemDetailIcon; [SerializeField] public global::UnityEngine.UI.Image itemDetailIcon;
[SerializeField] public global::TMPro.TextMeshProUGUI itemDetailNameText; [SerializeField] public global::TMPro.TextMeshProUGUI itemDetailNameText;
[SerializeField] public global::TMPro.TextMeshProUGUI itemDetailTypeText; [SerializeField] public global::TMPro.TextMeshProUGUI itemDetailTypeText;
[SerializeField] public global::TMPro.TextMeshProUGUI hpText; [SerializeField] public global::SepCore.UI.FormatTextUI hpFormatText;
[SerializeField] public global::TMPro.TextMeshProUGUI atkText; [SerializeField] public global::SepCore.UI.FormatTextUI atkFormatText;
[SerializeField] public global::TMPro.TextMeshProUGUI mpText; [SerializeField] public global::SepCore.UI.FormatTextUI mpFormatText;
[SerializeField] public global::TMPro.TextMeshProUGUI matText; [SerializeField] public global::SepCore.UI.FormatTextUI matFormatText;
[SerializeField] public global::TMPro.TextMeshProUGUI speedText; [SerializeField] public global::SepCore.UI.FormatTextUI speedFormatText;
[SerializeField] public global::TMPro.TextMeshProUGUI stackText; [SerializeField] public global::SepCore.UI.FormatTextUI stackFormatText;
[SerializeField] public global::TMPro.TextMeshProUGUI itemDetailDescriptionText; [SerializeField] public global::TMPro.TextMeshProUGUI itemDetailDescriptionText;
[SerializeField] public global::UnityEngine.UI.Button openLoadoutButton; [SerializeField] public global::UnityEngine.UI.Button openLoadoutButton;
} }
@@ -1,13 +0,0 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class ItemDetailsPanelForm : UGuiForm
{
[SerializeField] private ItemDetailsPanelView _view = null;
public ItemDetailsPanelView View => _view;
}
}
@@ -1,20 +0,0 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class ItemDetailsPanelView : MonoBehaviour
{
[SerializeField] public global::UnityEngine.UI.Image itemDetailIcon;
[SerializeField] public global::UnityEngine.UI.Text nameText;
[SerializeField] public global::UnityEngine.UI.Text typeText;
[SerializeField] public global::UnityEngine.UI.Text hpText;
[SerializeField] public global::UnityEngine.UI.Text atkText;
[SerializeField] public global::UnityEngine.UI.Text mpText;
[SerializeField] public global::UnityEngine.UI.Text matText;
[SerializeField] public global::UnityEngine.UI.Text speedText;
[SerializeField] public global::UnityEngine.UI.Text stackText;
[SerializeField] public global::UnityEngine.UI.Button openLoadoutButton;
}
}
@@ -0,0 +1,153 @@
using DG.Tweening;
using SepCore.Definition;
using UnityEngine;
using UnityEngine.UI;
using UnityGameFramework.Runtime;
namespace SepCore.UI
{
/// <summary>
/// 大厅界面逻辑(手写 partial,与自动生成的 LobbyForm.cs 合并)。
/// 导航使用 Toggle + ToggleGroup 管理选中状态;本类只负责页面切换与标记动画。
/// </summary>
public partial class LobbyForm : UGuiForm
{
private const float SelectionMarkerMoveDuration = 0.25f;
private enum LobbyPage
{
CombatReadiness,
Warehouse,
}
protected override void OnInit(object userData)
{
base.OnInit(userData);
View.homeToggle.onValueChanged.AddListener(OnHomeToggleValueChanged);
View.warehouseToggle.onValueChanged.AddListener(OnWarehouseToggleValueChanged);
View.loadoutToggle.onValueChanged.AddListener(OnLoadoutToggleValueChanged);
}
protected override void OnOpen(object userData)
{
base.OnOpen(userData);
SwitchPage(LobbyPage.CombatReadiness, View.homeToggle);
}
protected override void OnClose(bool isShutdown, object userData)
{
if (View.selectionMarkerObject != null)
{
View.selectionMarkerObject.DOKill();
}
View.homeToggle.onValueChanged.RemoveListener(OnHomeToggleValueChanged);
View.warehouseToggle.onValueChanged.RemoveListener(OnWarehouseToggleValueChanged);
View.loadoutToggle.onValueChanged.RemoveListener(OnLoadoutToggleValueChanged);
base.OnClose(isShutdown, userData);
}
private void OnHomeToggleValueChanged(bool isOn)
{
if (isOn)
{
SwitchPage(LobbyPage.CombatReadiness, View.homeToggle);
}
}
private void OnWarehouseToggleValueChanged(bool isOn)
{
if (isOn)
{
SwitchPage(LobbyPage.Warehouse, View.warehouseToggle);
}
}
private void OnLoadoutToggleValueChanged(bool isOn)
{
// 战备页暂无对应界面,选中状态由 ToggleGroup 维护,仅预留切换入口
}
private void SwitchPage(LobbyPage page, Toggle activeToggle)
{
bool showCombatReadiness = page == LobbyPage.CombatReadiness;
bool showWarehouse = page == LobbyPage.Warehouse;
if (View.combatRandinessForm != null)
{
View.combatRandinessForm.gameObject.SetActive(showCombatReadiness);
}
if (View.warehouseForm != null)
{
View.warehouseForm.gameObject.SetActive(showWarehouse);
}
MoveSelectionMarker(activeToggle.transform as RectTransform);
if (showCombatReadiness)
{
RefreshCombatReadiness();
}
if (showWarehouse)
{
RefreshWarehouse();
}
}
private void MoveSelectionMarker(RectTransform targetToggle)
{
RectTransform marker = View.selectionMarkerObject;
if (marker == null || targetToggle == null || marker.parent == targetToggle)
{
return;
}
// 把标记相对目标 Toggle 锚点(anchorMin)的偏移,换算到 Toggle pivot 的局部坐标空间:
// 锚点相对 pivot 的偏移 = (anchor - pivot) * rect 尺寸。
Vector3 targetLocalPosition = new Vector3(
marker.anchoredPosition.x + (marker.anchorMin.x - targetToggle.pivot.x) * targetToggle.rect.width,
marker.anchoredPosition.y + (marker.anchorMin.y - targetToggle.pivot.y) * targetToggle.rect.height,
0f);
Vector3 targetWorldPosition = targetToggle.TransformPoint(targetLocalPosition);
marker.DOKill();
marker.DOMove(targetWorldPosition, SelectionMarkerMoveDuration)
.SetEase(Ease.OutCubic)
.OnComplete(() => marker.SetParent(targetToggle, true));
}
private void RefreshCombatReadiness()
{
CombatReadinessForm form = View.combatRandinessForm;
if (form == null)
{
Log.Warning("LobbyForm combat readiness form is not configured.");
return;
}
SaveData save = GameEntry.Save.Data;
if (save == null || form.View == null || form.View.squadForm == null)
{
Log.Warning("LobbyForm can not refresh combat readiness.");
return;
}
form.View.squadForm.RefreshCharacterList(save.characters);
}
private void RefreshWarehouse()
{
if (View.warehouseForm == null)
{
Log.Warning("LobbyForm warehouse form is not configured.");
return;
}
SaveData save = GameEntry.Save.Data;
View.warehouseForm.Refresh(save != null ? save.mainWarehouse : null);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9d236e85e2eab43f6904de56f9e5246d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -6,11 +6,11 @@ namespace SepCore.UI
[DisallowMultipleComponent] [DisallowMultipleComponent]
public partial class LobbyView : MonoBehaviour public partial class LobbyView : MonoBehaviour
{ {
[SerializeField] public global::UnityEngine.UI.Button homeButton; [SerializeField] public global::UnityEngine.UI.Toggle homeToggle;
[SerializeField] public global::UnityEngine.RectTransform selectionMarkerObject; [SerializeField] public global::UnityEngine.RectTransform selectionMarkerObject;
[SerializeField] public global::UnityEngine.UI.Button warehouseButton; [SerializeField] public global::UnityEngine.UI.Toggle warehouseToggle;
[SerializeField] public global::UnityEngine.UI.Button loadoutButton; [SerializeField] public global::UnityEngine.UI.Toggle loadoutToggle;
[SerializeField] public global::SepCore.UI.WarehouseView warehouseView; [SerializeField] public global::SepCore.UI.CombatReadinessForm combatRandinessForm;
[SerializeField] public global::SepCore.UI.CombatReadinessView combatRandinessView; [SerializeField] public global::SepCore.UI.WarehouseForm warehouseForm;
} }
} }
@@ -1,13 +0,0 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class MainWarehouseForm : UGuiForm
{
[SerializeField] private MainWarehouseView _view = null;
public MainWarehouseView View => _view;
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ca70f33fa4f2c4a989b89f280e24201a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,20 +0,0 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class MainWarehouseView : MonoBehaviour
{
[SerializeField] public global::UnityEngine.UI.Button homeButton;
[SerializeField] public global::UnityEngine.UI.Button warehouseButton;
[SerializeField] public global::UnityEngine.UI.Button loadoutButton;
[SerializeField] public global::UnityEngine.UI.InputField searchInput;
[SerializeField] public global::UnityEngine.UI.Button sortButton;
[SerializeField] public global::UnityEngine.UI.ScrollRect itemScroll;
[SerializeField] public global::UnityEngine.RectTransform warehouseSlotRoot;
[SerializeField] public global::SepCore.UI.WarehouseSlotItem warehouseSlotTemplate;
[SerializeField] public global::UnityEngine.UI.Text itemCountText;
[SerializeField] public global::SepCore.UI.ItemDetailsView itemDetailsView;
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: f169da115e10a47e4b0b3bfefaff0d71
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -6,6 +6,7 @@
"GUID:6055be8ebefd69e48b49212b09b47b2f", "GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:11ec41dbc3557e6499b2845ba531a9b0", "GUID:11ec41dbc3557e6499b2845ba531a9b0",
"GUID:363c5eb08ff8e6a439b85e37b8c20d96", "GUID:363c5eb08ff8e6a439b85e37b8c20d96",
"GUID:3bb549212964b4192b427888ac9382e7",
"GUID:f51ebe6a0ceec4240a699833d6309b23", "GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:d54b9488b03814a44ab937f0aeb738b1" "GUID:d54b9488b03814a44ab937f0aeb738b1"
], ],
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
namespace SepCore.UI namespace SepCore.UI
{ {
@@ -10,7 +11,7 @@ namespace SepCore.UI
public sealed class UISerializationRoot : MonoBehaviour public sealed class UISerializationRoot : MonoBehaviour
{ {
[Serializable] [Serializable]
public sealed class NestedViewReference public sealed class NestedFormReference
{ {
[SerializeField] private UISerializationRoot root; [SerializeField] private UISerializationRoot root;
[SerializeField] private bool generateReference; [SerializeField] private bool generateReference;
@@ -21,7 +22,7 @@ namespace SepCore.UI
public string VariableName => variableName; public string VariableName => variableName;
#if UNITY_EDITOR #if UNITY_EDITOR
internal NestedViewReference(UISerializationRoot nestedRoot, string defaultVariableName) internal NestedFormReference(UISerializationRoot nestedRoot, string defaultVariableName)
{ {
root = nestedRoot; root = nestedRoot;
generateReference = true; generateReference = true;
@@ -33,6 +34,19 @@ namespace SepCore.UI
generateReference = shouldGenerate; generateReference = shouldGenerate;
variableName = generatedVariableName; variableName = generatedVariableName;
} }
internal bool MigrateLegacyVariableName()
{
if (string.IsNullOrEmpty(variableName) ||
!variableName.EndsWith("View", StringComparison.Ordinal) ||
variableName.Length <= 4)
{
return false;
}
variableName = variableName.Substring(0, variableName.Length - 4) + "Form";
return true;
}
#endif #endif
} }
@@ -40,10 +54,11 @@ namespace SepCore.UI
private List<UISerializationItem> serializationItems = new List<UISerializationItem>(); private List<UISerializationItem> serializationItems = new List<UISerializationItem>();
[SerializeField, HideInInspector] [SerializeField, HideInInspector]
private List<NestedViewReference> nestedViewReferences = new List<NestedViewReference>(); [FormerlySerializedAs("nestedViewReferences")]
private List<NestedFormReference> nestedFormReferences = new List<NestedFormReference>();
public IReadOnlyList<UISerializationItem> SerializationItems => serializationItems; public IReadOnlyList<UISerializationItem> SerializationItems => serializationItems;
public IReadOnlyList<NestedViewReference> NestedViewReferences => nestedViewReferences; public IReadOnlyList<NestedFormReference> NestedFormReferences => nestedFormReferences;
#if UNITY_EDITOR #if UNITY_EDITOR
private bool refreshQueued; private bool refreshQueued;
@@ -76,8 +91,18 @@ namespace SepCore.UI
} }
bool itemsChanged = !HasSameItems(ownedItems); bool itemsChanged = !HasSameItems(ownedItems);
bool nestedViewsChanged = !HasSameNestedViews(directNestedRoots); bool nestedFormsChanged = !HasSameNestedForms(directNestedRoots);
if (!itemsChanged && !nestedViewsChanged) bool nestedNamesChanged = false;
for (int i = 0; i < directNestedRoots.Count; i++)
{
NestedFormReference existing = FindNestedForm(directNestedRoots[i]);
if (existing != null)
{
nestedNamesChanged |= existing.MigrateLegacyVariableName();
}
}
if (!itemsChanged && !nestedFormsChanged && !nestedNamesChanged)
{ {
return false; return false;
} }
@@ -88,24 +113,24 @@ namespace SepCore.UI
serializationItems.AddRange(ownedItems); serializationItems.AddRange(ownedItems);
} }
if (nestedViewsChanged) if (nestedFormsChanged)
{ {
var next = new List<NestedViewReference>(directNestedRoots.Count); var next = new List<NestedFormReference>(directNestedRoots.Count);
for (int i = 0; i < directNestedRoots.Count; i++) for (int i = 0; i < directNestedRoots.Count; i++)
{ {
UISerializationRoot nestedRoot = directNestedRoots[i]; UISerializationRoot nestedRoot = directNestedRoots[i];
NestedViewReference existing = FindNestedView(nestedRoot); NestedFormReference existing = FindNestedForm(nestedRoot);
next.Add(existing ?? new NestedViewReference(nestedRoot, CreateDefaultNestedViewVariableName(nestedRoot))); next.Add(existing ?? new NestedFormReference(nestedRoot, CreateDefaultNestedFormVariableName(nestedRoot)));
} }
nestedViewReferences = next; nestedFormReferences = next;
} }
UnityEditor.EditorUtility.SetDirty(this); UnityEditor.EditorUtility.SetDirty(this);
return true; return true;
} }
public bool SetNestedViewReference(UISerializationRoot nestedRoot, bool shouldGenerate, string variableName) public bool SetNestedFormReference(UISerializationRoot nestedRoot, bool shouldGenerate, string variableName)
{ {
if (nestedRoot == null || FindNearestParentRoot(nestedRoot.transform) != this) if (nestedRoot == null || FindNearestParentRoot(nestedRoot.transform) != this)
{ {
@@ -113,7 +138,7 @@ namespace SepCore.UI
} }
RefreshItems(); RefreshItems();
NestedViewReference reference = FindNestedView(nestedRoot); NestedFormReference reference = FindNestedForm(nestedRoot);
if (reference == null) if (reference == null)
{ {
throw new InvalidOperationException("The nested root is not registered."); throw new InvalidOperationException("The nested root is not registered.");
@@ -130,7 +155,7 @@ namespace SepCore.UI
return true; return true;
} }
public static string CreateDefaultNestedViewVariableName(UISerializationRoot nestedRoot) public static string CreateDefaultNestedFormVariableName(UISerializationRoot nestedRoot)
{ {
string sourceName = nestedRoot == null ? "nested" : nestedRoot.gameObject.name.Replace("(Clone)", string.Empty).Trim(); string sourceName = nestedRoot == null ? "nested" : nestedRoot.gameObject.name.Replace("(Clone)", string.Empty).Trim();
if (sourceName.EndsWith("Form", StringComparison.Ordinal) && sourceName.Length > 4) if (sourceName.EndsWith("Form", StringComparison.Ordinal) && sourceName.Length > 4)
@@ -148,7 +173,7 @@ namespace SepCore.UI
identifier = "Nested"; identifier = "Nested";
} }
return char.ToLowerInvariant(identifier[0]) + identifier.Substring(1) + "View"; return char.ToLowerInvariant(identifier[0]) + identifier.Substring(1) + "Form";
} }
internal void QueueRefresh() internal void QueueRefresh()
@@ -220,16 +245,16 @@ namespace SepCore.UI
return true; return true;
} }
private bool HasSameNestedViews(List<UISerializationRoot> found) private bool HasSameNestedForms(List<UISerializationRoot> found)
{ {
if (nestedViewReferences.Count != found.Count) if (nestedFormReferences.Count != found.Count)
{ {
return false; return false;
} }
for (int i = 0; i < found.Count; i++) for (int i = 0; i < found.Count; i++)
{ {
if (nestedViewReferences[i] == null || nestedViewReferences[i].Root != found[i]) if (nestedFormReferences[i] == null || nestedFormReferences[i].Root != found[i])
{ {
return false; return false;
} }
@@ -238,11 +263,11 @@ namespace SepCore.UI
return true; return true;
} }
private NestedViewReference FindNestedView(UISerializationRoot nestedRoot) private NestedFormReference FindNestedForm(UISerializationRoot nestedRoot)
{ {
for (int i = 0; i < nestedViewReferences.Count; i++) for (int i = 0; i < nestedFormReferences.Count; i++)
{ {
NestedViewReference reference = nestedViewReferences[i]; NestedFormReference reference = nestedFormReferences[i];
if (reference != null && reference.Root == nestedRoot) if (reference != null && reference.Root == nestedRoot)
{ {
return reference; return reference;
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 82e9f2ea2a9254e848f8afcf5ff556e9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,50 @@
using System.Collections.Generic;
using SepCore.Definition;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace SepCore.UI
{
/// <summary>
/// 编队界面逻辑(手写 partial,与自动生成的 SquadForm.cs 合并)。
/// 以传入的角色列表重建角色槽列表,模板槽来自 SquadView.characterSlotTemplate。
/// </summary>
public partial class SquadForm : UGuiForm
{
/// <summary>
/// 按传入的角色列表重建角色槽列表 UI,每名角色一个槽位。
/// </summary>
public void RefreshCharacterList(IReadOnlyList<CharacterSave> characters)
{
SquadView squadView = View;
if (squadView == null || squadView.characterSlotRoot == null ||
squadView.characterSlotTemplate == null)
{
Log.Warning("SquadForm is not fully configured.");
return;
}
CharacterSlotItem template = squadView.characterSlotTemplate;
template.gameObject.SetActive(false);
for (int i = squadView.characterSlotRoot.childCount - 1; i >= 0; i--)
{
Transform child = squadView.characterSlotRoot.GetChild(i);
if (child == template.transform)
{
continue;
}
Destroy(child.gameObject);
}
int characterCount = characters != null ? characters.Count : 0;
for (int i = 0; i < characterCount; i++)
{
CharacterSlotItem slot = Instantiate(template, squadView.characterSlotRoot);
slot.gameObject.SetActive(true);
slot.SetCharacter(characters[i]);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2a629f39601d3456ca1a8228059fa845
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,13 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class SquadForm : UGuiForm
{
[SerializeField] private SquadView _view = null;
public SquadView View => _view;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c6542ec01d550457587508eff74a6957
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,13 @@
// <auto-generated />
using UnityEngine;
namespace SepCore.UI
{
[DisallowMultipleComponent]
public partial class SquadView : MonoBehaviour
{
[SerializeField] public global::TMPro.TextMeshProUGUI squadMemberText;
[SerializeField] public global::UnityEngine.RectTransform characterSlotRoot;
[SerializeField] public global::SepCore.UI.CharacterSlotItem characterSlotTemplate;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6eacd1573559d4784862ed9c21d5928c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,73 @@
using System.Collections.Generic;
using GameFramework.Event;
using SepCore.Base;
using SepCore.Definition;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace SepCore.UI
{
/// <summary>
/// 主仓库界面逻辑(手写 partial,与自动生成的 WarehouseForm.cs 合并)。
/// 只提供仓库界面能力,数据由调用方(LobbyForm)传入;
/// 监听格子点击事件,驱动选中高亮与详情界面刷新。
/// 注意:本表单作为嵌套表单使用,UGF 生命周期不会被框架调用,
/// 事件订阅改为幂等式(EnsureEventBound)。
/// </summary>
public partial class WarehouseForm : UGuiForm
{
private bool _eventBound = false;
/// <summary>
/// 用主仓库内容刷新整个仓库界面(物品列表)。
/// </summary>
public void Refresh(IReadOnlyList<ItemStack> stacks)
{
EnsureEventBound();
InventoryForm inventoryForm = View.inventoryPanelForm;
if (inventoryForm == null)
{
Log.Warning("WarehouseForm inventory panel form is not configured.");
return;
}
inventoryForm.RefreshList(stacks);
}
private void EnsureEventBound()
{
if (_eventBound)
{
return;
}
_eventBound = true;
GameEntry.Event.Subscribe(WarehouseSlotItemClickEventArgs.EventId, OnWarehouseSlotItemClick);
}
private void OnWarehouseSlotItemClick(object sender, GameEventArgs e)
{
if (this == null)
{
return;
}
WarehouseSlotItemClickEventArgs ne = (WarehouseSlotItemClickEventArgs)e;
int slotId = ne.SlotId;
if (View.inventoryPanelForm == null)
{
return;
}
View.inventoryPanelForm.SetSelectedSlot(slotId);
int itemId = View.inventoryPanelForm.GetItemIdAtSlot(slotId);
if (itemId != 0 && View.itemDetailsPanelForm != null)
{
View.itemDetailsPanelForm.Refresh(itemId);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: be961300f50004e35ad24b4ff3368124
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -6,7 +6,7 @@ namespace SepCore.UI
[DisallowMultipleComponent] [DisallowMultipleComponent]
public partial class WarehouseView : MonoBehaviour public partial class WarehouseView : MonoBehaviour
{ {
[SerializeField] public global::SepCore.UI.InventoryView inventoryPanelView; [SerializeField] public global::SepCore.UI.InventoryForm inventoryPanelForm;
[SerializeField] public global::SepCore.UI.ItemDetailsView itemDetailsPanelView; [SerializeField] public global::SepCore.UI.ItemDetailsForm itemDetailsPanelForm;
} }
} }
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3967ecc2a5e5e483d96793002e69e45a guid: 2bc089bd516724d7e8f92a5db52ac215
PrefabImporter: PrefabImporter:
externalObjects: {} externalObjects: {}
userData: userData:
+138 -8
View File
@@ -421,7 +421,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: EQUIP m_text: EQUIPMENT
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -735,6 +735,7 @@ GameObject:
- component: {fileID: 3656593655061787957} - component: {fileID: 3656593655061787957}
- component: {fileID: 3684668006342424164} - component: {fileID: 3684668006342424164}
- component: {fileID: 504874783008793949} - component: {fileID: 504874783008793949}
- component: {fileID: 6885981868550451195}
m_Layer: 5 m_Layer: 5
m_Name: ALLToggle m_Name: ALLToggle
m_TagString: Untagged m_TagString: Untagged
@@ -849,6 +850,31 @@ MonoBehaviour:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_IsOn: 1 m_IsOn: 1
--- !u!114 &6885981868550451195
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2012170800474657973}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fbaa237e23f7d4d3f85f73e0acd7eaec, type: 3}
m_Name:
m_EditorClassIdentifier:
componentReferences:
- component: {fileID: 2298792640519324320}
generateReference: 0
variableName: aLLToggleRectTransform
- component: {fileID: 3656593655061787957}
generateReference: 0
variableName: aLLToggleCanvasRenderer
- component: {fileID: 3684668006342424164}
generateReference: 0
variableName: aLLToggleImage
- component: {fileID: 504874783008793949}
generateReference: 1
variableName: allToggle
--- !u!1 &2410182165023352697 --- !u!1 &2410182165023352697
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1070,6 +1096,7 @@ GameObject:
- component: {fileID: 2182984371689212479} - component: {fileID: 2182984371689212479}
- component: {fileID: 719600398423519262} - component: {fileID: 719600398423519262}
- component: {fileID: 6987671810978141194} - component: {fileID: 6987671810978141194}
- component: {fileID: 4515486992900572179}
m_Layer: 5 m_Layer: 5
m_Name: CONSUMABLESToggle m_Name: CONSUMABLESToggle
m_TagString: Untagged m_TagString: Untagged
@@ -1184,6 +1211,31 @@ MonoBehaviour:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_IsOn: 0 m_IsOn: 0
--- !u!114 &4515486992900572179
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2426015379712864977}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fbaa237e23f7d4d3f85f73e0acd7eaec, type: 3}
m_Name:
m_EditorClassIdentifier:
componentReferences:
- component: {fileID: 3568616283438071469}
generateReference: 0
variableName: cONSUMABLESToggleRectTransform
- component: {fileID: 2182984371689212479}
generateReference: 0
variableName: cONSUMABLESToggleCanvasRenderer
- component: {fileID: 719600398423519262}
generateReference: 0
variableName: cONSUMABLESToggleImage
- component: {fileID: 6987671810978141194}
generateReference: 1
variableName: consumablesToggle
--- !u!1 &2543501261547435484 --- !u!1 &2543501261547435484
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1196,6 +1248,7 @@ GameObject:
- component: {fileID: 2336508420346240422} - component: {fileID: 2336508420346240422}
- component: {fileID: 3388294236041124274} - component: {fileID: 3388294236041124274}
- component: {fileID: 5193004823020364787} - component: {fileID: 5193004823020364787}
- component: {fileID: 1784370410967477645}
m_Layer: 5 m_Layer: 5
m_Name: EQUIPMENTToggle m_Name: EQUIPMENTToggle
m_TagString: Untagged m_TagString: Untagged
@@ -1310,6 +1363,31 @@ MonoBehaviour:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_IsOn: 0 m_IsOn: 0
--- !u!114 &1784370410967477645
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2543501261547435484}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fbaa237e23f7d4d3f85f73e0acd7eaec, type: 3}
m_Name:
m_EditorClassIdentifier:
componentReferences:
- component: {fileID: 3024079498947618077}
generateReference: 0
variableName: eQUIPMENTToggleRectTransform
- component: {fileID: 2336508420346240422}
generateReference: 0
variableName: eQUIPMENTToggleCanvasRenderer
- component: {fileID: 3388294236041124274}
generateReference: 0
variableName: eQUIPMENTToggleImage
- component: {fileID: 5193004823020364787}
generateReference: 1
variableName: equipmentToggle
--- !u!1 &3167783107560700122 --- !u!1 &3167783107560700122
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1781,13 +1859,17 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
serializationItems: serializationItems:
- {fileID: 6885981868550451195}
- {fileID: 4267461878544293663}
- {fileID: 1784370410967477645}
- {fileID: 4515486992900572179}
- {fileID: 5400367523979904803} - {fileID: 5400367523979904803}
- {fileID: 4599698513164821803} - {fileID: 4599698513164821803}
- {fileID: 4303123679870252390} - {fileID: 4303123679870252390}
- {fileID: 8026264669779571601} - {fileID: 8026264669779571601}
- {fileID: 6133147552744604971} - {fileID: 6133147552744604971}
- {fileID: 98987023799537546} - {fileID: 98987023799537546}
nestedViewReferences: [] nestedFormReferences: []
--- !u!114 &7335061425003396699 --- !u!114 &7335061425003396699
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1800,11 +1882,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 21f832ef1e5da4b37b7754cca1ebf511, type: 3} m_Script: {fileID: 11500000, guid: 21f832ef1e5da4b37b7754cca1ebf511, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
allToggle: {fileID: 504874783008793949}
lootToggle: {fileID: 4081444737083515221}
equipmentToggle: {fileID: 5193004823020364787}
consumablesToggle: {fileID: 6987671810978141194}
searchInput: {fileID: 7413549355584395135} searchInput: {fileID: 7413549355584395135}
sortButton: {fileID: 6494309994204566134} sortButton: {fileID: 6494309994204566134}
itemScroll: {fileID: 5333695047041429650} itemScroll: {fileID: 5333695047041429650}
warehouseSlotRoot: {fileID: 1154235044148803502} warehouseSlotRoot: {fileID: 1154235044148803502}
warehouseSlotTemplate: {fileID: 6835793265045693105} warehouseSlotTemplate: {fileID: 6835793265045693105}
itemCountFormatText: {fileID: 2683871990378197878}
--- !u!114 &2133127681736051842 --- !u!114 &2133127681736051842
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -2140,7 +2227,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 60, y: -30} m_AnchoredPosition: {x: 75, y: -30}
m_SizeDelta: {x: 650, y: 120} m_SizeDelta: {x: 650, y: 120}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!114 &4294156976037642761 --- !u!114 &4294156976037642761
@@ -2603,6 +2690,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 7852236294564041691} - component: {fileID: 7852236294564041691}
- component: {fileID: 3699701487496305451} - component: {fileID: 3699701487496305451}
- component: {fileID: 2683871990378197878}
- component: {fileID: 98987023799537546} - component: {fileID: 98987023799537546}
- component: {fileID: 5416459995294760792} - component: {fileID: 5416459995294760792}
m_Layer: 5 m_Layer: 5
@@ -2628,8 +2716,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 34, y: 25} m_AnchoredPosition: {x: 50, y: 20}
m_SizeDelta: {x: 400, y: 34} m_SizeDelta: {x: 800, y: 40}
m_Pivot: {x: 0, y: 0} m_Pivot: {x: 0, y: 0}
--- !u!222 &3699701487496305451 --- !u!222 &3699701487496305451
CanvasRenderer: CanvasRenderer:
@@ -2639,6 +2727,19 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7044390149887422498} m_GameObject: {fileID: 7044390149887422498}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &2683871990378197878
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7044390149887422498}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6566a3a7cfd184008ab2282feea295f8, type: 3}
m_Name:
m_EditorClassIdentifier:
key: WarehouseCapacity
--- !u!114 &98987023799537546 --- !u!114 &98987023799537546
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -2658,6 +2759,9 @@ MonoBehaviour:
- component: {fileID: 3699701487496305451} - component: {fileID: 3699701487496305451}
generateReference: 0 generateReference: 0
variableName: itemCountCanvasRenderer variableName: itemCountCanvasRenderer
- component: {fileID: 2683871990378197878}
generateReference: 1
variableName: itemCountFormatText
- component: {fileID: 5416459995294760792} - component: {fileID: 5416459995294760792}
generateReference: 0 generateReference: 0
variableName: itemCountTextMeshProUGUI variableName: itemCountTextMeshProUGUI
@@ -2708,8 +2812,8 @@ MonoBehaviour:
m_faceColor: m_faceColor:
serializedVersion: 2 serializedVersion: 2
rgba: 4294967295 rgba: 4294967295
m_fontSize: 15 m_fontSize: 35
m_fontSizeBase: 15 m_fontSizeBase: 35
m_fontWeight: 400 m_fontWeight: 400
m_enableAutoSizing: 0 m_enableAutoSizing: 0
m_fontSizeMin: 18 m_fontSizeMin: 18
@@ -2949,7 +3053,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: CONSUMPTION m_text: CONSUMABLES
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -3030,6 +3134,7 @@ GameObject:
- component: {fileID: 3485495474144447458} - component: {fileID: 3485495474144447458}
- component: {fileID: 4091653412659532661} - component: {fileID: 4091653412659532661}
- component: {fileID: 4081444737083515221} - component: {fileID: 4081444737083515221}
- component: {fileID: 4267461878544293663}
m_Layer: 5 m_Layer: 5
m_Name: LOOTToggle m_Name: LOOTToggle
m_TagString: Untagged m_TagString: Untagged
@@ -3144,6 +3249,31 @@ MonoBehaviour:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_IsOn: 0 m_IsOn: 0
--- !u!114 &4267461878544293663
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8263617262501264373}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fbaa237e23f7d4d3f85f73e0acd7eaec, type: 3}
m_Name:
m_EditorClassIdentifier:
componentReferences:
- component: {fileID: 368081548635187151}
generateReference: 0
variableName: lOOTToggleRectTransform
- component: {fileID: 3485495474144447458}
generateReference: 0
variableName: lOOTToggleCanvasRenderer
- component: {fileID: 4091653412659532661}
generateReference: 0
variableName: lOOTToggleImage
- component: {fileID: 4081444737083515221}
generateReference: 1
variableName: lootToggle
--- !u!1 &8965387801132203254 --- !u!1 &8965387801132203254
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
+117 -15
View File
@@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 5179022712709264515} - component: {fileID: 5179022712709264515}
- component: {fileID: 4603291131071082870} - component: {fileID: 4603291131071082870}
- component: {fileID: 5541957776722386631} - component: {fileID: 5541957776722386631}
- component: {fileID: 4259690326048787537}
- component: {fileID: 6268341800112226897} - component: {fileID: 6268341800112226897}
m_Layer: 5 m_Layer: 5
m_Name: HP m_Name: HP
@@ -65,9 +66,25 @@ MonoBehaviour:
- component: {fileID: 4603291131071082870} - component: {fileID: 4603291131071082870}
generateReference: 0 generateReference: 0
variableName: heathPointCanvasRenderer variableName: heathPointCanvasRenderer
- component: {fileID: 6268341800112226897} - component: {fileID: 4259690326048787537}
generateReference: 1 generateReference: 1
variableName: hpFormatText
- component: {fileID: 6268341800112226897}
generateReference: 0
variableName: hpText variableName: hpText
--- !u!114 &4259690326048787537
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1392386864867888504}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6566a3a7cfd184008ab2282feea295f8, type: 3}
m_Name:
m_EditorClassIdentifier:
key: HPFormatText
--- !u!114 &6268341800112226897 --- !u!114 &6268341800112226897
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -629,6 +646,7 @@ GameObject:
- component: {fileID: 6890729440302644792} - component: {fileID: 6890729440302644792}
- component: {fileID: 4466095812049553661} - component: {fileID: 4466095812049553661}
- component: {fileID: 5082129055875375218} - component: {fileID: 5082129055875375218}
- component: {fileID: 4475856547401226535}
m_Layer: 5 m_Layer: 5
m_Name: Speed m_Name: Speed
m_TagString: Untagged m_TagString: Untagged
@@ -683,8 +701,11 @@ MonoBehaviour:
generateReference: 0 generateReference: 0
variableName: speedCanvasRenderer variableName: speedCanvasRenderer
- component: {fileID: 5082129055875375218} - component: {fileID: 5082129055875375218}
generateReference: 1 generateReference: 0
variableName: speedText variableName: speedText
- component: {fileID: 4475856547401226535}
generateReference: 1
variableName: speedFormatText
--- !u!114 &5082129055875375218 --- !u!114 &5082129055875375218
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -774,6 +795,19 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &4475856547401226535
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5554656631130595777}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6566a3a7cfd184008ab2282feea295f8, type: 3}
m_Name:
m_EditorClassIdentifier:
key: SPDFormatText
--- !u!1 &5636577195360049716 --- !u!1 &5636577195360049716
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -943,6 +977,7 @@ GameObject:
- component: {fileID: 3429655475238369945} - component: {fileID: 3429655475238369945}
- component: {fileID: 1457266653204841066} - component: {fileID: 1457266653204841066}
- component: {fileID: 7199095014524234339} - component: {fileID: 7199095014524234339}
- component: {fileID: 5602765551548898199}
m_Layer: 5 m_Layer: 5
m_Name: MP m_Name: MP
m_TagString: Untagged m_TagString: Untagged
@@ -997,8 +1032,11 @@ MonoBehaviour:
generateReference: 0 generateReference: 0
variableName: magicPointCanvasRenderer variableName: magicPointCanvasRenderer
- component: {fileID: 7199095014524234339} - component: {fileID: 7199095014524234339}
generateReference: 1 generateReference: 0
variableName: mpText variableName: mpText
- component: {fileID: 5602765551548898199}
generateReference: 1
variableName: mpFormatText
--- !u!114 &7199095014524234339 --- !u!114 &7199095014524234339
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1088,6 +1126,19 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &5602765551548898199
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5800884976147209719}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6566a3a7cfd184008ab2282feea295f8, type: 3}
m_Name:
m_EditorClassIdentifier:
key: MPFormatText
--- !u!1 &5872508313271883114 --- !u!1 &5872508313271883114
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1176,6 +1227,7 @@ GameObject:
- component: {fileID: 7750730488031471318} - component: {fileID: 7750730488031471318}
- component: {fileID: 3521877656451895179} - component: {fileID: 3521877656451895179}
- component: {fileID: 2364253565218914047} - component: {fileID: 2364253565218914047}
- component: {fileID: 8645169386155287837}
m_Layer: 5 m_Layer: 5
m_Name: ATK m_Name: ATK
m_TagString: Untagged m_TagString: Untagged
@@ -1230,8 +1282,11 @@ MonoBehaviour:
generateReference: 0 generateReference: 0
variableName: attackCanvasRenderer variableName: attackCanvasRenderer
- component: {fileID: 2364253565218914047} - component: {fileID: 2364253565218914047}
generateReference: 1 generateReference: 0
variableName: atkText variableName: atkText
- component: {fileID: 8645169386155287837}
generateReference: 1
variableName: atkFormatText
--- !u!114 &2364253565218914047 --- !u!114 &2364253565218914047
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1321,6 +1376,19 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &8645169386155287837
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6274480402889662601}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6566a3a7cfd184008ab2282feea295f8, type: 3}
m_Name:
m_EditorClassIdentifier:
key: ATKFormatText
--- !u!1 &7684641432980518872 --- !u!1 &7684641432980518872
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1490,6 +1558,7 @@ GameObject:
- component: {fileID: 705417353461791088} - component: {fileID: 705417353461791088}
- component: {fileID: 4612983467342126493} - component: {fileID: 4612983467342126493}
- component: {fileID: 331733076104099108} - component: {fileID: 331733076104099108}
- component: {fileID: 9129851160542363978}
m_Layer: 5 m_Layer: 5
m_Name: Stack m_Name: Stack
m_TagString: Untagged m_TagString: Untagged
@@ -1544,8 +1613,11 @@ MonoBehaviour:
generateReference: 0 generateReference: 0
variableName: stackCanvasRenderer variableName: stackCanvasRenderer
- component: {fileID: 331733076104099108} - component: {fileID: 331733076104099108}
generateReference: 1 generateReference: 0
variableName: stackText variableName: stackText
- component: {fileID: 9129851160542363978}
generateReference: 1
variableName: stackFormatText
--- !u!114 &331733076104099108 --- !u!114 &331733076104099108
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1635,6 +1707,19 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &9129851160542363978
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7729281776506686622}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6566a3a7cfd184008ab2282feea295f8, type: 3}
m_Name:
m_EditorClassIdentifier:
key: STAFormatText
--- !u!1 &8073443572417232674 --- !u!1 &8073443572417232674
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1709,8 +1794,8 @@ MonoBehaviour:
m_fontMaterials: [] m_fontMaterials: []
m_fontColor32: m_fontColor32:
serializedVersion: 2 serializedVersion: 2
rgba: 4284114287 rgba: 4280625710
m_fontColor: {r: 0.43529412, g: 0.39607844, b: 0.3529412, a: 1} m_fontColor: {r: 0.18039216, g: 0.16470589, b: 0.14509805, a: 1}
m_enableVertexGradient: 0 m_enableVertexGradient: 0
m_colorMode: 3 m_colorMode: 3
m_fontColorGradient: m_fontColorGradient:
@@ -1878,7 +1963,7 @@ MonoBehaviour:
- {fileID: 4612983467342126493} - {fileID: 4612983467342126493}
- {fileID: 2182994179005144283} - {fileID: 2182994179005144283}
- {fileID: 4333080805884545520} - {fileID: 4333080805884545520}
nestedViewReferences: [] nestedFormReferences: []
--- !u!114 &4503514465556614152 --- !u!114 &4503514465556614152
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1894,12 +1979,12 @@ MonoBehaviour:
itemDetailIcon: {fileID: 8440454067056108592} itemDetailIcon: {fileID: 8440454067056108592}
itemDetailNameText: {fileID: 8200098793786560031} itemDetailNameText: {fileID: 8200098793786560031}
itemDetailTypeText: {fileID: 295651969101943419} itemDetailTypeText: {fileID: 295651969101943419}
hpText: {fileID: 6268341800112226897} hpFormatText: {fileID: 4259690326048787537}
atkText: {fileID: 2364253565218914047} atkFormatText: {fileID: 8645169386155287837}
mpText: {fileID: 7199095014524234339} mpFormatText: {fileID: 5602765551548898199}
matText: {fileID: 2968830829387071799} matFormatText: {fileID: 6462182073069543566}
speedText: {fileID: 5082129055875375218} speedFormatText: {fileID: 4475856547401226535}
stackText: {fileID: 331733076104099108} stackFormatText: {fileID: 9129851160542363978}
itemDetailDescriptionText: {fileID: 6763892873351540802} itemDetailDescriptionText: {fileID: 6763892873351540802}
openLoadoutButton: {fileID: 7433963947553117608} openLoadoutButton: {fileID: 7433963947553117608}
--- !u!114 &1610184350966444607 --- !u!114 &1610184350966444607
@@ -1927,6 +2012,7 @@ GameObject:
- component: {fileID: 3541554982253813617} - component: {fileID: 3541554982253813617}
- component: {fileID: 7409970750903276901} - component: {fileID: 7409970750903276901}
- component: {fileID: 2968830829387071799} - component: {fileID: 2968830829387071799}
- component: {fileID: 6462182073069543566}
m_Layer: 5 m_Layer: 5
m_Name: MAT m_Name: MAT
m_TagString: Untagged m_TagString: Untagged
@@ -1981,8 +2067,11 @@ MonoBehaviour:
generateReference: 0 generateReference: 0
variableName: magicAttackCanvasRenderer variableName: magicAttackCanvasRenderer
- component: {fileID: 2968830829387071799} - component: {fileID: 2968830829387071799}
generateReference: 1 generateReference: 0
variableName: matText variableName: matText
- component: {fileID: 6462182073069543566}
generateReference: 1
variableName: matFormatText
--- !u!114 &2968830829387071799 --- !u!114 &2968830829387071799
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -2072,6 +2161,19 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &6462182073069543566
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8759673320674337342}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6566a3a7cfd184008ab2282feea295f8, type: 3}
m_Name:
m_EditorClassIdentifier:
key: MATFormatText
--- !u!1 &9038971682702625884 --- !u!1 &9038971682702625884
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

Some files were not shown because too many files have changed in this diff Show More