mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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 () {
|
static void Initialize () {
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
|
||||||
Preferences.Load();
|
Preferences.Load();
|
||||||
|
|
||||||
var rootDir = new DirectoryInfo(Application.dataPath);
|
var rootDir = new DirectoryInfo(Application.dataPath);
|
||||||
@ -201,15 +203,15 @@ namespace Spine.Unity.Editor {
|
|||||||
EditorApplication.hierarchyWindowItemOnGUI += HierarchyHandler.HandleDragAndDrop;
|
EditorApplication.hierarchyWindowItemOnGUI += HierarchyHandler.HandleDragAndDrop;
|
||||||
|
|
||||||
// Hierarchy Icons
|
// Hierarchy Icons
|
||||||
#if NEWPLAYMODECALLBACKS
|
#if NEWPLAYMODECALLBACKS
|
||||||
EditorApplication.playModeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
|
EditorApplication.playModeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
|
||||||
EditorApplication.playModeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
|
EditorApplication.playModeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
|
||||||
HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
|
HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
|
||||||
#else
|
#else
|
||||||
EditorApplication.playmodeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
|
EditorApplication.playmodeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
|
||||||
EditorApplication.playmodeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
|
EditorApplication.playmodeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
|
||||||
HierarchyHandler.IconsOnPlaymodeStateChanged();
|
HierarchyHandler.IconsOnPlaymodeStateChanged();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Data Refresh Edit Mode.
|
// Data Refresh Edit Mode.
|
||||||
// This prevents deserialized SkeletonData from persisting from play mode to 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;
|
static bool preferencesLoaded = false;
|
||||||
|
|
||||||
public static void Load () {
|
public static void Load () {
|
||||||
|
if (preferencesLoaded)
|
||||||
|
return;
|
||||||
|
|
||||||
defaultMix = EditorPrefs.GetFloat(DEFAULT_MIX_KEY, DEFAULT_DEFAULT_MIX);
|
defaultMix = EditorPrefs.GetFloat(DEFAULT_MIX_KEY, DEFAULT_DEFAULT_MIX);
|
||||||
defaultScale = EditorPrefs.GetFloat(DEFAULT_SCALE_KEY, DEFAULT_DEFAULT_SCALE);
|
defaultScale = EditorPrefs.GetFloat(DEFAULT_SCALE_KEY, DEFAULT_DEFAULT_SCALE);
|
||||||
defaultZSpacing = EditorPrefs.GetFloat(DEFAULT_ZSPACING_KEY, DEFAULT_DEFAULT_ZSPACING);
|
defaultZSpacing = EditorPrefs.GetFloat(DEFAULT_ZSPACING_KEY, DEFAULT_DEFAULT_ZSPACING);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user