private void Collider_Destroyed(MyBoxCollider2D collider) { collider.Destroyed -= Collider_Destroyed; _colliders.Remove(collider); }
public MyBoxCollider2D[] GetIntersections(MyBoxCollider2D collider) { return(_colliders.Except(collider).Where(c => c.enabled && c.Bounds.Intersects(collider.Bounds)).ToArray()); }
public void Register(MyBoxCollider2D collider) { _colliders.Add(collider); collider.Destroyed += Collider_Destroyed; }