2026-06-02 사운드 추가
This commit is contained in:
@@ -71,6 +71,13 @@ public class ActionData : ScriptableObject
|
||||
public bool HitEffectAttachToPlayer; // true면 플레이어 자식으로 부착 (같이 움직임), false면 월드 고정
|
||||
public float HitEffectLifetime = 1f; // 자동 파괴 시간 (0이면 파괴 안 함 — 프리팹이 스스로 정리)
|
||||
|
||||
// ─── 효과음 (hit 발동 시 재생) ──────────────────────────────────────
|
||||
[Header("Audio")]
|
||||
public AudioClip AttackSound; // 무기 모션(휘두름/발사) 사운드. 적중 여부와 무관하게 발동 시 항상 재생 (null이면 없음)
|
||||
[Range(0f, 1f)] public float AttackSoundVolume = 1f; // 모션 사운드 볼륨
|
||||
public AudioClip HitSound; // 타격 사운드. 실제 적중 시에만 재생 (null이면 없음)
|
||||
[Range(0f, 1f)] public float HitSoundVolume = 1f; // 타격 사운드 볼륨
|
||||
|
||||
// ─── 피격자 반응 (피격된 적의 동작) ─────────────────────────────────
|
||||
[Header("Hit Reaction")]
|
||||
public Vector2 HitVelocity = Vector2.zero; // 적에게 가할 넉백 속도 (X는 공격자 facing 방향)
|
||||
|
||||
@@ -140,7 +140,6 @@ private void TryDamage(Collider2D other)
|
||||
if (_alreadyHit.Contains(target)) return;
|
||||
|
||||
_alreadyHit.Add(target);
|
||||
Debug.Log($"[Hitbox] t={Time.time:F3} damage={_damage} → {other.name} (parent={(target as MonoBehaviour)?.gameObject.name})");
|
||||
Vector2? targetPosition = GetCorrectionTargetPosition(other);
|
||||
target.TakeDamage(_damage, _hitVelocity, _hitReactionState, targetPosition, _correctHitTargetY, _hitPositionSolidMask, _hitPositionCorrectionDuration, _hitStunDuration);
|
||||
OnHit?.Invoke(target);
|
||||
|
||||
@@ -18,8 +18,6 @@ private void OnTriggerStay2D(Collider2D other)
|
||||
{
|
||||
if((_blockLayer.value & (1 << other.gameObject.layer)) > 0)
|
||||
{
|
||||
Debug.Log("aaaaaaa");
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user