Add WeaponFeedback component and AddressableManagerWindow meta file
- Implemented WeaponFeedback class for handling weapon-related feedbacks such as hit effects and attack sounds. - Added meta file for AddressableManagerWindow to manage addressable assets. - Included a new jump.data file for profiler data.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using BaseGames.Combat;
|
||||
using BaseGames.Feedback;
|
||||
|
||||
namespace BaseGames.Player
|
||||
{
|
||||
@@ -14,6 +15,7 @@ namespace BaseGames.Player
|
||||
private PlayerStats _stats;
|
||||
private PlayerMovement _movement;
|
||||
private WeaponHitBoxInstance _currentHitBoxInstance;
|
||||
private IFeedbackPlayer _feedback;
|
||||
|
||||
/// <summary>下劈 HitBox 命中确认事件(供 DownAttackState 订阅 pogo 弹跳逻辑)。</summary>
|
||||
public event System.Action<DamageInfo> OnDownHitConfirmed;
|
||||
@@ -22,6 +24,9 @@ namespace BaseGames.Player
|
||||
{
|
||||
_stats = GetComponentInParent<PlayerStats>();
|
||||
_movement = GetComponentInParent<PlayerMovement>();
|
||||
_feedback = GetComponentInParent<IFeedbackPlayer>()
|
||||
?? GetComponentInChildren<IFeedbackPlayer>()
|
||||
?? NullFeedbackPlayer.Instance;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
@@ -83,6 +88,12 @@ namespace BaseGames.Player
|
||||
int gain = _weaponManager?.ActiveWeapon?.soulPowerGain ?? 10;
|
||||
_stats?.AddSoulPower(gain);
|
||||
|
||||
// 命中反馈:按伤害量决定力度档位
|
||||
var weight = info.FinalDamage <= 5 ? HitWeight.Light
|
||||
: info.FinalDamage <= 15 ? HitWeight.Medium
|
||||
: HitWeight.Heavy;
|
||||
_feedback.PlayHit(weight);
|
||||
|
||||
// 攻击命中反嵈:向攻击反方向施加微小后退冲量,增强打击感
|
||||
if (_movement?.Rb != null && info.KnockbackDirection.x != 0f)
|
||||
_movement.Rb.AddForce(
|
||||
|
||||
Reference in New Issue
Block a user