코어, 벽, 적의 생성 및 충돌, 데미지 판정

This commit is contained in:
2026-01-12 13:09:08 +09:00
parent a0cf82e97e
commit 5e2eaee44b
24 changed files with 732 additions and 25 deletions

View File

@@ -0,0 +1,18 @@
using UnityEngine;
using System;
// Gate.cs
public class Gate : MonoBehaviour, IDamageable
{
[SerializeField] private float maxHealth = 50f;
private float _currentHealth;
void Awake() => _currentHealth = maxHealth;
public void TakeDamage(float amount)
{
_currentHealth -= amount;
if (_currentHealth <= 0)
gameObject.SetActive(false);
}
}