From f36581512770a995ca639df97c29fc5e22fa8dd6 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 30 Nov 2020 20:04:22 +0100 Subject: [PATCH] [unity] Fixed preferences constantly loading in Unity 2020.1+ when not at default location. Closes #1817. --- .../Editor/spine-unity/Editor/Windows/SpinePreferences.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs index e3cb1c036..eaed36cdd 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs @@ -109,9 +109,13 @@ namespace Spine.Unity.Editor { GetOrCreateSettings(); } - internal static SpinePreferences GetOrCreateSettings () { - var settings = AssetDatabase.LoadAssetAtPath(SPINE_SETTINGS_ASSET_PATH); + static SpinePreferences settings = null; + internal static SpinePreferences GetOrCreateSettings () { + if (settings != null) + return settings; + + settings = AssetDatabase.LoadAssetAtPath(SPINE_SETTINGS_ASSET_PATH); if (settings == null) settings = FindSpinePreferences(); if (settings == null)