/// <summary> /// This method remove from the 3D overlay and destries the passed scene node /// </summary> /// <param name="life"></param> private void RemoveAndDestroyLife(SceneNode life) { overlay3D.Remove3D(life); lives.Remove(life); MovableObject heart = life.GetAttachedObject(0); life.DetachAllObjects(); life.Dispose(); heart.Dispose(); }
void DestroyScene() { foreach (var light in lights) { light.Dispose(); } lights.Clear(); foreach (var node in sceneNodes) { while (node.MovableObjects.Count != 0) { MovableObject obj = node.MovableObjects[node.MovableObjects.Count - 1]; node.Detach(obj); obj.Dispose(); } node.Dispose(); } sceneNodes.Clear(); sceneCreated = false; }