2024-02-03 01:41:20 +01:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class ShootingRange : MonoBehaviour
|
|
|
|
{
|
|
|
|
public float range = 5f;
|
|
|
|
public LayerMask playerLayer;
|
|
|
|
public bool inRange = false;
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
private void OnTriggerEnter2D(Collider2D collision)
|
|
|
|
{
|
2024-02-03 03:28:29 +01:00
|
|
|
inRange = true;
|
2024-02-03 12:42:00 +01:00
|
|
|
//Debug.Log("in range");
|
2024-02-03 03:28:29 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnTriggerExit2D(Collider2D collision)
|
|
|
|
{
|
|
|
|
inRange=false;
|
2024-02-03 01:41:20 +01:00
|
|
|
}
|
|
|
|
}
|