void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { myMenu.ShowMenu(); dummyCanvas.SetActive(!dummyCanvas.activeSelf); Debug.Log("Esc pressed..."); } }
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); }
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); }