private IEnumerator DeleayedSelection(ColliderEventData eventData) { float fadeTime = colors.fadeDuration, elapsedTime = 0f; DoStateTransition(SelectionState.Highlighted, false); while (elapsedTime < fadeTime) { elapsedTime += Time.unscaledDeltaTime; yield return(null); } if (autoSelection) { DoStateTransition(SelectionState.Pressed, true); } // if autoSubmission is true the button will submit automatically, // this can be useful for gaze based interaction where hovering will already submit the button. if (autoSubmission) { #if using_collision_events OnSubmitDelayed(eventData); #endif } }
public void OnSubmitDelayed(ColliderEventData eventData) { //DoStateTransition(SelectionState.Pressed, false); StartCoroutine(FinishSubmit()); events.onSubmitDelayed.Invoke(eventData); if (debug) { log.InfoMS("Deleayed Submitted"); } }
private void OnTriggerEnter(Collider other) { //Debug.Log(other.gameObject.name); if (other.gameObject.GetComponent <AdvancedButton>() != null) { Debug.Log("is advanced button"); try { button = other.GetComponent <AdvancedButton>(); TouchButton.Invoke(); //button.OnSelect(eventDataB); //button.OnPointerEnter(eventDataP); colliderEventData = new ColliderEventData(this.gameObject, button.gameObject); // TODO: @msaw - if we dont need the trigger enter on the button and finger we can work around this //button.OnTriggerEnters(colliderEventData); } catch (System.Exception ex) { Debug.Log(ex); } } if (other.gameObject.name == "OpenUITrigger") { // open the 3d UI if (MainMenu != null) { OpenMainMenu(); } //MainMenue.Open(); Debug.Log("OpenUITrigger collision detected"); } }