InputDeviceHand.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using UnityEngine;
  9. namespace SC.XR.Unity.Module_InputSystem.InputDeviceHand {
  10. public class InputDeviceHand : InputDeviceBase {
  11. [Header("Show Hands Information")]
  12. public bool ShowHandsInfo = false;
  13. public TextMesh handsText;
  14. [Header("Enable Hands")]
  15. public bool LeftHandOpen = false;
  16. public bool RightHandOpen = true;
  17. [SerializeField]
  18. private bool EditorHideRight = true;
  19. public override InputDeviceType inputDeviceType {
  20. get {
  21. return InputDeviceType.UnKnow;
  22. }
  23. }
  24. protected override void InputDeviceStart() {
  25. SetActiveInputDevicePart(InputDevicePartType.HandLeft, LeftHandOpen);
  26. if(Application.platform == RuntimePlatform.Android)
  27. SetActiveInputDevicePart(InputDevicePartType.HandRight, RightHandOpen);
  28. else if(EditorHideRight == false) {
  29. SetActiveInputDevicePart(InputDevicePartType.HandRight, EditorHideRight == true? false:RightHandOpen);
  30. }
  31. }
  32. }
  33. }