public void Unregister(MySmallShipBot entity) { System.Diagnostics.Debug.Assert(entity == null || !entity.Closed); entity.OnPositionChanged -= OnPositionChangedHandler; m_dangerZoneStructure.RemoveProxy(entity.GetDangerZoneID()); }
void OnEntityPositionChanged(object sender, EventArgs e) { MySmallShipBot smallShip = sender as MySmallShipBot; if (smallShip != null) { BoundingBox bbox = new BoundingBox(smallShip.WorldAABB.Min - new Vector3(DANGER_ZONE_SIZE), smallShip.WorldAABB.Max + new Vector3(DANGER_ZONE_SIZE)); m_dangerZoneStructure.MoveProxy(smallShip.GetDangerZoneID(), ref bbox, Vector3.Zero); } }