123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- using System;
- using UnityEngine;
- using SC.InputSystem;
- using SC.InputSystem.InputDeviceHead;
- using SC.InputSystem.InputDeviceHandShank;
- using SC.InputSystem.InputDevice26DofGesture;
- public class API_InputSystem {
-
-
-
-
-
- public static InputSystem GetInstant() {
- return InputSystem.Instant;
- }
-
-
-
-
-
- public static bool IsISInitialized() {
- if(InputSystem.Instant) {
- return InputSystem.Instant.Initialize;
- }
- return false;
- }
-
-
-
-
-
- public static void AddInitializedCallBack(Action action) {
- InputSystem.ISInitializeCallBack += action;
- }
-
- public static void RemoveInitializedCallBack(Action action) {
- InputSystem.ISInitializeCallBack -= action;
- }
-
-
-
-
-
- public static void EnableInputDeivce(InputDeviceType inputDevice) {
- if(InputSystem.Instant) {
- InputSystem.Instant.RegisterInputDevice(inputDevice);
- }
- }
-
-
-
-
-
- public static void DisableInputDeivce(InputDeviceType inputDevice) {
- if(InputSystem.Instant) {
- InputSystem.Instant.UnRegisterInputDevice(inputDevice);
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public static GameObject Target {
- get {
- if(API_InputSystem_Head.Head != null) {
- return API_InputSystem_Head.HeadHitTarget;
- } else if(API_InputSystem_Bluetooth.BTRight != null) {
- return API_InputSystem_Bluetooth.BTHitTarget(API_InputSystem_Bluetooth.BTType.Right);
- } else if(API_InputSystem_Bluetooth.BTLeft != null) {
- return API_InputSystem_Bluetooth.BTHitTarget(API_InputSystem_Bluetooth.BTType.Left);
- } else if(API_InputSystem_Gesture26Dof.GTRight != null) {
- return API_InputSystem_Gesture26Dof.GTHitTarget(API_InputSystem_Gesture26Dof.GestureType.Right);
- } else if(API_InputSystem_Gesture26Dof.GTLeft != null) {
- return API_InputSystem_Gesture26Dof.GTHitTarget(API_InputSystem_Gesture26Dof.GestureType.Left);
- }
- return null;
- }
- }
-
-
-
-
- public static GameObject Gazer {
- get {
- if(API_InputSystem_Head.Head != null) {
- return API_InputSystem_Head.Head.inputDeviceUIBase.model.lineIndicate.StartPoint.gameObject;
- } else if(API_InputSystem_Bluetooth.BTRight != null) {
- return API_InputSystem_Bluetooth.BTRight.inputDeviceUIBase.model.lineIndicate.StartPoint.gameObject;
- } else if(API_InputSystem_Bluetooth.BTLeft != null) {
- return API_InputSystem_Bluetooth.BTLeft.inputDeviceUIBase.model.lineIndicate.StartPoint.gameObject;
- } else if(API_InputSystem_Gesture26Dof.GTRight != null) {
- return API_InputSystem_Gesture26Dof.GTRight.inputDeviceUIBase.model.lineIndicate.StartPoint.gameObject;
- } else if(API_InputSystem_Gesture26Dof.GTLeft != null) {
- return API_InputSystem_Gesture26Dof.GTLeft.inputDeviceUIBase.model.lineIndicate.StartPoint.gameObject;
- }
- return null;
- }
- }
-
-
-
-
- public static Vector3 Normal {
- get {
- if(Gazer!=null) {
- return Gazer.transform.forward;
- }
- return Vector3.zero;
- }
- }
-
-
-
-
- public static Vector3 Position {
- get {
- if(API_InputSystem_Head.Head != null) {
- return API_InputSystem_Head.GetHeadFocus.transform.position;
- } else if(API_InputSystem_Bluetooth.BTRight != null) {
- return API_InputSystem_Bluetooth.GetBTFocus(API_InputSystem_Bluetooth.BTType.Right).transform.position;
- } else if(API_InputSystem_Bluetooth.BTLeft != null) {
- return API_InputSystem_Bluetooth.GetBTFocus(API_InputSystem_Bluetooth.BTType.Left).transform.position;
- } else if(API_InputSystem_Gesture26Dof.GTRight != null) {
- return API_InputSystem_Gesture26Dof.GetGTFocus(API_InputSystem_Gesture26Dof.GestureType.Right).transform.position;
- } else if(API_InputSystem_Gesture26Dof.GTLeft != null) {
- return API_InputSystem_Gesture26Dof.GetGTFocus(API_InputSystem_Gesture26Dof.GestureType.Left).transform.position;
- }
- return Vector3.zero;
- }
- }
-
-
-
-
- public static InputDevicePartBase InputDeviceCurrent {
- get {
- if(API_InputSystem_Head.Head != null) {
- return API_InputSystem_Head.Head;
- } else if(API_InputSystem_Bluetooth.BTRight != null) {
- return API_InputSystem_Bluetooth.BTRight;
- } else if(API_InputSystem_Bluetooth.BTLeft != null) {
- return API_InputSystem_Bluetooth.BTLeft;
- } else if(API_InputSystem_Gesture26Dof.GTRight != null) {
- return API_InputSystem_Gesture26Dof.GTRight;
- } else if(API_InputSystem_Gesture26Dof.GTLeft != null) {
- return API_InputSystem_Gesture26Dof.GTLeft;
- }
- return null;
- }
- }
- }
|