feat: Add SkillModule and WeaponModule for managing skills and weapons
- Implemented SkillModule to manage FormSkillSO assets with a detailed UI for editing and displaying skill properties. - Implemented WeaponModule to manage WeaponSO assets with a detailed UI for editing and displaying weapon properties. - Created AssetOperations class for centralized CRUD operations on ScriptableObject assets, including create, rename, delete, and clone functionalities. - Added DetailHeader for displaying and renaming asset names in the UI. - Introduced SoListPane for a reusable ScriptableObject list panel with search functionality and context menus. - Added meta files for all new scripts to ensure proper asset management in Unity.
This commit is contained in:
28
Assets/_Game/Scripts/Editor/Hub/IDataModule.cs
Normal file
28
Assets/_Game/Scripts/Editor/Hub/IDataModule.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace BaseGames.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据模块接口 —— DataHubWindow 中每个资产管理标签页实现此接口。
|
||||
/// </summary>
|
||||
public interface IDataModule
|
||||
{
|
||||
string ModuleId { get; } // 持久化 EditorPrefs 用唯一 key
|
||||
string DisplayName { get; } // 导航侧边栏显示名称
|
||||
string IconName { get; } // Unity 内置图标名 or null
|
||||
|
||||
/// <summary>初始化模块,加载数据(首次激活时调用一次)。</summary>
|
||||
void Initialize();
|
||||
|
||||
/// <summary>构建列表区内容,onSelected 在选中资产时由模块调用。</summary>
|
||||
void BuildListPane(VisualElement container, Action<UnityEngine.Object> onSelected);
|
||||
|
||||
/// <summary>构建详情区内容,selected 为当前选中资产(可为 null)。</summary>
|
||||
void BuildDetailPane(VisualElement container, UnityEngine.Object selected);
|
||||
|
||||
/// <summary>切换到本模块时调用,可用于刷新数据。</summary>
|
||||
void OnActivated();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user