mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 16:34:41 +01:00
37 lines
473 B
C#
37 lines
473 B
C#
using UnityEngine;
|
|
|
|
namespace MoleMole
|
|
{
|
|
public class MonoZone2D : MonoBehaviour
|
|
{
|
|
private MonoSubZone2D[] _zones;
|
|
|
|
private void Awake()
|
|
{
|
|
Init();
|
|
}
|
|
|
|
public void Init()
|
|
{
|
|
_zones = GetComponentsInChildren<MonoSubZone2D>(true);
|
|
}
|
|
|
|
public void Reset()
|
|
{
|
|
Init();
|
|
}
|
|
|
|
public bool Contain(Vector3 pos)
|
|
{
|
|
for (int i = 0; i < _zones.Length; i++)
|
|
{
|
|
if (_zones[i].Contain(pos))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|