// Update is called once per frame void Update() { if (isOpen) { return; } UIController.ChangeChoice(MenuItems, choiceElement); if (MyInput.isButtonDown()) { choiceElement -= (int)MyInput.direction().y; if (choiceElement < 0) { choiceElement = 0; } if (choiceElement >= MenuItems.Length) { choiceElement = MenuItems.Length - 1; } } if (Input.GetKeyDown(KeyCode.Return) && ItemWindows[choiceElement] != null) { ItemWindows[choiceElement].SetActive(true); isOpen = true; } if (Input.GetKeyDown(KeyCode.Backspace)) { this.gameObject.SetActive(false); } }
// Update is called once per frame void Update() { if (isOpen) { return; } UIController.ChangeChoice(objList, choiceElement); if (MyInput.isButtonDown()) { choiceElement -= (int)MyInput.direction().y; if (choiceElement < 0) { choiceElement = 0; } if (choiceElement >= objList.Length) { choiceElement = objList.Length - 1; } } if (Input.GetKeyDown(KeyCode.Return)) { StatusWindow.SetActive(true); status.Param = playerList[choiceElement]; isOpen = true; } if (Input.GetKeyDown(KeyCode.Backspace)) { menu.IsOpen = false; this.gameObject.SetActive(false); } }