/// <summary> /// This method dispose of the bomb, destroying the physics object, and removing the bomb and its mesh from the scenegraph /// </summary> public override void Dispose() { Physics.RemovePhysObj(physObj); physObj = null; GameNode.Parent.RemoveChild(GameNode); GameNode.DetachAllObjects(); GameNode.Dispose(); gameEntity.Dispose(); }
/// <summary> /// This method is detaches from the scene graph and derstroies the game node and the game entity /// </summary> public virtual void Dispose() { if (GameNode != null) { if (GameNode.Parent != null) { GameNode.DetachAllObjects(); GameNode.RemoveAndDestroyAllChildren(); GameNode.Parent.RemoveChild(GameNode.Name); } GameNode.Dispose(); //Physics.RemovePhysObj(physObj); } if (gameEntity != null) { gameEntity.Dispose(); //Physics.RemovePhysObj(physObj); } }