internal void Destroy() { ColliderA = null; ColliderB = null; NewContactChannel.Reset(); ContactUpdateChannel.Reset(); ContactEndedChannel.Reset(); ChannelsPool.Enqueue(NewContactChannel); ChannelsPool.Enqueue(ContactUpdateChannel); ChannelsPool.Enqueue(ContactEndedChannel); Contacts.Clear(); }
internal void Destroy() { // Because we raise CollisionEnded for removed components right before Simulation.BeginContactTesting() // cleans up the ended collisions, we need to retain the collider information for an additional frame. // The collision has been removed from PhysicsComponent.Collisions and the user should not store the // collision object between frames. if (!HasEndedFromComponentRemoval) { ColliderA = null; ColliderB = null; } NewContactChannel.Reset(); ContactUpdateChannel.Reset(); ContactEndedChannel.Reset(); ChannelsPool.Enqueue(NewContactChannel); ChannelsPool.Enqueue(ContactUpdateChannel); ChannelsPool.Enqueue(ContactEndedChannel); Contacts.Clear(); destroyed = true; }