발사라던가 제작했습니다만 ..
데미지 구현은 모르겠고
큐 효율성을 높여주세요
This commit is contained in:
김도환
2026-04-16 21:14:05 +09:00
parent 65c997406b
commit 4946e16710
15 changed files with 2399 additions and 73 deletions

View File

@@ -0,0 +1,23 @@
using System;
using UnityEngine;
public class LivingEntity : MonoBehaviour
{
public float health;
public void Damage(float amount)
{
health -= amount;
if (health <= 0)
{
Destroy(gameObject);
}
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.layer == LayerMask.NameToLayer("Bullet"))
{
Destroy(gameObject);
other.gameObject.SetActive(false);
}
}
}