31 lines
613 B
C#
31 lines
613 B
C#
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
public class EnemyRoomLink : MonoBehaviour
|
|||
|
|
{
|
|||
|
|
private CombatRoomController room;
|
|||
|
|
|
|||
|
|
void Awake()
|
|||
|
|
{
|
|||
|
|
room = GetComponentInParent<CombatRoomController>();
|
|||
|
|
if (room != null)
|
|||
|
|
room.RegisterEnemy(this);
|
|||
|
|
else
|
|||
|
|
Debug.LogWarning("EnemyRoomLink: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CombatRoomController<65><72> <20><> ã<>Ҿ<EFBFBD><D2BE><EFBFBD>!");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Update()
|
|||
|
|
{
|
|||
|
|
// <20><EFBFBD>Ʈ: K Ű<><C5B0> <20><><EFBFBD>̱<EFBFBD>
|
|||
|
|
if (Input.GetKeyDown(KeyCode.K))
|
|||
|
|
Die();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Die()
|
|||
|
|
{
|
|||
|
|
if (room != null)
|
|||
|
|
room.NotifyEnemyDied(this);
|
|||
|
|
|
|||
|
|
Destroy(gameObject);
|
|||
|
|
}
|
|||
|
|
}
|