Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
726 B

  1. namespace VRTK.Examples
  2. {
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class UI_Keyboard : MonoBehaviour
  6. {
  7. private InputField input;
  8. public void ClickKey(string character)
  9. {
  10. input.text += character;
  11. }
  12. public void Backspace()
  13. {
  14. if (input.text.Length > 0)
  15. {
  16. input.text = input.text.Substring(0, input.text.Length - 1);
  17. }
  18. }
  19. public void Enter()
  20. {
  21. VRTK_Logger.Info("You've typed [" + input.text + "]");
  22. input.text = "";
  23. }
  24. private void Start()
  25. {
  26. input = GetComponentInChildren<InputField>();
  27. }
  28. }
  29. }