123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413 |
- 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<SDKConfigTranslation>();
- }
- return mInstance;
- }
- }
- SDKConfiguration SDKConfiguration;
- public List<Section> Configs;
- private void Awake()
- {
- Configs = new List<Section>();
- if (SDKConfiguration == null)
- {
- SDKConfiguration = Resources.Load<SDKConfiguration>("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<KEY_VALUE>(){
- 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<KEY_VALUE>(){
- 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<KEY_VALUE>(){
- 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<KEY_VALUE>(){
- 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<KEY_VALUE>(){
- 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";
- }
- }
- }
|