示例#1
0
        public void ShowScreen <T>() where T : BaseScreen
        {
            var screen = screens.Find(x => x is T);

            if (screen == null)
            {
                throw new Exception("Unknown screen " + typeof(T).Name);
            }

            if (screen != activeScreen)
            {
                if (activeScreen != null)
                {
                    activeScreen.Hide();
                }

                activeScreen     = screen;
                guiSystem.Screen = screen.Gui;
                activeScreen.Show();
            }
        }
示例#2
0
 public void RegisterScreen(BaseScreen screen)
 {
     screen.Build(this, contentManager);
     screens.Add(screen);
 }