SelectRobot_Hints.cs 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SelectRobot_Hints.cs
  2. * author: Yannic Seidler
  3. */
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using UnityEngine;
  7. using Valve.VR;
  8. using Valve.VR.InteractionSystem;
  9. // Class that shows a hint for a button that can be used to select the robot for simulation.
  10. // Attached to GameObject Hints (Scene: SelectRobot)
  11. public class SelectRobot_Hints : MonoBehaviour
  12. {
  13. SteamVR_Action_Boolean select;
  14. // Start is called before the first frame update.
  15. void Start()
  16. {
  17. select = SteamVR_Input.GetBooleanAction("SelectRobotWithLaser");
  18. }
  19. // Update is called once per frame.
  20. void Update()
  21. {
  22. try
  23. {
  24. if (!ControllerButtonHints.IsButtonHintActive(Player.instance.rightHand, select))
  25. {
  26. ControllerButtonHints.ShowTextHint(Player.instance.rightHand, select, "Select Robot");
  27. }
  28. }
  29. catch (System.Exception e)
  30. {
  31. Debug.Log(e.Message);
  32. }
  33. }
  34. }