public void RemoveObject(ApolloObject obj) { if (obj == null) { return; } if (this.dictObjectCollection.ContainsKey(obj.ObjectId)) { this.dictObjectCollection.Remove(obj.ObjectId); ApolloObjectManager.removeApolloObject(obj.ObjectId); } }
public void ClearObjects() { using (Dictionary <ulong, object> .KeyCollection.Enumerator enumerator = this.dictObjectCollection.Keys.GetEnumerator()) { while (enumerator.MoveNext()) { ulong current = enumerator.get_Current(); ApolloObject apolloObject = this.dictObjectCollection[current]; ApolloObjectManager.removeApolloObject(apolloObject.ObjectId); } } this.dictObjectCollection.Clear(); }