HPbarzissou

This commit is contained in:
ohgushiyuga
2026-08-27 17:59:06 +09:00
parent 52341100ed
commit 9864b95a91
48 changed files with 3379 additions and 19467 deletions

View File

@@ -0,0 +1,25 @@
using UnityEngine;
[RequireComponent(typeof(Collider))]
public class EnemyDamageHitbox : MonoBehaviour
{
[SerializeField] private float damageAmount = 15f;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
IDamageable player = other.GetComponentInParent<IDamageable>();
if (player != null)
{
DamageInfo info = new DamageInfo
{
amount = damageAmount,
hitPosition = transform.position,
punchDirection = transform.forward
};
player.TakeDamage(info);
}
}
}
}