From 0998fe4a9b06be45c4ea6f0f70156ce5816d8493 Mon Sep 17 00:00:00 2001 From: xpeng <1216772231@qq.com> Date: Thu, 6 Oct 2022 23:50:57 +0200 Subject: [PATCH] fix button config issue and audio issue --- Assets/Default Lighting.lighting | 2 +- Assets/Scenes/WACVR.unity | 12 ++++++------ .../Configuration/ButtonSettingManager.cs | 2 ++ Assets/Script/Configuration/ConfigManager.cs | 18 +++++++++--------- Assets/Script/Essential/KeyDropdownManager.cs | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Assets/Default Lighting.lighting b/Assets/Default Lighting.lighting index f676897..6cc945a 100644 --- a/Assets/Default Lighting.lighting +++ b/Assets/Default Lighting.lighting @@ -16,7 +16,7 @@ LightingSettings: m_AlbedoBoost: 1 m_IndirectOutputScale: 1 m_UsingShadowmask: 0 - m_BakeBackend: 2 + m_BakeBackend: 1 m_LightmapMaxSize: 1024 m_BakeResolution: 256 m_Padding: 2 diff --git a/Assets/Scenes/WACVR.unity b/Assets/Scenes/WACVR.unity index 89dcae1..2408e07 100644 --- a/Assets/Scenes/WACVR.unity +++ b/Assets/Scenes/WACVR.unity @@ -1512,7 +1512,7 @@ AudioSource: serializedVersion: 4 OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: 2a2fbd11bfacc9a4daa238a38ecc91c9, type: 3} - m_PlayOnAwake: 1 + m_PlayOnAwake: 0 m_Volume: 1 m_Pitch: 1 Loop: 0 @@ -2222,7 +2222,7 @@ AudioSource: serializedVersion: 4 OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: 2a2fbd11bfacc9a4daa238a38ecc91c9, type: 3} - m_PlayOnAwake: 1 + m_PlayOnAwake: 0 m_Volume: 1 m_Pitch: 1 Loop: 0 @@ -31302,7 +31302,7 @@ PrefabInstance: - target: {fileID: 6563380807134184743, guid: 5da4516f609052242915c455fc208ca2, type: 3} propertyPath: m_Options.m_Options.Array.size - value: 1 + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 5da4516f609052242915c455fc208ca2, type: 3} @@ -31792,7 +31792,7 @@ PrefabInstance: - target: {fileID: 6563380807134184743, guid: 5da4516f609052242915c455fc208ca2, type: 3} propertyPath: m_Options.m_Options.Array.size - value: 1 + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 5da4516f609052242915c455fc208ca2, type: 3} @@ -33924,7 +33924,7 @@ PrefabInstance: - target: {fileID: 6563380807134184743, guid: 5da4516f609052242915c455fc208ca2, type: 3} propertyPath: m_Options.m_Options.Array.size - value: 1 + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 5da4516f609052242915c455fc208ca2, type: 3} @@ -34235,7 +34235,7 @@ PrefabInstance: - target: {fileID: 6563380807134184743, guid: 5da4516f609052242915c455fc208ca2, type: 3} propertyPath: m_Options.m_Options.Array.size - value: 1 + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 5da4516f609052242915c455fc208ca2, type: 3} diff --git a/Assets/Script/Configuration/ButtonSettingManager.cs b/Assets/Script/Configuration/ButtonSettingManager.cs index 48b3170..fb615f2 100644 --- a/Assets/Script/Configuration/ButtonSettingManager.cs +++ b/Assets/Script/Configuration/ButtonSettingManager.cs @@ -1,6 +1,8 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using WindowsInput.Native; +using System; public class ButtonSettingManager : MonoBehaviour { diff --git a/Assets/Script/Configuration/ConfigManager.cs b/Assets/Script/Configuration/ConfigManager.cs index 8ac686f..1bbf04d 100644 --- a/Assets/Script/Configuration/ConfigManager.cs +++ b/Assets/Script/Configuration/ConfigManager.cs @@ -179,10 +179,10 @@ public class ConfigManager : MonoBehaviour config.Skybox = SkyboxDropdown.value; config.TouchSampleRate = (Config.touchSampleRate)TouchSampleRateDropdown.value; config.HandStabilizationMode = (Config.handStabilization)HandStabilizationModeDropdown.value; - config.TestKey = (VirtualKeyCode)TestKeyDropdown.value; - config.ServiceKey = (VirtualKeyCode)ServiceKeyDropdown.value; - config.CoinKey = (VirtualKeyCode)CoinKeyDropdown.value; - config.CustomKey = (VirtualKeyCode)CustomKeyDropdown.value; + config.TestKey = (VirtualKeyCode)Enum.GetValues(typeof(VirtualKeyCode)).GetValue(TestKeyDropdown.value); + config.ServiceKey = (VirtualKeyCode)Enum.GetValues(typeof(VirtualKeyCode)).GetValue(ServiceKeyDropdown.value); + config.CoinKey = (VirtualKeyCode)Enum.GetValues(typeof(VirtualKeyCode)).GetValue(CoinKeyDropdown.value); + config.CustomKey = (VirtualKeyCode)Enum.GetValues(typeof(VirtualKeyCode)).GetValue(CustomKeyDropdown.value); onConfigChanged?.Invoke(); } @@ -207,7 +207,7 @@ public class ConfigManager : MonoBehaviour config.useIPCTouch = isIPCTouchToggle.isOn; onConfigChanged?.Invoke(); } - + [ContextMenu("UpdateConfigPanel")] void UpdateConfigPanel() { CaptureModeDropdown.value = (int)config.CaptureMode; @@ -231,9 +231,9 @@ public class ConfigManager : MonoBehaviour //HandStabilSmoothSlider.value = HandStabilSmooth; isIPCLightingToggle.isOn = config.useIPCLighting; isIPCTouchToggle.isOn = config.useIPCTouch; - TestKeyDropdown.value = (int)config.TestKey; - ServiceKeyDropdown.value = (int)config.ServiceKey; - CoinKeyDropdown.value = (int)config.CoinKey; - CustomKeyDropdown.value = (int)config.CustomKey; + TestKeyDropdown.value = Array.IndexOf(Enum.GetValues(typeof(VirtualKeyCode)), config.TestKey); + ServiceKeyDropdown.value = Array.IndexOf(Enum.GetValues(typeof(VirtualKeyCode)), config.ServiceKey); + CoinKeyDropdown.value = Array.IndexOf(Enum.GetValues(typeof(VirtualKeyCode)), config.CoinKey); + CustomKeyDropdown.value = Array.IndexOf(Enum.GetValues(typeof(VirtualKeyCode)), config.CustomKey); } } \ No newline at end of file diff --git a/Assets/Script/Essential/KeyDropdownManager.cs b/Assets/Script/Essential/KeyDropdownManager.cs index 43e2442..9391b2c 100644 --- a/Assets/Script/Essential/KeyDropdownManager.cs +++ b/Assets/Script/Essential/KeyDropdownManager.cs @@ -8,7 +8,7 @@ using WindowsInput.Native; public class KeyDropdownManager : MonoBehaviour { TMP_Dropdown Dropdown; - void Start() + void Awake() { Dropdown = GetComponent(); PopulateList();