몬스터 추격범위 추가, 플레이어 탐지 범위 리팩토링
This commit is contained in:
20
Gameton-06/Assets/Gameton/Scripts/Monster/Attack.cs
Normal file
20
Gameton-06/Assets/Gameton/Scripts/Monster/Attack.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class Attack : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private MonsterBase _monsterBase;
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
if (other.CompareTag("Player"))
|
||||
{
|
||||
_monsterBase.Attack(other.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user