UI 系统
This commit is contained in:
@@ -323,11 +323,12 @@ namespace BaseGames.Editor
|
||||
var factory = MakeActionGroup();
|
||||
factory.Add(MakeFactoryButton("ENM_ChaoFeng_Stats.asset", () => { CreateChaoFengStatsSO(); RefreshSOStatus(); }));
|
||||
factory.Add(MakeFactoryButton("ENM_ChaoFeng_AnimConfig.asset",() => { CreateChaoFengAnimConfigSO(); RefreshSOStatus(); }));
|
||||
factory.Add(MakeFactoryButton("ABL_ChaoFeng_Idle.asset", () => { CreateChaoFengSkillSO("Idle", "chaofeng_idle"); RefreshSOStatus(); }));
|
||||
factory.Add(MakeFactoryButton("ABL_ChaoFeng_Slam.asset", () => { CreateChaoFengSkillSO("Slam", "chaofeng_slam"); RefreshSOStatus(); }));
|
||||
factory.Add(MakeFactoryButton("ABL_ChaoFeng_Sweep.asset", () => { CreateChaoFengSkillSO("Sweep", "chaofeng_sweep"); RefreshSOStatus(); }));
|
||||
factory.Add(MakeFactoryButton("ABL_ChaoFeng_WindBlade.asset", () => { CreateChaoFengSkillSO("WindBlade", "chaofeng_windblade"); RefreshSOStatus(); }));
|
||||
factory.Add(MakeFactoryButton("ABL_ChaoFeng_Summon.asset", () => { CreateChaoFengSkillSO("Summon", "chaofeng_summon"); RefreshSOStatus(); }));
|
||||
foreach (var (skName, skId, skPhases, skWeight) in ChaoFengSkillDefs)
|
||||
{
|
||||
string cName = skName; string cId = skId; int[] cPhases = skPhases; float cWeight = skWeight;
|
||||
factory.Add(MakeFactoryButton($"ABL_ChaoFeng_{cName}.asset",
|
||||
() => { CreateChaoFengSkillSO(cName, cId, cPhases, cWeight); RefreshSOStatus(); }));
|
||||
}
|
||||
root.Add(factory);
|
||||
|
||||
var createAllBtn = new Button(() => { CreateAllChaoFengSOs(); RefreshSOStatus(); })
|
||||
@@ -570,10 +571,10 @@ namespace BaseGames.Editor
|
||||
private static (string ablName, string ablId)[] GetEnemyAbilityDefs(string enemyId) => enemyId switch
|
||||
{
|
||||
"E001" => new[] { ("Alert", "e001_alert"), ("Chase", "e001_chase") },
|
||||
"E002" => new[] { ("Strike", "e002_strike") },
|
||||
"E002" => new[] { ("CeilingStrike", "e002_ceiling_strike") },
|
||||
"E003" => new[] { ("Fall", "e003_fall") },
|
||||
"E004" => new[] { ("Bite", "e004_bite"), ("Slam", "e004_slam"), ("Acid", "e004_acid"),
|
||||
("Charge", "e004_charge"), ("Chase", "e004_chase") },
|
||||
"E004" => new[] { ("Appear", "e004_appear"), ("Bite", "e004_bite"), ("HeadSlam", "e004_headslam"),
|
||||
("Acid", "e004_acid"), ("Flip", "e004_flip") },
|
||||
"E005" => new[] { ("Bite", "e005_bite"), ("Acid", "e005_acid") },
|
||||
"E006" => new[] { ("Leap", "e006_leap"), ("Chase", "e006_chase") },
|
||||
_ => System.Array.Empty<(string, string)>(),
|
||||
@@ -669,26 +670,38 @@ namespace BaseGames.Editor
|
||||
EditorScaffoldUtils.CreateSOAsset<EnemyAnimationConfigSO>(dir, "ENM_ChaoFeng_AnimConfig");
|
||||
}
|
||||
|
||||
private static void CreateChaoFengSkillSO(string skillName, string skillId)
|
||||
private static void CreateChaoFengSkillSO(string skillName, string skillId, int[] phaseIndices, float weight)
|
||||
{
|
||||
string dir = "Assets/_Game/Data/Enemies/ChaoFeng/Abilities";
|
||||
string name = $"ABL_ChaoFeng_{skillName}";
|
||||
var so = EditorScaffoldUtils.CreateSOAsset<BossSkillSO>(dir, name);
|
||||
if (so != null)
|
||||
{
|
||||
so.skillId = skillId;
|
||||
so.displayName = skillName;
|
||||
so.availablePhaseIndices = phaseIndices;
|
||||
so.weight = weight;
|
||||
EditorUtility.SetDirty(so);
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>嘲风技能集(计划):Phase0 四技能加权随机 + Phase1 风石。</summary>
|
||||
private static readonly (string name, string id, int[] phases, float weight)[] ChaoFengSkillDefs =
|
||||
{
|
||||
("Boomerang", "boomerang", new[] { 0 }, 1.0f),
|
||||
("FanCombo", "fan_combo", new[] { 0 }, 1.5f),
|
||||
("TornadoSmall", "tornado_small", new[] { 0 }, 1.2f),
|
||||
("TornadoLarge", "tornado_large", new[] { 0 }, 0.8f),
|
||||
("WindStone", "wind_stone", new[] { 1 }, 1.0f),
|
||||
};
|
||||
|
||||
private static void CreateAllChaoFengSOs()
|
||||
{
|
||||
CreateChaoFengStatsSO();
|
||||
CreateChaoFengAnimConfigSO();
|
||||
foreach (var (n, id) in new[] { ("Idle","chaofeng_idle"), ("Slam","chaofeng_slam"),
|
||||
("Sweep","chaofeng_sweep"), ("WindBlade","chaofeng_windblade"),
|
||||
("Summon","chaofeng_summon") })
|
||||
CreateChaoFengSkillSO(n, id);
|
||||
foreach (var (n, id, phases, weight) in ChaoFengSkillDefs)
|
||||
CreateChaoFengSkillSO(n, id, phases, weight);
|
||||
AssetDatabase.SaveAssets();
|
||||
EditorUtility.DisplayDialog("创建完成",
|
||||
"全部嘲风 SO 已创建(已存在的跳过)。\n放置到场景后检查 BossSkillExecutor._skills 绑定。", "确定");
|
||||
@@ -757,18 +770,15 @@ namespace BaseGames.Editor
|
||||
|
||||
const string dir = "Assets/_Game/Data/Enemies/ChaoFeng";
|
||||
const string ablDir = "Assets/_Game/Data/Enemies/ChaoFeng/Abilities";
|
||||
var checks = new (string label, UnityEngine.Object asset)[]
|
||||
var checks = new List<(string label, UnityEngine.Object asset)>
|
||||
{
|
||||
("ENM_ChaoFeng_Stats", FindAtPath<EnemyStatsSO>($"{dir}/ENM_ChaoFeng_Stats.asset")),
|
||||
("ENM_ChaoFeng_AnimConfig",FindAtPath<EnemyAnimationConfigSO>($"{dir}/ENM_ChaoFeng_AnimConfig.asset")),
|
||||
("ABL_ChaoFeng_Idle", FindAtPath<BossSkillSO>($"{ablDir}/ABL_ChaoFeng_Idle.asset")),
|
||||
("ABL_ChaoFeng_Slam", FindAtPath<BossSkillSO>($"{ablDir}/ABL_ChaoFeng_Slam.asset")),
|
||||
("ABL_ChaoFeng_Sweep", FindAtPath<BossSkillSO>($"{ablDir}/ABL_ChaoFeng_Sweep.asset")),
|
||||
("ABL_ChaoFeng_WindBlade", FindAtPath<BossSkillSO>($"{ablDir}/ABL_ChaoFeng_WindBlade.asset")),
|
||||
("ABL_ChaoFeng_Summon", FindAtPath<BossSkillSO>($"{ablDir}/ABL_ChaoFeng_Summon.asset")),
|
||||
};
|
||||
foreach (var (skName, _, _, _) in ChaoFengSkillDefs)
|
||||
checks.Add(($"ABL_ChaoFeng_{skName}", FindAtPath<BossSkillSO>($"{ablDir}/ABL_ChaoFeng_{skName}.asset")));
|
||||
|
||||
_bossStatusPanel.Add(MakeStatusGrid(checks));
|
||||
_bossStatusPanel.Add(MakeStatusGrid(checks.ToArray()));
|
||||
}
|
||||
|
||||
// ── 辅助:状态格 ─────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user