示例#1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            myMenu.ShowMenu();
            dummyCanvas.SetActive(!dummyCanvas.activeSelf);

            Debug.Log("Esc pressed...");
        }
    }
示例#2
0
        public static void ShowSubMenu()
        {
            ConsoleKeyInfo pressedKey;
            bool           exitProgram = false;

            var menu = new MenuCreator <int>();

            menu.AddMenuItem(ShowRandomValue, "Operacja 0", 10);
            menu.AddMenuItem(ShowRandomValue, "Operacja 1", 20);
            menu.AddMenuItem(ShowRandomValue, "Operacja 2", 30);
            menu.AddMenuItem(ShowRandomValue, "Operacja 3", 40);
            menu.AddMenuItem(ShowMainMenu, "Powrót do pierwszego menu");

            pressedKey = menu.ShowMenu(ref exitProgram);
        }
示例#3
0
        private static void ShowMainMenu()
        {
            ConsoleKeyInfo pressedKey;
            bool           exitProgram = false;

            var menu = new MenuCreator <int>();

            menu.AddMenuItem(ShowSubMenu, "Show sub menu");
            menu.AddMenuItem(ShowRandomValue, "Operacja 1", 20);
            menu.AddMenuItem(ShowRandomValue, "Operacja 2", 30);
            menu.AddMenuItem(ShowRandomValue, "Operacja 3", 40);
            menu.AddMenuItem(ShowHelloWord, "Show hello world");

            pressedKey = menu.ShowMenu(ref exitProgram);
        }