mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-10 17:18:44 +08:00
[unity] Fixed Editor error messages upon startup, most likely due to AssetDatabase not being fully initialized (Unity 2020.2). Closes #1779.
This commit is contained in:
parent
a7f629f504
commit
ab91a3539d
@ -69,6 +69,7 @@ namespace Spine.Unity.Editor {
|
||||
public static string editorPath = "";
|
||||
public static string editorGUIPath = "";
|
||||
public static bool initialized;
|
||||
private static int numFramesToDelayInit = 1;
|
||||
private static List<string> texturesWithoutMetaFile = new List<string>();
|
||||
|
||||
// Auto-import entry point for textures
|
||||
@ -96,11 +97,16 @@ namespace Spine.Unity.Editor {
|
||||
}
|
||||
|
||||
#region Initialization
|
||||
|
||||
static SpineEditorUtilities () {
|
||||
Initialize();
|
||||
EditorApplication.update += Initialize; // delayed so that AssetDatabase is ready.
|
||||
}
|
||||
|
||||
static void Initialize () {
|
||||
if (numFramesToDelayInit-- > 0)
|
||||
return;
|
||||
EditorApplication.update -= Initialize;
|
||||
|
||||
// Note: Preferences need to be loaded when changing play mode
|
||||
// to initialize handle scale correctly.
|
||||
#if !NEW_PREFERENCES_SETTINGS_PROVIDER
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user