public void HideHelp() { SetPlayButtonInteractable(false); NavigationPointer mainMenuPointer = new NavigationPointer(screenCategory, mainMenuName); NavigationPointer helpPointer = new NavigationPointer(screenCategory, helpName); NavigationPointerData data = new NavigationPointerData(true); data.show.Add(mainMenuPointer); data.hide.Add(helpPointer); var temp = mainMenu.inAnimations.Copy(); mainMenu.inAnimations = firstInAnim.Copy(); UINavigation.Show(data.show, true); UINavigation.Hide(data.hide); UINavigation.AddItemToHistory(data); help1.Hide(true); help2.Hide(true); help3.Hide(true); mainMenu.inAnimations = temp; }
public void ShowHelp() { PlayerPrefsX.SetBool("first-time", false); SetPlayButtonInteractable(false); NavigationPointer mainMenuPointer = new NavigationPointer(screenCategory, mainMenuName); NavigationPointer helpPointer = new NavigationPointer(screenCategory, helpName); NavigationPointer help1Pointer = new NavigationPointer(screenCategory, help1Name); NavigationPointerData data = new NavigationPointerData(true); data.show.Add(helpPointer); data.show.Add(help1Pointer); data.hide.Add(mainMenuPointer); var temp = mainMenu.outAnimations.Copy(); mainMenu.outAnimations = lastOutAnim.Copy(); UINavigation.Show(data.show); UINavigation.Hide(data.hide); UINavigation.AddItemToHistory(data); mainMenu.outAnimations = temp; }
void Update() { if (!cg.interactable) { return; } if (UIInput.isButtonNavigation) { // If directional key/axis is detected and nothing is selected, // selects the designated first element. Otherwise un-highlights // the object being moused over so that there is only one // highlighted object in the scene. See the function's summary. if (UIInput.selected == null) { if (first != null) { first.Select(); } } else { NavigationPointer.ResetObjectUnderPointer(); } } else if (UIInput.isBack && back != null) { if (UIInput.selected == back.gameObject) { back.onClick.Invoke(); } else { back.Select(); // Unlike with directional navigation, pressing the Cancel key/button // will not prevent the back button and the element being moused over // from being highlighted at the same time, even when that element is // told to leave the Highlighted state. // Adding this here completely snuffs out the problem, at the expense of // one coroutine produced on the frame the Cancel button is pressed. StartCoroutine(_Hack()); } } }
IEnumerator _Hack() { yield return(null); NavigationPointer.ResetObjectUnderPointer(); yield return(null); NavigationPointer.ResetObjectUnderPointer(); }