mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Handle playModeStateChanged API change (2017.2).
This commit is contained in:
parent
6659902457
commit
652506df0c
@ -230,9 +230,16 @@ namespace Spine.Unity.Editor {
|
|||||||
EditorApplication.hierarchyWindowItemOnGUI += HierarchyDragAndDrop;
|
EditorApplication.hierarchyWindowItemOnGUI += HierarchyDragAndDrop;
|
||||||
|
|
||||||
// Hierarchy Icons
|
// Hierarchy Icons
|
||||||
|
#if UNITY_2017_2_OR_NEWER
|
||||||
|
EditorApplication.playModeStateChanged -= HierarchyIconsOnPlaymodeStateChanged;
|
||||||
|
EditorApplication.playModeStateChanged += HierarchyIconsOnPlaymodeStateChanged;
|
||||||
|
HierarchyIconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
|
||||||
|
#else
|
||||||
EditorApplication.playmodeStateChanged -= HierarchyIconsOnPlaymodeStateChanged;
|
EditorApplication.playmodeStateChanged -= HierarchyIconsOnPlaymodeStateChanged;
|
||||||
EditorApplication.playmodeStateChanged += HierarchyIconsOnPlaymodeStateChanged;
|
EditorApplication.playmodeStateChanged += HierarchyIconsOnPlaymodeStateChanged;
|
||||||
HierarchyIconsOnPlaymodeStateChanged();
|
HierarchyIconsOnPlaymodeStateChanged();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
@ -255,7 +262,11 @@ namespace Spine.Unity.Editor {
|
|||||||
showHierarchyIcons = EditorGUILayout.Toggle(new GUIContent("Show Hierarchy Icons", "Show relevant icons on GameObjects with Spine Components on them. Disable this if you have large, complex scenes."), showHierarchyIcons);
|
showHierarchyIcons = EditorGUILayout.Toggle(new GUIContent("Show Hierarchy Icons", "Show relevant icons on GameObjects with Spine Components on them. Disable this if you have large, complex scenes."), showHierarchyIcons);
|
||||||
if (EditorGUI.EndChangeCheck()) {
|
if (EditorGUI.EndChangeCheck()) {
|
||||||
EditorPrefs.SetBool(SHOW_HIERARCHY_ICONS_KEY, showHierarchyIcons);
|
EditorPrefs.SetBool(SHOW_HIERARCHY_ICONS_KEY, showHierarchyIcons);
|
||||||
|
#if UNITY_2017_2_OR_NEWER
|
||||||
|
HierarchyIconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
|
||||||
|
#else
|
||||||
HierarchyIconsOnPlaymodeStateChanged();
|
HierarchyIconsOnPlaymodeStateChanged();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorGUILayout.Separator();
|
EditorGUILayout.Separator();
|
||||||
@ -496,7 +507,11 @@ namespace Spine.Unity.Editor {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Hierarchy
|
#region Hierarchy
|
||||||
|
#if UNITY_2017_2_OR_NEWER
|
||||||
|
static void HierarchyIconsOnPlaymodeStateChanged (PlayModeStateChange stateChange) {
|
||||||
|
#else
|
||||||
static void HierarchyIconsOnPlaymodeStateChanged () {
|
static void HierarchyIconsOnPlaymodeStateChanged () {
|
||||||
|
#endif
|
||||||
skeletonRendererTable.Clear();
|
skeletonRendererTable.Clear();
|
||||||
skeletonUtilityBoneTable.Clear();
|
skeletonUtilityBoneTable.Clear();
|
||||||
boundingBoxFollowerTable.Clear();
|
boundingBoxFollowerTable.Clear();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user