Ejemplo n.º 1
0
        public static void changeScreen(UserControl current, string next)
        {
            //tmp is set to the form that this control is on
            Form tmp = current.FindForm();

            tmp.Controls.Remove(current);
            UserControl ns = null;

            switch (next)
            {
            case "GameScreen":
                ns = new GameScreen();
                break;

            case "InstructionScreen":
                ns = new InstructionScreen();
                break;

            case "MenuScreen":
                ns = new MenuScreen();
                break;

            case "OptionScreen":
                ns = new OptionScreen();
                break;

            case "ScoreScreen":
                ns = new ScoreScreen();
                break;
            }

            ns.Size     = new Size(controlWidth, controlHeight);
            ns.Location = startCentre;
            tmp.Controls.Add(ns);
            ns.Focus();
        }
Ejemplo n.º 2
0
 // override this if the screen prefab has scripts on it that need initialising
 protected virtual void HandleResourceLoaded(GameObject loadedObject)
 {
     Screen = GameManagerCore.Canvas.InstantiateBehindLoadingScreen(loadedObject).GetComponent <MenuScreen>();
 }