多轮审查和修复

This commit is contained in:
2026-05-12 15:34:08 +08:00
parent f55d2a57c3
commit ebbbb7332e
805 changed files with 838724 additions and 1905 deletions

View File

@@ -0,0 +1,25 @@
using UnityEngine;
namespace BaseGames.Equipment
{
/// <summary>
/// 工具目录 SO。
/// 全局唯一资产Assets/Data/Equipment/ToolCatalog.asset
/// 通过 toolId 查找 ToolSO 引用。
/// 由 ToolSlotManager 在 OnLoad 时查询以恢复槽位工具引用。
/// </summary>
[CreateAssetMenu(menuName = "Equipment/ToolCatalog")]
public class ToolCatalogSO : ScriptableObject
{
[SerializeField] private ToolSO[] _tools;
/// <summary>按 toolId 查找工具,找不到返回 null。</summary>
public ToolSO Find(string toolId)
{
if (_tools == null || string.IsNullOrEmpty(toolId)) return null;
foreach (var tool in _tools)
if (tool != null && tool.toolId == toolId) return tool;
return null;
}
}
}