using SC.XR.Unity.Module_InputSystem.InputDeviceGC.KS; using System.Collections; using System.Collections.Generic; using UnityEngine; public class API_SwitchMode { InputDeviceKSPart kspart; InputDeviceKS ks; public float _modelPosOffset = 0.15f; public float _delayOffset =0.3f; public void API_Set_Offset(float _modelPos,float _delay) { _modelPosOffset = _modelPos; _delayOffset = _delay; } public void API_GSXR_Set_TrackingMode(bool is6dof) { API_GSXR_Slam.plugin.GSXR_Set_6Dof(is6dof); ks = API_GSXR_Module_InputSystem_KS.GSXR_KSDevice; foreach (var item in ks.inputDevicePartList) { kspart = item as InputDeviceKSPart; if (!is6dof) { kspart.inputDataGetKS.inputDataGetKSPosture.isKS_3DofMode = true; kspart.inputDeviceKSPartUI.ModelGC._modelPositionDeltaWithDevice.z = _modelPosOffset; kspart.inputDataGetKS.inputDataGetKSPosture.delayOffset = -(Vector3.forward * _delayOffset); kspart.inputDataKS.PostureType = SC.XR.Unity.Module_InputSystem.InputDeviceGC.PostureType._3Dof; } else { kspart.inputDataGetKS.inputDataGetKSPosture.isKS_3DofMode = false; kspart.inputDeviceKSPartUI.ModelGC._modelPositionDeltaWithDevice.z = 0; kspart.inputDataGetKS.inputDataGetKSPosture.delayOffset = Vector3.zero; kspart.inputDataKS.PostureType = SC.XR.Unity.Module_InputSystem.InputDeviceGC.PostureType._6Dof; } } } }