private void TrackEntity(MyEntity entity, double range) { MyEntityTracker tracker; if (m_trackedEntities.TryGetValue(entity, out tracker) || m_toAddTrackedEntities.TryGetValue(entity, out tracker)) { tracker.Radius = range; } else { tracker = new MyEntityTracker(entity, range); m_toAddTrackedEntities.Add(entity, tracker); entity.OnMarkForClose += (e) => { m_trackedEntities.Remove(e); m_toAddTrackedEntities.Remove(e); MarkCellsDirty(tracker.BoundingVolume); }; } }
private void TrackEntity(MyEntity entity, double range) { MyEntityTracker tracker; if (m_trackedEntities.TryGetValue(entity, out tracker) || m_toAddTrackedEntities.TryGetValue(entity, out tracker)) { tracker.Radius = range; } else { tracker = new MyEntityTracker(entity, range); m_toAddTrackedEntities.Add(entity, tracker); entity.OnMarkForClose += (e) => { m_trackedEntities.Remove(e); m_toAddTrackedEntities.Remove(e); MarkCellsDirty(tracker.BoundingVolume); }; } }