public OctoGame() : base() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; this.Window.Title = "OctoAwesome"; graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; this.IsMouseVisible = true; input = new InputComponent(this); input.UpdateOrder = 1; Components.Add(input); world = new WorldComponent(this, input); world.UpdateOrder = 2; Components.Add(world); //camera = new CameraComponent(this, world, input); //camera.UpdateOrder = 3; //Components.Add(camera); camera3d = new Camera3DComponent(this, world); camera3d.UpdateOrder = 3; Components.Add(camera3d); render3d = new Render3DComponent(this, world, camera3d); render3d.DrawOrder = 1; Components.Add(render3d); }
public static void ClearLevel() { Game.PauseGame = true; Debug.LogWarning("--- CLEARING LEVEL ---"); Debug.LogWarning("Disposing Objects & Instances..."); Debug.Log(" Cameras..."); Active2DCamera = null; Active3DCamera = null; Debug.Log(" 2D Objects..."); Objects2D.Clear(); Debug.Log(" Sound Instances..."); for (int i = 0; i < Sounds.Count; i++) { Sounds.Keys.ToArray()[i].Stop(); Sounds.Keys.ToArray()[i].Dispose(); } Sounds.Clear(); Debug.LogWarning("Disposing Timers..."); Time.Timers.Clear(); Debug.LogWarning("Restarting Loops..."); Rander.Game.FixedUpdate(); Debug.LogSuccess("--- LEVEL CLEAR SUCCESS ---"); Game.PauseGame = false; }