123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- using System;
- using UnityEngine;
- using SC.InputSystem;
- using SC.InputSystem.InputDeviceHead;
- using SC.InputSystem.InputDeviceHandShank;
- using SC.InputSystem.InputDevice26DofGesture;
- public class API_InputSystem_Gesture26Dof {
-
-
-
-
-
- public static InputDevice26DofGesture Gesture26Dof {
- get {
- if(InputSystem.Instant) {
- return InputSystem.Instant.Gesture26Dof;
- }
- return null;
- }
- }
- public enum GestureType {
- Left=0,
- Right=1,
- }
-
-
-
-
- public static InputDevice26DofGesturePart GTLeft {
- get {
- if(Gesture26Dof && Gesture26Dof.InputDevice26DofGesturePartList[0]) {
- return Gesture26Dof.InputDevice26DofGesturePartList[0].inputDataBase.isVaild ? Gesture26Dof.InputDevice26DofGesturePartList[0] : null;
- }
- return null;
- }
- }
-
-
-
-
- public static InputDevice26DofGesturePart GTRight {
- get {
- if(Gesture26Dof && Gesture26Dof.InputDevice26DofGesturePartList[1]) {
- return Gesture26Dof.InputDevice26DofGesturePartList[1].inputDataBase.isVaild ? Gesture26Dof.InputDevice26DofGesturePartList[1] : null;
- }
- return null;
- }
- }
-
-
-
-
-
-
- public static handInfo GThandInfo(GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- return GTLeft.inputData26DofGesture.handInfo;
- } else if(GTRight && type == GestureType.Right) {
- return GTRight.inputData26DofGesture.handInfo;
- }
- return null;
- }
-
-
-
-
-
-
- public static SCPointEventData GTPointerEventData(GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- return GTLeft.inputDataBase.pointerEventData;
- } else if(GTRight && type == GestureType.Right) {
- return GTRight.inputDataBase.pointerEventData;
- }
- return null;
- }
-
-
-
-
-
-
- public static GameObject GTHitTarget(GestureType type = GestureType.Right) {
- if(GTPointerEventData(type) != null) {
- return GTPointerEventData(type).target;
- }
- return null;
- }
-
-
-
-
-
- public static RaycastHit GTHitInfo(GestureType type = GestureType.Right) {
- if(GTPointerEventData(type) != null) {
- return GTPointerEventData(type).hitinfo;
- }
- return new RaycastHit();
- }
-
-
-
-
- public static GameObject GTDragTarget(GestureType type = GestureType.Right) {
- if(GTPointerEventData(type) != null) {
- return GTPointerEventData(type).dragTarget;
- }
- return null;
- }
-
-
-
-
-
-
- public static bool IsGTKeyDown(InputKeyCode inputKeyCode, GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- return GTLeft.inputDataBase.GetKeyDown(inputKeyCode);
- } else if(GTRight && type == GestureType.Right) {
- return GTRight.inputDataBase.GetKeyDown(inputKeyCode);
- }
- return false;
- }
-
-
-
-
-
-
- public static bool IsGTKeyUp(InputKeyCode inputKeyCode, GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- return GTLeft.inputDataBase.GetKeyUp(inputKeyCode);
- } else if(GTRight && type == GestureType.Right) {
- return GTRight.inputDataBase.GetKeyUp(inputKeyCode);
- }
- return false;
- }
-
-
-
-
-
-
- public static InputKeyState GTKeyState(InputKeyCode inputKeyCode, GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- return GTLeft.inputDataBase.GetKeyState(inputKeyCode);
- } else if(GTRight && type == GestureType.Right) {
- return GTRight.inputDataBase.GetKeyState(inputKeyCode);
- }
- return InputKeyState.Null;
- }
-
-
-
-
-
-
- public static InputKeyState GTKeyCurrentState(InputKeyCode inputKeyCode, GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- return GTLeft.inputDataBase.GetKeyCurrentState(inputKeyCode);
- } else if(GTRight && type == GestureType.Right) {
- return GTRight.inputDataBase.GetKeyCurrentState(inputKeyCode);
- }
- return InputKeyState.Null;
- }
-
-
-
-
-
-
- public static void GTKeyAddKey(InputKeyCode inputKeyCode, InputKeyState inputKeyState, GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- GTLeft.inputDataBase.InputDataAddKey(inputKeyCode, inputKeyState);
- } else if(GTRight && type == GestureType.Right) {
- GTRight.inputDataBase.InputDataAddKey(inputKeyCode, inputKeyState);
- }
- }
-
-
-
-
-
- public static void SetGTRayCastDistance(float distance, GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- GTLeft.inputDeviceTargetDetecterBase.MaxRaycastRange = distance;
- } else if(GTRight && type == GestureType.Right) {
- GTRight.inputDeviceTargetDetecterBase.MaxRaycastRange = distance;
- }
- }
-
-
-
-
-
- public static void SetGTEndPointerDistance(float distance, GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- GTLeft.inputDeviceTargetDetecterBase.MaxEndPointRange = distance;
- } else if(GTRight && type == GestureType.Right) {
- GTRight.inputDeviceTargetDetecterBase.MaxEndPointRange = distance;
- }
- }
-
-
-
-
-
- public static Focus GetGTFocus(GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- return GTLeft.inputDeviceUIBase.model.lineIndicate.focus;
- } else if(GTRight && type == GestureType.Right) {
- return GTRight.inputDeviceUIBase.model.lineIndicate.focus;
- }
- return null;
- }
-
-
-
-
-
- public static LineRenderer GetGTLine(GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- return GTLeft.inputDeviceUIBase.model.lineIndicate.line;
- } else if(GTRight && type == GestureType.Right) {
- return GTRight.inputDeviceUIBase.model.lineIndicate.line;
- }
- return null;
- }
-
-
-
-
-
- public static void EnableGT(GestureType type = GestureType.Right) {
- if(Gesture26Dof && type == GestureType.Left) {
- Gesture26Dof.LeftHandOpen = true;
- } else if(Gesture26Dof && type == GestureType.Right) {
- Gesture26Dof.RightHandOpen = true;
- }
- }
-
-
-
-
-
- public static void DisableableGT(GestureType type = GestureType.Right) {
- if(Gesture26Dof && type == GestureType.Left) {
- Gesture26Dof.LeftHandOpen = false;
- } else if(Gesture26Dof && type == GestureType.Right) {
- Gesture26Dof.RightHandOpen = false;
- }
- }
-
-
-
-
-
-
- public static Model26DofGesture.fingerUI[] GetFingerUI(GestureType type = GestureType.Right) {
- if(GTLeft && type == GestureType.Left) {
- return GTLeft.inputDevice26DofGestureUI.model26DofGesture.fingers;
- } else if(GTRight && type == GestureType.Right) {
- return GTRight.inputDevice26DofGestureUI.model26DofGesture.fingers;
- }
- return null;
- }
- }
|