/// <summary> /// Cleans up. /// </summary> public virtual void CleanUp() { Camera2D.CleanUp(); foreach (var item in Objects.ToArray()) { this.RemoveObject(item); } if (CleanUpObjectsOnDispose) { foreach (var item in Objects) { item.CleanUp(graphicsFactory); } } foreach (var item in SoundEmiters2D.ToArray()) { this.RemoveSoundEmitter(item); } foreach (var item in SoundEmiters2D) { item.CleanUp(graphicsFactory); } Objects.Clear(); Camera2D = null; Dummies.Clear(); SoundEmiters2D.Clear(); particleManager = null; PhysicWorld = null; this.culler = null; }
/// <summary> /// Cleans up. /// </summary> public virtual void CleanUp() { foreach (var item in this.CameraManager.GetCamerasDescription()) { item.cam.CleanUp(); } foreach (var item in SoundEmiters3D.ToArray()) { this.RemoveSoundEmitter(item); } foreach (var item in Triggers.ToArray()) { this.RemoveTrigger(item); } foreach (var item in Lights.ToArray()) { this.RemoveLight(item); } if (CleanUpObjectsOnDispose) { foreach (var item in Objects.ToArray()) { this.RemoveObject(item); item.CleanUp(graphicFactory); } } else { foreach (var item in Objects.ToArray()) { this.RemoveObject(item); } } foreach (var item in SoundEmiters3D) { item.CleanUp(graphicFactory); } Objects.Clear(); Lights.Clear(); Dummies.Clear(); this.culler = null; SoundEmiters3D.Clear(); CameraManager = null; Triggers.Clear(); if (particleManager != null) { particleManager.iCleanUp(); particleManager = null; } this.PhysicWorld.iCleanUp(); this.PhysicWorld = null; }