예제 #1
0
        /// <summary>
        /// Add a screen to the manager.
        /// </summary>
        /// <param name="screen">A class that inheritted the screen class</param>
        public void AddScreen(Screen screen)
        {
            screen.Manager = this;

            /** Make sure that the content needed is loaded since initialization is only called once. */
            screen.Initialize();
            screen.TransitionEvent -= TransitionEventManager;
            screen.TransitionEvent += TransitionEventManager;

            ScreenList.Add(screen);
        }
예제 #2
0
        /// <summary>
        /// Remove a screen from the manager.
        /// </summary>
        /// <param name="screen">A class that inheritted the screen class</param>
        public void RemoveScreen(Screen screen)
        {
            if (isInitialized)
            {
                screen.UnloadContent();
                screen.TransitionEvent -= TransitionEventManager;
            }

            ScreenList.Remove(screen);
        }