using System.Collections; using System.Collections.Generic; using UnityEngine; namespace SC.XR.Unity { public class SDKConfigTranslation : MonoBehaviour { private static SDKConfigTranslation mInstance; public static SDKConfigTranslation getInstance { get { if (mInstance == null) { mInstance = new GameObject("SDKConfigurationAsset").AddComponent(); } return mInstance; } } SDKConfiguration SDKConfiguration; public List
Configs; private void Awake() { Configs = new List
(); if (SDKConfiguration == null) { SDKConfiguration = Resources.Load("SDKConfiguration"); DebugMy.Log("Load SDKConfiguration!", this, true); if (SDKConfiguration == null) { DebugMy.Log("SDKConfiguration Not Exist !", this, true); } } if (SDKConfiguration) { Configs.Add(new Section() { section = "Module_InputSystem", KEY_VALUE = new List(){ new KEY_VALUE() { Name = "ActiveHead", Value = GetBool(SDKConfiguration.InputSettings.ActivateDevice.Head) }, new KEY_VALUE() { Name = "ActiveGGT26Dof", Value = GetBool(SDKConfiguration.InputSettings.ActivateDevice.GGT26Dof) }, new KEY_VALUE() { Name = "ActiveBT3Dof", Value = GetBool(SDKConfiguration.InputSettings.ActivateDevice.BT3Dof) }, new KEY_VALUE() { Name = "ActiveKS", Value = GetBool(SDKConfiguration.InputSettings.ActivateDevice.KS) }, new KEY_VALUE() { Name = "KSModeSet3Dof", Value = GetBool(SDKConfiguration.InputSettings.KSModeSet3Dof) }, new KEY_VALUE() { Name = "UseK102Model", Value = GetBool(SDKConfiguration.InputSettings.UseK102Model) }, new KEY_VALUE() { Name = "GreyHandOffsetX", Value = SDKConfiguration.InputSettings.HandInputSettings.GreyHandOffset.x.ToString() }, new KEY_VALUE() { Name = "GreyHandOffsetY", Value = SDKConfiguration.InputSettings.HandInputSettings.GreyHandOffset.y.ToString() }, new KEY_VALUE() { Name = "GreyHandOffsetZ", Value = SDKConfiguration.InputSettings.HandInputSettings.GreyHandOffset.z.ToString() }, new KEY_VALUE() { Name = "K102PointerAngleOffsetX", Value = SDKConfiguration.InputSettings.K102PointerAngleOffset.x.ToString() }, new KEY_VALUE() { Name = "K102PointerAngleOffsetY", Value = SDKConfiguration.InputSettings.K102PointerAngleOffset.y.ToString() }, new KEY_VALUE() { Name = "K102PointerAngleOffsetZ", Value = SDKConfiguration.InputSettings.K102PointerAngleOffset.z.ToString() }, new KEY_VALUE() { Name = "FarPointerRotationOffsetX", Value = SDKConfiguration.InputSettings.HandInputSettings.FarPointerRotationOffset.x.ToString() }, new KEY_VALUE() { Name = "FarPointerRotationOffsetY", Value = SDKConfiguration.InputSettings.HandInputSettings.FarPointerRotationOffset.y.ToString() }, new KEY_VALUE() { Name = "FarPointerRotationOffsetZ", Value = SDKConfiguration.InputSettings.HandInputSettings.FarPointerRotationOffset.z.ToString() }, new KEY_VALUE() { Name = "GGT26DofHandDataLerp", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.HandDataLerp) }, new KEY_VALUE() { Name = "GGT26DofHandEffectColor", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.HandEffectColor) }, new KEY_VALUE() { Name = "K11_Left_EnterKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K11_Left_Enter.ToString() }, new KEY_VALUE() { Name = "K11_Right_EnterKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K11_Right_Enter.ToString() }, new KEY_VALUE() { Name = "K101_Left_EnterKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K101_Left_Enter.ToString() }, new KEY_VALUE() { Name = "K101_Right_EnterKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K101_Right_Enter.ToString() }, new KEY_VALUE() { Name = "K102_Left_EnterKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K102_Left_Enter.ToString() }, new KEY_VALUE() { Name = "K102_Right_EnterKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K102_Right_Enter.ToString() }, new KEY_VALUE() { Name = "K101_Left_CalibrationKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K101_Left_Calibration.ToString() }, new KEY_VALUE() { Name = "K101_Right_CalibrationKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K101_Right_Calibration.ToString() }, new KEY_VALUE() { Name = "K102_Left_CalibrationKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K102_Left_Calibration.ToString() }, new KEY_VALUE() { Name = "K102_Right_CalibrationKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K102_Right_Calibration.ToString() }, new KEY_VALUE() { Name = "K11_Left_CalibrationKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K11_Left_Calibration.ToString() }, new KEY_VALUE() { Name = "K11_Right_CalibrationKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K11_Right_Calibration.ToString() }, new KEY_VALUE() { Name = "K11_Left_AnotherEnterKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K11_Left_AnotherEnter.ToString() }, new KEY_VALUE() { Name = "K11_Right_AnotherEnterKeyAlias", Value = SDKConfiguration.InputSettings.KeyAliasSettings.K11_Right_AnotherEnter.ToString() }, new KEY_VALUE() { Name = "ISGCPriorityGGT26Dof", Value = GetBool(SDKConfiguration.InputSettings.IsGCPriorityGGT26Dof) }, new KEY_VALUE() { Name = "ShowHandLowPower", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.ShowHandLowPower) }, new KEY_VALUE() { Name = "ShowHandCursor", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.ShowHandCursor) }, new KEY_VALUE() { Name = "ShowHandLine", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.ShowHandLine) }, new KEY_VALUE() { Name = "OutCameraShowHandLine", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.OutCameraShowHandLine) }, new KEY_VALUE() { Name = "ShowHandRender", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.ShowHandRender) }, new KEY_VALUE() { Name = "HandRenderEMISSIONIntensity", Value = SDKConfiguration.InputSettings.HandInputSettings.HandRenderEmissionIntensity.ToString() }, new KEY_VALUE() { Name = "HandModelType", Value = SDKConfiguration.InputSettings.HandInputSettings.HandModelType.ToString() }, new KEY_VALUE() { Name = "handMainColorR", Value = SDKConfiguration.InputSettings.HandInputSettings.HandMainColor.r.ToString() }, new KEY_VALUE() { Name = "handMainColorG", Value = SDKConfiguration.InputSettings.HandInputSettings.HandMainColor.g.ToString() }, new KEY_VALUE() { Name = "handMainColorB", Value = SDKConfiguration.InputSettings.HandInputSettings.HandMainColor.b.ToString() }, new KEY_VALUE() { Name = "handMainColorA", Value = SDKConfiguration.InputSettings.HandInputSettings.HandMainColor.a.ToString() }, new KEY_VALUE() { Name = "EnableHandFarInteraction", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.EnableHandFarInteraction) }, new KEY_VALUE() { Name = "EnableHandTouchInteraction", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.EnableHandTouchInteraction) }, new KEY_VALUE() { Name = "EnableHandGrabInteraction", Value = GetBool(SDKConfiguration.InputSettings.HandInputSettings.EnableHandGrabInteraction) }, new KEY_VALUE() { Name = "EnableK102HandAnimation", Value = GetBool(SDKConfiguration.InputSettings.EnableK102HandAnimation) }, new KEY_VALUE() { Name = "KS_ShowLog", Value = GetBool(SDKConfiguration.InputSettings.KS_ShowLog) }, new KEY_VALUE() { Name = "ShowDebugLog", Value = GetBool(SDKConfiguration.InputSettings.ShowDebugLog) }, } }); Configs.Add(new Section() { section = "Module_Slam", KEY_VALUE = new List(){ new KEY_VALUE() { Name = "IsUseOpticsCalibration", Value = GetBool(SDKConfiguration.SlamSettings.UseOpticsCalibration) }, new KEY_VALUE() { Name = "trackPositionScale", Value = SDKConfiguration.SlamSettings.trackPositionScale.ToString() }, new KEY_VALUE() { Name = "IsSlamUse3Dof", Value = GetBool(SDKConfiguration.SlamSettings.SlamUse3Dof) }, new KEY_VALUE() { Name = "LeftShoulderX", Value = SDKConfiguration.SlamSettings.LeftShoulder.x.ToString() }, new KEY_VALUE() { Name = "LeftShoulderY", Value = SDKConfiguration.SlamSettings.LeftShoulder.y.ToString() }, new KEY_VALUE() { Name = "LeftShoulderZ", Value = SDKConfiguration.SlamSettings.LeftShoulder.z.ToString() }, new KEY_VALUE() { Name = "IsCreateDepthRT", Value = GetBool(SDKConfiguration.SlamSettings.CreateDepthRT) }, new KEY_VALUE() { Name = "isUseSingleView", Value = GetBool(SDKConfiguration.SlamSettings.UseSingleView) }, }}) ; Configs.Add(new Section() { section = "Module_DetectorSystem", KEY_VALUE = new List(){ new KEY_VALUE() { Name = "ActiveBatteryDetector", Value = GetBool(SDKConfiguration.DetectorSettings.ActivateDetector.Battery) }, new KEY_VALUE() { Name = "ActiveLanguageDetector", Value = GetBool(SDKConfiguration.DetectorSettings.ActivateDetector.Language) }, new KEY_VALUE() { Name = "ActiveNoNetworkDetector", Value = GetBool(SDKConfiguration.DetectorSettings.ActivateDetector.NoNetwork) }, new KEY_VALUE() { Name = "ActiveNoticeDetector", Value = GetBool(SDKConfiguration.DetectorSettings.ActivateDetector.Notice) }, new KEY_VALUE() { Name = "ActiveRecorderDetector", Value = GetBool(SDKConfiguration.DetectorSettings.ActivateDetector.Recorder) }, new KEY_VALUE() { Name = "ActiveVolumeDetector", Value = GetBool(SDKConfiguration.DetectorSettings.ActivateDetector.Volume) } } }); Configs.Add(new Section() { section = "Module_QuitApp", KEY_VALUE = new List(){ new KEY_VALUE() { Name = "UseQuitKeyCodeList", Value = GetBool(SDKConfiguration.QuitAppSettings.UseQuitKeyCodeList) }, new KEY_VALUE() { Name = "UseLongPress", Value = GetBool(SDKConfiguration.QuitAppSettings.UseLongPress) } }}); Configs.Add(new Section() { section = "Module_SDKSystem", KEY_VALUE = new List(){ new KEY_VALUE() { Name = "IsUseSafetyAreaHeight", Value = GetBool(SDKConfiguration.SDKSystemSettings.UseSafetyAreaHeight) }, new KEY_VALUE() { Name = "IsDontDestroyOnLoad", Value = GetBool(SDKConfiguration.SDKSystemSettings.IsDontDestroyOnLoad) } } }); } } private string GetBool(bool value) { if (value == true) { return "1"; } else return "0"; } } }