/// <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); } }