From 2d679be382967db5867972f94a6007a209198ce2 Mon Sep 17 00:00:00 2001 From: xpeng <1216772231@qq.com> Date: Sat, 27 Aug 2022 00:17:18 +0200 Subject: [PATCH] add camera smooth config --- Assets/Scenes/MainScene.unity | 2 +- Assets/Scripts/Configs/NoneVRSettingManager.cs | 3 +++ Assets/Scripts/Essentias/CameraSmooth.cs | 2 +- ProjectSettings/ProjectSettings.asset | 2 -- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index fca4bb5..3c23380 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -3377,7 +3377,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: target: {fileID: 0} - smoothSpeed: 0.1 + smoothSpeed: 0.0125 PositionOffset: {x: 0, y: 0, z: 0} --- !u!1 &358458036 GameObject: diff --git a/Assets/Scripts/Configs/NoneVRSettingManager.cs b/Assets/Scripts/Configs/NoneVRSettingManager.cs index df195b2..d887c99 100644 --- a/Assets/Scripts/Configs/NoneVRSettingManager.cs +++ b/Assets/Scripts/Configs/NoneVRSettingManager.cs @@ -37,6 +37,8 @@ public class NoneVRSettingManager : MonoBehaviour { if (JsonConfig.HasKey("NVRMode")) Dropdown.value = JsonConfig.GetInt("NVRMode"); + if (JsonConfig.HasKey("NVRCameraSmooth")) + CameraSmooth.smoothSpeed = JsonConfig.GetInt("NVRCameraSmooth"); SetNVRMode(); } public void GetNVRFOV() @@ -86,6 +88,7 @@ public class NoneVRSettingManager : MonoBehaviour break; } JsonConfig.SetInt("NVRMode", Dropdown.value); + JsonConfig.SetInt("NVRCameraSmooth", Dropdown.value); } public void SetNVRFOV(float fov) { diff --git a/Assets/Scripts/Essentias/CameraSmooth.cs b/Assets/Scripts/Essentias/CameraSmooth.cs index 216660d..be19897 100644 --- a/Assets/Scripts/Essentias/CameraSmooth.cs +++ b/Assets/Scripts/Essentias/CameraSmooth.cs @@ -3,7 +3,7 @@ using UnityEngine; public class CameraSmooth : MonoBehaviour { public Transform target; - public float smoothSpeed = 0.1f; + public float smoothSpeed = 0.0125f; public Vector3 PositionOffset; Camera cam; void Update () diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 232a319..12a799a 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -194,8 +194,6 @@ PlayerSettings: - {fileID: 0} - {fileID: 0} - {fileID: 0} - - {fileID: -6018045015233401694, guid: 3999ab811e936714280a476b3a032d86, type: 2} - - {fileID: 6536100391545742739, guid: 55d1ec7a4296de343b6d3bb6f9a19731, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1