NormalInput.cs 839 B

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine;
  2. using UnityEngine.EventSystems;
  3. namespace Rokid.UXR.Interaction
  4. {
  5. public class NormalInput : BaseInput
  6. {
  7. public override bool mousePresent => true;
  8. public override bool touchSupported => true;
  9. public override int touchCount => 0;
  10. private bool mouseActive = false;
  11. public override bool GetMouseButtonDown(int button)
  12. {
  13. return Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.JoystickButton0);
  14. }
  15. public override bool GetMouseButtonUp(int button)
  16. {
  17. return Input.GetMouseButtonUp(0) || Input.GetKeyUp(KeyCode.JoystickButton0);
  18. }
  19. public override bool GetMouseButton(int button)
  20. {
  21. return Input.GetMouseButton(0) || Input.GetKey(KeyCode.JoystickButton0);
  22. }
  23. }
  24. }