void FindZone() { List <QTCircleCollider> found = QuadTreeCircleManager.instance.Retrieve(_collider); QTCircleCollider best = null; float bestDistance = float.MaxValue; for (int i = 0; i < found.Count; i++) { float distance = Vector2.Distance(found[i].center, _collider.center); if (distance < bestDistance) { best = found[i]; bestDistance = distance; } } if (best != null) { _zone = (T)best; } }
void Awake() { _collider = GetComponent <QTCircleCollider>(); }