Example #1
0
        /// <summary>
        /// Associates a SceneState with a Scene and optionally switches to that scene.
        /// </summary>
        /// <param name="state">The desired ScreenState to associate with the Scene</param>
        /// <param name="scene">The desired Scene</param>
        /// <param name="change">true if the game should switch to that scene</param>
        public void setScene(SceneState state, Scene scene, bool change)
        {
            registerScene(scene, state);

            if(change)
                changeScene(state);
        }
Example #2
0
        /// <summary>
        /// Adds a new screen to the screen manager.
        /// </summary>
        public void registerScene(Scene scene, SceneState state)
        {
            scene.SceneManager = this;

            // If we have a graphics device, tell the scene to load content.
            if (isInitialized)
            {
                scene.loadScene(content);
            }

            scenes[(int)state] = scene;
        }