fix(editor): WeaponHitBoxWizard 补挂 WeaponFeedback——武器本地反馈链路接通
向导生成武器 HitBox Prefab 时在根节点添加 WeaponFeedback (WeaponHitBoxInstance.Awake 经 GetComponentInChildren 获取)。 此前组件缺失,武器级命中/破风反馈静默落到 NullFeedbackPlayer。 MMF_Player 反馈链内容仍留待 Inspector 编排。存量 WPN_WPN_DiHun_HitBox.prefab 已另行补挂修正。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ using System.IO;
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using BaseGames.Combat;
|
using BaseGames.Combat;
|
||||||
|
using BaseGames.Feedback;
|
||||||
using BaseGames.Player;
|
using BaseGames.Player;
|
||||||
|
|
||||||
namespace BaseGames.Editor.Combat
|
namespace BaseGames.Editor.Combat
|
||||||
@@ -12,11 +13,14 @@ namespace BaseGames.Editor.Combat
|
|||||||
///
|
///
|
||||||
/// 生成路径规范:Assets/_Game/Prefabs/Weapons/WPN_{weaponId}_HitBox.prefab
|
/// 生成路径规范:Assets/_Game/Prefabs/Weapons/WPN_{weaponId}_HitBox.prefab
|
||||||
/// Prefab 结构:
|
/// Prefab 结构:
|
||||||
/// [WPN_{weaponId}_HitBox] ← WeaponHitBoxInstance
|
/// [WPN_{weaponId}_HitBox] ← WeaponHitBoxInstance + WeaponFeedback(武器本地反馈:命中粒子/音效/破风)
|
||||||
/// ├── [HitBox_Ground] ← Collider2D(IsTrigger, 形状可选) + HitBox, Layer=PlayerHitBox
|
/// ├── [HitBox_Ground] ← Collider2D(IsTrigger, 形状可选) + HitBox, Layer=PlayerHitBox
|
||||||
/// ├── [HitBox_Up]
|
/// ├── [HitBox_Up]
|
||||||
/// ├── [HitBox_Down]
|
/// ├── [HitBox_Down]
|
||||||
/// └── [HitBox_Air]
|
/// └── [HitBox_Air]
|
||||||
|
///
|
||||||
|
/// WeaponFeedback 的 MMF_Player 反馈链留待 Inspector 编排;
|
||||||
|
/// 缺失该组件时 WeaponHitBoxInstance 会静默落到 NullFeedbackPlayer(无武器级表现)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class WeaponHitBoxWizard : ScriptableWizard
|
public class WeaponHitBoxWizard : ScriptableWizard
|
||||||
{
|
{
|
||||||
@@ -101,6 +105,9 @@ namespace BaseGames.Editor.Combat
|
|||||||
// ── 构建 Prefab ────────────────────────────────────────────────
|
// ── 构建 Prefab ────────────────────────────────────────────────
|
||||||
var root = new GameObject(prefabName);
|
var root = new GameObject(prefabName);
|
||||||
var instance = root.AddComponent<WeaponHitBoxInstance>();
|
var instance = root.AddComponent<WeaponHitBoxInstance>();
|
||||||
|
// 武器本地反馈(WeaponHitBoxInstance.Awake 经 GetComponentInChildren<IFeedbackPlayer>() 获取);
|
||||||
|
// MMF_Player 反馈链留待 Inspector 编排
|
||||||
|
root.AddComponent<WeaponFeedback>();
|
||||||
var so = new SerializedObject(instance);
|
var so = new SerializedObject(instance);
|
||||||
|
|
||||||
void AddDirection(bool enabled, string nodeName, string fieldName, ColliderShape shape)
|
void AddDirection(bool enabled, string nodeName, string fieldName, ColliderShape shape)
|
||||||
|
|||||||
Reference in New Issue
Block a user