first commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class NPCTriggerRelay : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private NPC owner;
|
||||
|
||||
public void Initialize(NPC npc)
|
||||
{
|
||||
owner = npc;
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (owner != null && other.CompareTag("Player"))
|
||||
{
|
||||
owner.SetPlayerInRange(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (owner != null && other.CompareTag("Player"))
|
||||
{
|
||||
owner.SetPlayerInRange(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user