Files
zeling_v2/Assets/_Game/Scripts/Combat/ProjectileConfigSO.cs
Joywayer 5922ef373d feat(combat): 弹反投射物伤害目标层改为显式配置
ProjectileConfigSO 新增 ReflectedTargetLayers:弹反后写入 HitBox.TargetLayers 的目标层显式配置;留空(Nothing)有明确缺省语义=自动翻转(PlayerHurtBox 位换 EnemyHurtBox 位、其余位保留)。Projectile/ParryableProjectile 两条弹反路径统一走 ApplyReflectedTargetLayers。现有 6 个投射物配置资产已显式配为 EnemyHurtBox。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 10:43:57 +08:00

34 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
namespace BaseGames.Combat
{
/// <summary>
/// 抛射物配置 ScriptableObject。描述一类抛射物的运动、伤害与对象池参数。
/// </summary>
[CreateAssetMenu(menuName = "BaseGames/Combat/ProjectileConfig")]
public class ProjectileConfigSO : ScriptableObject
{
[Header("伤害")]
public DamageSourceSO DamageSource;
[Tooltip("命中目标多少次后回收。1 = 命中即消失(默认);>1 = 穿透 N 个目标;<=0 = 无限穿透直至寿命结束。")]
public int MaxHits = 1;
[Header("运动")]
public float Speed = 12f;
public float Lifetime = 5f;
public float LaunchAngleDeg = 45f;
public float GravityScale = 1f;
public float HomingStrength = 4f;
[Header("对象池")]
public string PoolKey;
[Header("弹反")]
public float ParrySpeedMultiplier = 1.2f;
public float ParryDamageMultiplier = 2.0f;
[Tooltip("弹反后本投射物可造成伤害判定的 Layer显式配置写入 HitBox.TargetLayers。" +
"留空(Nothing) = 自动翻转:在原目标层基础上 PlayerHurtBox 位换为 EnemyHurtBox 位、其余位保留。")]
public LayerMask ReflectedTargetLayers;
}
}