private static void LoadInstance() { if (_instance == null) { _instance = Resources.Load <SteamVR_Settings>("SteamVR_Settings"); if (_instance == null) { _instance = SteamVR_Settings.CreateInstance <SteamVR_Settings>(); #if UNITY_EDITOR //string folderPath = SteamVR.GetResourcesFolderPath(true); string folderPath = "Assets"; string assetPath = System.IO.Path.Combine(folderPath, "SteamVR_Settings.asset"); UnityEditor.AssetDatabase.CreateAsset(_instance, assetPath); UnityEditor.AssetDatabase.SaveAssets(); #endif } if (string.IsNullOrEmpty(_instance.editorAppKey)) { _instance.editorAppKey = SteamVR.GenerateAppKey(); Debug.Log("<b>[SteamVR Setup]</b> Generated you an editor app key of: " + _instance.editorAppKey + ". This lets the editor tell SteamVR what project this is. Has no effect on builds. This can be changed in Assets/SteamVR/Resources/SteamVR_Settings"); #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(_instance); UnityEditor.AssetDatabase.SaveAssets(); #endif } } }
private static void LoadInstance() { if (_instance == null) { _instance = Resources.Load <SteamVR_Settings>("SteamVR_Settings"); if (_instance == null) { _instance = SteamVR_Settings.CreateInstance <SteamVR_Settings>(); #if UNITY_EDITOR string folderPath = SteamVR.GetResourcesFolderPath(true); string assetPath = System.IO.Path.Combine(folderPath, "SteamVR_Settings.asset"); UnityEditor.AssetDatabase.CreateAsset(_instance, assetPath); UnityEditor.AssetDatabase.SaveAssets(); #endif } if (string.IsNullOrEmpty(_instance.appKey)) { _instance.appKey = SteamVR.GenerateAppKey(); Debug.Log("[SteamVR] Generated you an app key of: " + _instance.appKey + ". This can be changed in Assets/SteamVR/Resources/SteamVR_Settings"); #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(_instance); UnityEditor.AssetDatabase.SaveAssets(); #endif } } }
private static void LoadInstance() { if (_instance == null) { _instance = Resources.Load <SteamVR_Settings>("SteamVR_Settings"); if (_instance == null) { _instance = SteamVR_Settings.CreateInstance <SteamVR_Settings>(); } SetDefaultsIfNeeded(); } }
private static void LoadInstance() { if (_instance == null) { _instance = Resources.Load <SteamVR_Settings>("SteamVR_Settings"); if (_instance == null) { _instance = SteamVR_Settings.CreateInstance <SteamVR_Settings>(); #if UNITY_EDITOR string localFolderPath = SteamVR.GetSteamVRResourcesFolderPath(true); string assetPath = System.IO.Path.Combine(localFolderPath, "SteamVR_Settings.asset"); UnityEditor.AssetDatabase.CreateAsset(_instance, assetPath); UnityEditor.AssetDatabase.SaveAssets(); #endif } SetDefaultsIfNeeded(); } }