8 using System.Collections;
11 namespace Valve.VR.InteractionSystem
16 private Coroutine buttonHintCoroutine;
17 private Coroutine textHintCoroutine;
20 public void ShowButtonHints(
Hand hand )
22 if ( buttonHintCoroutine != null )
24 StopCoroutine( buttonHintCoroutine );
26 buttonHintCoroutine = StartCoroutine( TestButtonHints( hand ) );
31 public void ShowTextHints(
Hand hand )
33 if ( textHintCoroutine != null )
35 StopCoroutine( textHintCoroutine );
37 textHintCoroutine = StartCoroutine( TestTextHints( hand ) );
42 public void DisableHints()
44 if ( buttonHintCoroutine != null )
46 StopCoroutine( buttonHintCoroutine );
47 buttonHintCoroutine = null;
50 if ( textHintCoroutine != null )
52 StopCoroutine( textHintCoroutine );
53 textHintCoroutine = null;
58 ControllerButtonHints.HideAllButtonHints( hand );
59 ControllerButtonHints.HideAllTextHints( hand );
67 private IEnumerator TestButtonHints(
Hand hand )
69 ControllerButtonHints.HideAllButtonHints( hand );
73 ControllerButtonHints.ShowButtonHint( hand, EVRButtonId.k_EButton_ApplicationMenu );
74 yield
return new WaitForSeconds( 1.0f );
75 ControllerButtonHints.ShowButtonHint( hand, EVRButtonId.k_EButton_System );
76 yield
return new WaitForSeconds( 1.0f );
77 ControllerButtonHints.ShowButtonHint( hand, EVRButtonId.k_EButton_Grip );
78 yield
return new WaitForSeconds( 1.0f );
79 ControllerButtonHints.ShowButtonHint( hand, EVRButtonId.k_EButton_SteamVR_Trigger );
80 yield
return new WaitForSeconds( 1.0f );
81 ControllerButtonHints.ShowButtonHint( hand, EVRButtonId.k_EButton_SteamVR_Touchpad );
82 yield
return new WaitForSeconds( 1.0f );
84 ControllerButtonHints.HideAllButtonHints( hand );
85 yield
return new WaitForSeconds( 1.0f );
93 private IEnumerator TestTextHints(
Hand hand )
95 ControllerButtonHints.HideAllTextHints( hand );
99 ControllerButtonHints.ShowTextHint( hand, EVRButtonId.k_EButton_ApplicationMenu,
"Application" );
100 yield
return new WaitForSeconds( 3.0f );
101 ControllerButtonHints.ShowTextHint( hand, EVRButtonId.k_EButton_System,
"System" );
102 yield
return new WaitForSeconds( 3.0f );
103 ControllerButtonHints.ShowTextHint( hand, EVRButtonId.k_EButton_Grip,
"Grip" );
104 yield
return new WaitForSeconds( 3.0f );
105 ControllerButtonHints.ShowTextHint( hand, EVRButtonId.k_EButton_SteamVR_Trigger,
"Trigger" );
106 yield
return new WaitForSeconds( 3.0f );
107 ControllerButtonHints.ShowTextHint( hand, EVRButtonId.k_EButton_SteamVR_Touchpad,
"Touchpad" );
108 yield
return new WaitForSeconds( 3.0f );
110 ControllerButtonHints.HideAllTextHints( hand );
111 yield
return new WaitForSeconds( 3.0f );