From 008f74a242dc2404fc65a73a905d09190de79d5c Mon Sep 17 00:00:00 2001 From: Keith Bradner Date: Thu, 9 Feb 2023 13:04:51 -0500 Subject: [PATCH] Fix for reimport erasing settings A Unity bug occurs when loading resources too quickly that caused steamvr settings to be erased. Thanks for the PR @Peaj #949 --- .../SteamVR/Input/Editor/SteamVR_CopyExampleInputFiles.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/SteamVR/Input/Editor/SteamVR_CopyExampleInputFiles.cs b/Assets/SteamVR/Input/Editor/SteamVR_CopyExampleInputFiles.cs index 21626652..02d1d8f2 100644 --- a/Assets/SteamVR/Input/Editor/SteamVR_CopyExampleInputFiles.cs +++ b/Assets/SteamVR/Input/Editor/SteamVR_CopyExampleInputFiles.cs @@ -16,7 +16,13 @@ public class SteamVR_CopyExampleInputFiles : Editor [UnityEditor.Callbacks.DidReloadScripts] private static void OnReloadScripts() + { + EditorApplication.update += Update; + } + + private static void Update() { + EditorApplication.update -= Update; SteamVR_Input.CheckOldLocation(); CopyFiles(); }