public override void OnSCAwake() { base.OnSCAwake(); if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "GGT26DofHandDataLerp")) { try { LerpSpeed = API_Module_SDKConfiguration.GetFloat("Module_InputSystem", "GGT26DofHandDataLerp", 0); DebugMy.Log("Lerp From SDKConfig:" + LerpSpeed, this, true); } catch (Exception e) { Debug.Log(e); } } }
public override void OnSCAwake() { base.OnSCAwake(); if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "GGT26DofHandEffectDuration")) { try { EffectDuration = API_Module_SDKConfiguration.GetFloat("Module_InputSystem", "GGT26DofHandEffectDuration", 0); DebugMy.Log("EffectDuration From SDKConfig:" + EffectDuration, this, true); } catch (Exception e) { Debug.Log(e); } } }
public handInfo(string configPath) { if (Application.platform == RuntimePlatform.Android) { try { CommonConfig config; config = new CommonConfig(configPath); float x = 0, y = 0, z = 0; string xx = config.GetLineValue(1); x = float.Parse(xx != null ? xx : "0"); xx = config.GetLineValue(2); y = float.Parse(xx != null ? xx : "0"); xx = config.GetLineValue(3); z = float.Parse(xx != null ? xx : "0"); if (x > -10 && x < 10 && y > -10 && y < 10 && z > -10 && z < 10) { positionOffest = new Vector3(x, y, z); DebugMy.Log("Read " + configPath + "" + x + " " + y + " " + z, this, true); } config = null; } catch (Exception e) { Debug.Log(e); } Vector3 data = Vector3.zero; if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "GreyHandOffsetX")) { data.x = API_Module_SDKConfiguration.GetFloat("Module_InputSystem", "GreyHandOffsetX", 0); data.x = (data.x > -10 && data.x < 10) ? data.x : 0; } if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "GreyHandOffsetY")) { data.y = API_Module_SDKConfiguration.GetFloat("Module_InputSystem", "GreyHandOffsetY", 0); data.y = (data.y > -10 && data.y < 10) ? data.y : 0; } if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "GreyHandOffsetZ")) { data.z = API_Module_SDKConfiguration.GetFloat("Module_InputSystem", "GreyHandOffsetZ", 0); data.z = (data.z > -10 && data.z < 10) ? data.z : 0; } positionOffest = data; DebugMy.Log("ReadFromConfig positionOffest: " + "X:" + data.x + " Y:" + data.y + " Z:" + data.z, this, true); } }
public override void OnSCAwake() { base.OnSCAwake(); if (instance != null) { DestroyImmediate(gameObject); return; } DontDestroyOnLoad(gameObject); instance = this; DebugMy.Log("Awake", this, true); foreach (var inputDevice in inputDeviceSupportList) { AddModule(inputDevice); } initialize = true; IsRunning = true; initializeCallBack?.Invoke(); if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "ActiveHead")) { activeHead = API_Module_SDKConfiguration.GetBool("Module_InputSystem", "ActiveHead", 0); } if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "ActiveBT3Dof")) { activeBT3Dof = API_Module_SDKConfiguration.GetBool("Module_InputSystem", "ActiveBT3Dof", 0); } if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "ActiveKS")) { activeKS = API_Module_SDKConfiguration.GetBool("Module_InputSystem", "ActiveKS", 0); } if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "ActiveGGT26Dof")) { activeGGT26Dof = API_Module_SDKConfiguration.GetBool("Module_InputSystem", "ActiveGGT26Dof", 0); } }
protected virtual bool UpdateDeviceInfo(InputDeviceKSPart part, bool isClear = false) { if (isClear == true) { part.inputDataKS.GCType = GCType.Null; part.inputDataKS.GCName = ""; part.inputDataKS.SoftVesion = -1; part.inputDataKS.BatteryPower = -1; DebugMy.LogError("UpdateDeviceInfo Clear!", this); return(false); } KSIndex index = part.inputDataKS.ksIndex; if (index != KSIndex.Left && index != KSIndex.Right) { DebugMy.LogError("UpdateDeviceInfo Error:" + index, this); return(false); } try { int typeFlag = SvrPlugin.Instance.HandShank_Getbond((int)index); if (index == KSIndex.Left) { if ((int)KSTypeFlag.K11 == (typeFlag & 0xF)) { part.inputDataKS.GCType = GCType.K11; } else if ((int)KSTypeFlag.K101 == (typeFlag & 0xF)) { if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "UseK102Model")) { part.inputDataKS.GCType = API_Module_SDKConfiguration.GetBool("Module_InputSystem", "UseK102Model", 0) ? GCType.K102 : GCType.K101; } else { part.inputDataKS.GCType = GCType.K101; } } } else if (part.inputDataKS.ksIndex == KSIndex.Right) { if ((int)KSTypeFlag.K11 == ((typeFlag & 0xF0) >> 4)) { part.inputDataKS.GCType = GCType.K11; } else if ((int)KSTypeFlag.K101 == ((typeFlag & 0xF0) >> 4)) { if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "UseK102Model")) { part.inputDataKS.GCType = API_Module_SDKConfiguration.GetBool("Module_InputSystem", "UseK102Model", 0) ? GCType.K102 : GCType.K101; } else { part.inputDataKS.GCType = GCType.K101; } } } if (part.inputDataKS.GCType != GCType.K11 && part.inputDataKS.GCType != GCType.K101 && part.inputDataKS.GCType != GCType.K102) { DebugMy.LogError("UpdateDeviceInfo Error:" + part.inputDataKS.GCType, this); return(false); } part.inputDataKS.GCName = part.inputDataKS.GCType.ToString(); part.inputDataKS.SoftVesion = SvrPlugin.Instance.HandShank_GetVersion((int)index); part.inputDataKS.BatteryPower = SvrPlugin.Instance.HandShank_GetBattery((int)index); if (part.PostureType == PostureType.UnKown) { if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "KSMode6Dof")) { part.PostureType = API_Module_SDKConfiguration.GetBool("Module_InputSystem", "KSMode6Dof", 0) ? PostureType._6Dof : PostureType._3Dof; } } DebugMy.Log("UpdateDeviceInfo : " + " isConnected=" + part.inputDataKS.isConnected + " GCName=" + part.inputDataKS.GCName + " PostureType=" + part.PostureType + " SoftVesion=" + part.inputDataKS.SoftVesion + " BatteryPower=" + part.inputDataKS.BatteryPower , this, true); } catch (Exception e) { Debug.Log(e); } return(true); }
public override void OnSCAwake() { base.OnSCAwake(); if (inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.PartType == InputDevicePartType.KSLeft) { if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "K11_Left_EnterKeyAlias")) { InputKeyCode keyparse; inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.EnterKeyAlias = System.Enum.TryParse <InputKeyCode>(API_Module_SDKConfiguration.GetString("Module_InputSystem", "K11_Left_EnterKeyAlias", "LTrigger"), false, out keyparse) ? keyparse : InputKeyCode.LTrigger; } else { inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.EnterKeyAlias = InputKeyCode.LTrigger; } } else if (inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.PartType == InputDevicePartType.KSRight) { if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "K11_Right_EnterKeyAlias")) { InputKeyCode keyparse; inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.EnterKeyAlias = System.Enum.TryParse <InputKeyCode>(API_Module_SDKConfiguration.GetString("Module_InputSystem", "K11_Right_EnterKeyAlias", "RTrigger"), false, out keyparse) ? keyparse : InputKeyCode.RTrigger; } else { inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.EnterKeyAlias = InputKeyCode.RTrigger; } } DebugMy.Log(inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.PartType + " inputDataGetKSKey.EnterKeyAlias:" + inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.EnterKeyAlias, this, true); if (inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.PartType == InputDevicePartType.KSLeft) { if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "K11_Left_CalibrationKeyAlias")) { InputKeyCode keyparse; inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.CalibrationKeyAlias = System.Enum.TryParse <InputKeyCode>(API_Module_SDKConfiguration.GetString("Module_InputSystem", "K11_Left_CalibrationKeyAlias", "DOWN"), false, out keyparse) ? keyparse : InputKeyCode.DOWN; } else { inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.CalibrationKeyAlias = InputKeyCode.DOWN; } } else if (inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.PartType == InputDevicePartType.KSRight) { if (API_Module_SDKConfiguration.HasKey("Module_InputSystem", "K11_Right_CalibrationKeyAlias")) { InputKeyCode keyparse; inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.CalibrationKeyAlias = System.Enum.TryParse <InputKeyCode>(API_Module_SDKConfiguration.GetString("Module_InputSystem", "K11_Right_CalibrationKeyAlias", "A"), false, out keyparse) ? keyparse : InputKeyCode.A; } else { inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.CalibrationKeyAlias = InputKeyCode.A; } } DebugMy.Log(inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.PartType + " inputDataGetKSKey.CalibrationKeyAlias:" + inputDataGetKSKey.inputDataGetKS.inputDeviceKSPart.inputDataGC.CalibrationKeyAlias, this, true); }