diff --git a/Assets/_Game/Data/Player/Weapons/Weapon_DiHun.asset b/Assets/_Game/Data/Combat/Weapons/WPN_New.asset
similarity index 99%
rename from Assets/_Game/Data/Player/Weapons/Weapon_DiHun.asset
rename to Assets/_Game/Data/Combat/Weapons/WPN_New.asset
index 229e116..03b8473 100644
--- a/Assets/_Game/Data/Player/Weapons/Weapon_DiHun.asset
+++ b/Assets/_Game/Data/Combat/Weapons/WPN_New.asset
@@ -10,7 +10,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d2443d04d1c179d4d8a4f36e7ca7156e, type: 3}
- m_Name: Weapon_DiHun
+ m_Name: WPN_New
m_EditorClassIdentifier:
weaponId:
displayName:
diff --git a/Assets/_Game/Data/Player/Weapons/Weapon_TianHun.asset.meta b/Assets/_Game/Data/Combat/Weapons/WPN_New.asset.meta
similarity index 79%
rename from Assets/_Game/Data/Player/Weapons/Weapon_TianHun.asset.meta
rename to Assets/_Game/Data/Combat/Weapons/WPN_New.asset.meta
index f67e9cd..d555971 100644
--- a/Assets/_Game/Data/Player/Weapons/Weapon_TianHun.asset.meta
+++ b/Assets/_Game/Data/Combat/Weapons/WPN_New.asset.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 76de8c0ba36dcce4db8990c5b62e9ed8
+guid: ce7bc9bad6f58ec42baff08f5353340e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
diff --git a/Assets/_Game/Data/Enemies/ENM_New_Stats.asset b/Assets/_Game/Data/Enemies/ENM_New_Stats.asset
new file mode 100644
index 0000000..6da7a55
--- /dev/null
+++ b/Assets/_Game/Data/Enemies/ENM_New_Stats.asset
@@ -0,0 +1,28 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: ed4391dfa14c0304c8932f1ef9f8ce63, type: 3}
+ m_Name: ENM_New_Stats
+ m_EditorClassIdentifier:
+ MaxHP: 50
+ Defense: 0
+ WalkSpeed: 2
+ RunSpeed: 4
+ AttackDamage: 10
+ AttackRange: 1.5
+ AttackCooldown: 1
+ DetectRange: 6
+ KnockbackForce: 5
+ HitStunDuration: 0.3
+ EyeOffset: {x: 0, y: 0.8}
+ LOSBlockingMask:
+ serializedVersion: 2
+ m_Bits: 1
diff --git a/Assets/_Game/Data/Player/Weapons/Weapon_DiHun.asset.meta b/Assets/_Game/Data/Enemies/ENM_New_Stats.asset.meta
similarity index 79%
rename from Assets/_Game/Data/Player/Weapons/Weapon_DiHun.asset.meta
rename to Assets/_Game/Data/Enemies/ENM_New_Stats.asset.meta
index a4b3032..d0f560c 100644
--- a/Assets/_Game/Data/Player/Weapons/Weapon_DiHun.asset.meta
+++ b/Assets/_Game/Data/Enemies/ENM_New_Stats.asset.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: f80486c9cd3d1db459ce6df915b11546
+guid: e0cf93e053ead744fa1876771ba0d081
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
diff --git a/Assets/_Game/Data/Enemies/SKL_Boss_New.asset b/Assets/_Game/Data/Enemies/SKL_Boss_New.asset
new file mode 100644
index 0000000..68fc23c
--- /dev/null
+++ b/Assets/_Game/Data/Enemies/SKL_Boss_New.asset
@@ -0,0 +1,49 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: de92221c7c3fb4a42a7cd122a8f97632, type: 3}
+ m_Name: SKL_Boss_New
+ m_EditorClassIdentifier:
+ skillId:
+ displayName:
+ designNote:
+ category: 0
+ skillType: 0
+ availablePhaseIndices:
+ attackPatterns: []
+ vulnerabilityWindows: []
+ interactionTags: 0
+ sequenceOnHit: {fileID: 0}
+ sequenceOnMiss: {fileID: 0}
+ counterResponses: []
+ arenaEvents: []
+ resourceCost:
+ resourceId:
+ cost: 0
+ minRequired: 0
+ buildsRage: 0
+ poiseWindow:
+ Level: 0
+ NormalizedStart: 0
+ NormalizedEnd: 0
+ skillAnimation:
+ _FadeDuration: 0.25
+ _Speed: 1
+ _Events:
+ _NormalizedTimes: []
+ _Callbacks: []
+ _Names: []
+ _Clip: {fileID: 0}
+ _NormalizedStartTime: NaN
+ cooldown: 0
+ references:
+ version: 2
+ RefIds: []
diff --git a/Assets/_Game/Data/Player/Weapons/Weapon_MingHun.asset.meta b/Assets/_Game/Data/Enemies/SKL_Boss_New.asset.meta
similarity index 79%
rename from Assets/_Game/Data/Player/Weapons/Weapon_MingHun.asset.meta
rename to Assets/_Game/Data/Enemies/SKL_Boss_New.asset.meta
index f6dbc32..374a497 100644
--- a/Assets/_Game/Data/Player/Weapons/Weapon_MingHun.asset.meta
+++ b/Assets/_Game/Data/Enemies/SKL_Boss_New.asset.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: d87ae01ed8a2b4f4cb27d159a52d1a14
+guid: a5d737a5b9641124aafb375d8684e06a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
diff --git a/Assets/_Game/Data/Player/Weapons/Weapon_MingHun.asset b/Assets/_Game/Data/Player/Weapons/Weapon_MingHun.asset
deleted file mode 100644
index dcb1e08..0000000
--- a/Assets/_Game/Data/Player/Weapons/Weapon_MingHun.asset
+++ /dev/null
@@ -1,87 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!114 &11400000
-MonoBehaviour:
- m_ObjectHideFlags: 0
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_GameObject: {fileID: 0}
- m_Enabled: 1
- m_EditorHideFlags: 0
- m_Script: {fileID: 11500000, guid: d2443d04d1c179d4d8a4f36e7ca7156e, type: 3}
- m_Name: Weapon_MingHun
- m_EditorClassIdentifier:
- weaponId:
- displayName:
- icon: {fileID: 0}
- weaponType: 0
- attack1Clip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- attack2Clip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- attack3Clip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- airAttackClip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- upAttackClip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- downAttackClip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- attack1Source: {fileID: 0}
- attack2Source: {fileID: 0}
- attack3Source: {fileID: 0}
- airAttackSource: {fileID: 0}
- upAttackSource: {fileID: 0}
- downAttackSource: {fileID: 0}
- hitBoxPrefab: {fileID: 0}
- vfxConfig:
- onEquipPresetId:
- weaponTrailPrefab: {fileID: 0}
- trailColor: {r: 1, g: 1, b: 1, a: 1}
- soulPowerGain: 10
- references:
- version: 2
- RefIds: []
diff --git a/Assets/_Game/Data/Player/Weapons/Weapon_TianHun.asset b/Assets/_Game/Data/Player/Weapons/Weapon_TianHun.asset
deleted file mode 100644
index 4771d43..0000000
--- a/Assets/_Game/Data/Player/Weapons/Weapon_TianHun.asset
+++ /dev/null
@@ -1,87 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!114 &11400000
-MonoBehaviour:
- m_ObjectHideFlags: 0
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_GameObject: {fileID: 0}
- m_Enabled: 1
- m_EditorHideFlags: 0
- m_Script: {fileID: 11500000, guid: d2443d04d1c179d4d8a4f36e7ca7156e, type: 3}
- m_Name: Weapon_TianHun
- m_EditorClassIdentifier:
- weaponId:
- displayName:
- icon: {fileID: 0}
- weaponType: 0
- attack1Clip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- attack2Clip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- attack3Clip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- airAttackClip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- upAttackClip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- downAttackClip:
- _FadeDuration: 0.25
- _Speed: 1
- _Events:
- _NormalizedTimes: []
- _Callbacks: []
- _Names: []
- _Clip: {fileID: 0}
- _NormalizedStartTime: NaN
- attack1Source: {fileID: 0}
- attack2Source: {fileID: 0}
- attack3Source: {fileID: 0}
- airAttackSource: {fileID: 0}
- upAttackSource: {fileID: 0}
- downAttackSource: {fileID: 0}
- hitBoxPrefab: {fileID: 0}
- vfxConfig:
- onEquipPresetId:
- weaponTrailPrefab: {fileID: 0}
- trailColor: {r: 1, g: 1, b: 1, a: 1}
- soulPowerGain: 10
- references:
- version: 2
- RefIds: []
diff --git a/Assets/_Game/Data/Progression/Skills/SKL_New.asset b/Assets/_Game/Data/Progression/Skills/SKL_New.asset
new file mode 100644
index 0000000..61c132b
--- /dev/null
+++ b/Assets/_Game/Data/Progression/Skills/SKL_New.asset
@@ -0,0 +1,46 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: a96f0270221c8444b8719f0f9b14c635, type: 3}
+ m_Name: SKL_New
+ m_EditorClassIdentifier:
+ skillId:
+ displayNameKey:
+ descriptionKey:
+ icon: {fileID: 0}
+ resourceType: 1
+ baseCost: 0
+ cooldown: 0
+ castAnimation:
+ _FadeDuration: 0.25
+ _Speed: 1
+ _Events:
+ _NormalizedTimes: []
+ _Callbacks: []
+ _Names: []
+ _Clip: {fileID: 0}
+ _NormalizedStartTime: NaN
+ castLockDuration: 0
+ effectType: 1
+ damageSource: {fileID: 0}
+ projectileConfig: {fileID: 0}
+ isHoming: 0
+ holdForContinuous: 0
+ dashForce: 0
+ dashDuration: 0
+ isInvincibleDuringDash: 0
+ explosionDelay: 0
+ explosionRadius: 0
+ castFeedback: {fileID: 0}
+ SkillHitBoxPrefab: {fileID: 0}
+ references:
+ version: 2
+ RefIds: []
diff --git a/Assets/_Game/Data/Progression/Skills/SKL_New.asset.meta b/Assets/_Game/Data/Progression/Skills/SKL_New.asset.meta
new file mode 100644
index 0000000..6ead2d9
--- /dev/null
+++ b/Assets/_Game/Data/Progression/Skills/SKL_New.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d00e0d6104f281345b8978d3a72eed13
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/_Game/Scenes/Testings/TestRoomA.unity b/Assets/_Game/Scenes/Testings/TestRoomA.unity
index 6fac123..517bda4 100644
--- a/Assets/_Game/Scenes/Testings/TestRoomA.unity
+++ b/Assets/_Game/Scenes/Testings/TestRoomA.unity
@@ -2400,7 +2400,7 @@ Transform:
m_GameObject: {fileID: 123526430}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
- m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalPosition: {x: 0, y: -1.94, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -3885,7 +3885,7 @@ Transform:
m_GameObject: {fileID: 173935938}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
- m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalPosition: {x: 0, y: 0.93, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -5123,7 +5123,7 @@ Transform:
m_GameObject: {fileID: 225562483}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
- m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalPosition: {x: 2.1, y: 2.25, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -8598,6 +8598,7 @@ MonoBehaviour:
_onCharmEquipped: {fileID: 0}
_onCharmUnequipped: {fileID: 0}
_onEquipmentChanged: {fileID: 0}
+ _onAchievementNotchGranted: {fileID: 0}
--- !u!114 &430284915
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -18864,7 +18865,7 @@ Transform:
m_GameObject: {fileID: 1108462349}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
- m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalPosition: {x: 1.72, y: -1.15, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -18895,7 +18896,7 @@ Transform:
m_GameObject: {fileID: 1112393102}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
- m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalPosition: {x: 1.09, y: 0.6, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -21066,7 +21067,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
_linkedDoor: {fileID: 1167097821}
_spawnPoint: {fileID: 1655723310}
- _facingDirectionOnArrive: 1
+ _facingDirectionOnArrive: -1
_autoTrigger: 1
_transitionOut: {fileID: 0}
_transitionIn: {fileID: 0}
@@ -27623,7 +27624,7 @@ Transform:
m_GameObject: {fileID: 1655723309}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
- m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalPosition: {x: -1.26, y: -1.09, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
diff --git a/Assets/_Game/Scripts/Editor/Character/CharacterWizardWindow.cs b/Assets/_Game/Scripts/Editor/Character/CharacterWizardWindow.cs
index 6576797..da964dc 100644
--- a/Assets/_Game/Scripts/Editor/Character/CharacterWizardWindow.cs
+++ b/Assets/_Game/Scripts/Editor/Character/CharacterWizardWindow.cs
@@ -182,9 +182,7 @@ namespace BaseGames.Editor
root.Add(MakeSectionHeader("▶ 专项编辑器"));
var jumpGroup = MakeActionGroup();
- jumpGroup.Add(MakeJumpButton("武器编辑器", () => Combat.WeaponEditorWindow.Open()));
- jumpGroup.Add(MakeJumpButton("技能编辑器", () => Skills.SkillEditorWindow.Open()));
- jumpGroup.Add(MakeJumpButton("形态编辑器", () => FormEditorWindow.Open()));
+ jumpGroup.Add(MakeJumpButton("Data Hub(武器/技能/形态)", DataHubWindow.Open));
jumpGroup.Add(MakeJumpButton("SO 全局校验", SOValidationRunner.ValidateMenu));
root.Add(jumpGroup);
@@ -248,7 +246,7 @@ namespace BaseGames.Editor
root.Add(MakeSectionHeader("▶ 专项编辑器"));
var jumpGroup = MakeActionGroup();
- jumpGroup.Add(MakeJumpButton("敌人数据管理", () => Enemies.EnemyDataWindow.Open()));
+ jumpGroup.Add(MakeJumpButton("Data Hub(敌人数据)", DataHubWindow.Open));
jumpGroup.Add(MakeJumpButton("SO 全局校验", SOValidationRunner.ValidateMenu));
root.Add(jumpGroup);
@@ -295,7 +293,7 @@ namespace BaseGames.Editor
var jumpGroup = MakeActionGroup();
jumpGroup.Add(MakeJumpButton("Boss 技能序列查看器", BossSkillSequenceWindow.OpenWindow));
- jumpGroup.Add(MakeJumpButton("敌人数据管理", () => Enemies.EnemyDataWindow.Open()));
+ jumpGroup.Add(MakeJumpButton("Data Hub(Boss技能)", DataHubWindow.Open));
jumpGroup.Add(MakeJumpButton("SO 全局校验", SOValidationRunner.ValidateMenu));
root.Add(jumpGroup);
@@ -763,7 +761,7 @@ namespace BaseGames.Editor
{
var sep = new VisualElement();
sep.style.height = 1;
- sep.style.backgroundColor = new Color(0.3f, 0.3f, 0.3f, 0.6f);
+ sep.style.backgroundColor = new Color(0.5f, 0.5f, 0.5f, 0.25f);
sep.style.marginTop = 8;
sep.style.marginBottom = 8;
return sep;
diff --git a/Assets/_Game/Scripts/Editor/Combat/WeaponEditorWindow.cs b/Assets/_Game/Scripts/Editor/Combat/WeaponEditorWindow.cs
deleted file mode 100644
index 82c2508..0000000
--- a/Assets/_Game/Scripts/Editor/Combat/WeaponEditorWindow.cs
+++ /dev/null
@@ -1,334 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Animancer;
-using UnityEditor;
-using UnityEditor.UIElements;
-using UnityEngine;
-using UnityEngine.UIElements;
-using BaseGames.Combat;
-using BaseGames.Player;
-
-namespace BaseGames.Editor.Combat
-{
- ///
- /// 武器数据管理窗口(W-02)。
- /// 技术:UI Toolkit TwoPaneSplitView。
- /// 菜单:BaseGames / Data / Weapon Editor
- ///
- /// 左栏:可搜索的 WeaponSO 列表 + [新建] 按钮。
- /// 右栏:选中武器的完整属性编辑 + HitBox Prefab 结构校验 + 快速操作。
- ///
- public class WeaponEditorWindow : EditorWindow
- {
- private static readonly StyleSheet _sharedUSS;
-
- static WeaponEditorWindow()
- {
- _sharedUSS = AssetDatabase.LoadAssetAtPath(
- "Assets/_Game/Scripts/Editor/UIToolkit/Editor.uss");
- }
-
- [MenuItem("BaseGames/Data/Weapon Editor", priority = 100)]
- public static void Open()
- {
- var wnd = GetWindow();
- wnd.titleContent = new GUIContent("Weapon Editor");
- wnd.minSize = new Vector2(680, 400);
- }
-
- // ── 状态 ─────────────────────────────────────────────────────────────
- private List _weapons = new();
- private List _filtered = new();
- private ListView _listView;
- private VisualElement _detailRoot;
- private string _searchText = "";
- private InspectorElement _currentInspector;
-
- // ── 生命周期 ──────────────────────────────────────────────────────────
-
- public void CreateGUI()
- {
- if (_sharedUSS != null)
- rootVisualElement.styleSheets.Add(_sharedUSS);
-
- // Toolbar
- var toolbar = new Toolbar();
- var searchField = new ToolbarSearchField { style = { flexGrow = 1 } };
- searchField.RegisterValueChangedCallback(e =>
- {
- _searchText = e.newValue;
- RefreshFilter();
- });
- toolbar.Add(searchField);
-
- var btnCreate = new ToolbarButton(CreateNewWeapon) { text = "+ 新建武器" };
- toolbar.Add(btnCreate);
-
- var btnRefresh = new ToolbarButton(RefreshAll) { text = "↺" };
- btnRefresh.tooltip = "重新扫描 Project 中的 WeaponSO 资产";
- toolbar.Add(btnRefresh);
-
- rootVisualElement.Add(toolbar);
-
- // Split view
- var split = new TwoPaneSplitView(0, 220, TwoPaneSplitViewOrientation.Horizontal);
-
- // ── 左栏 ──────────────────────────────────────────────────────
- var leftPane = new VisualElement { style = { minWidth = 140 } };
-
- _listView = new ListView
- {
- selectionType = SelectionType.Single,
- fixedItemHeight = 22,
- makeItem = MakeListItem,
- bindItem = BindListItem,
- style = { flexGrow = 1 },
- };
- _listView.selectionChanged += OnSelectionChanged;
- leftPane.Add(_listView);
- split.Add(leftPane);
-
- // ── 右栏 ──────────────────────────────────────────────────────
- _detailRoot = new ScrollView { style = { flexGrow = 1 } };
- _detailRoot.AddToClassList("detail-panel");
- split.Add(_detailRoot);
-
- rootVisualElement.Add(split);
-
- RefreshAll();
- }
-
- private void OnFocus() => RefreshAll();
-
- // ── 列表构建 ──────────────────────────────────────────────────────────
-
- private void RefreshAll()
- {
- _weapons = EditorScaffoldUtils.FindAllAssetsOfType();
- _weapons.Sort((a, b) => string.Compare(
- a.weaponId, b.weaponId, StringComparison.OrdinalIgnoreCase));
- RefreshFilter();
- }
-
- private void RefreshFilter()
- {
- if (string.IsNullOrEmpty(_searchText))
- {
- _filtered = new List(_weapons);
- }
- else
- {
- string s = _searchText;
- _filtered = _weapons.Where(w => w != null &&
- (w.weaponId?.Contains(s, StringComparison.OrdinalIgnoreCase) == true ||
- w.displayName?.Contains(s, StringComparison.OrdinalIgnoreCase) == true)).ToList();
- }
-
- _listView.itemsSource = _filtered;
- _listView.Rebuild();
- }
-
- private static VisualElement MakeListItem()
- {
- var label = new Label();
- label.AddToClassList("list-item");
- return label;
- }
-
- private void BindListItem(VisualElement element, int index)
- {
- var label = (Label)element;
- var weapon = _filtered.Count > index ? _filtered[index] : null;
- if (weapon == null) { label.text = "(null)"; return; }
-
- label.text = string.IsNullOrEmpty(weapon.displayName)
- ? weapon.weaponId
- : $"{weapon.weaponId} ({weapon.displayName})";
- }
-
- // ── 详情面板 ──────────────────────────────────────────────────────────
-
- private void OnSelectionChanged(IEnumerable