15 lines
293 B
C#
15 lines
293 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
public class EnemyDetection : MonoBehaviour
|
|
{
|
|
public Enemy thisEnemy;
|
|
|
|
private void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
if (!other.CompareTag(thisEnemy.tag) && other.TryGetComponent(out Player isPlayer))
|
|
{
|
|
thisEnemy.detectedPlayer = true;
|
|
}
|
|
}
|
|
}
|