public void Dispose() { DebugView.Dispose(); if (Vector != null) { Vector.Dispose(); } foreach (var b in World.BodyList) { World.RemoveBody(b); } GC.SuppressFinalize(this); }
/// <summary> /// Destroys this scene and removes all gameobjects inside it. /// </summary> public void Destroy() { OnDestroy(); foreach (GameObject gameObject in gameObjects.Values) { gameObject.Destroy(); } gameObjects.Clear(); DebugView.Dispose(); TextureManager.Instance.Release(); }
public void UnloadContent() { _world.Dispose(); _spriteBatch.Dispose(); _debugView.Dispose(); }