mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-12 10:08:44 +08:00
[unity] Skip loading SpineEditorUtilities in play mode.
This commit is contained in:
parent
1bd0347038
commit
987d074152
@ -184,6 +184,8 @@ namespace Spine.Unity.Editor {
|
||||
}
|
||||
|
||||
static void Initialize () {
|
||||
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||
|
||||
Preferences.Load();
|
||||
|
||||
var rootDir = new DirectoryInfo(Application.dataPath);
|
||||
@ -201,15 +203,15 @@ namespace Spine.Unity.Editor {
|
||||
EditorApplication.hierarchyWindowItemOnGUI += HierarchyHandler.HandleDragAndDrop;
|
||||
|
||||
// Hierarchy Icons
|
||||
#if NEWPLAYMODECALLBACKS
|
||||
#if NEWPLAYMODECALLBACKS
|
||||
EditorApplication.playModeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
|
||||
EditorApplication.playModeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
|
||||
HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
|
||||
#else
|
||||
#else
|
||||
EditorApplication.playmodeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
|
||||
EditorApplication.playmodeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
|
||||
HierarchyHandler.IconsOnPlaymodeStateChanged();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Data Refresh Edit Mode.
|
||||
// This prevents deserialized SkeletonData from persisting from play mode to edit mode.
|
||||
@ -281,6 +283,9 @@ namespace Spine.Unity.Editor {
|
||||
static bool preferencesLoaded = false;
|
||||
|
||||
public static void Load () {
|
||||
if (preferencesLoaded)
|
||||
return;
|
||||
|
||||
defaultMix = EditorPrefs.GetFloat(DEFAULT_MIX_KEY, DEFAULT_DEFAULT_MIX);
|
||||
defaultScale = EditorPrefs.GetFloat(DEFAULT_SCALE_KEY, DEFAULT_DEFAULT_SCALE);
|
||||
defaultZSpacing = EditorPrefs.GetFloat(DEFAULT_ZSPACING_KEY, DEFAULT_DEFAULT_ZSPACING);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user