|
@@ -35,6 +35,10 @@
|
|
#define HAS_CULL_TRANSPARENT_MESH
|
|
#define HAS_CULL_TRANSPARENT_MESH
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#if UNITY_2017_2_OR_NEWER
|
|
|
|
+#define NEWPLAYMODECALLBACKS
|
|
|
|
+#endif
|
|
|
|
+
|
|
using System.Reflection;
|
|
using System.Reflection;
|
|
using UnityEditor;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
@@ -142,15 +146,27 @@ namespace Spine.Unity.Editor {
|
|
separatorSlotNames = so.FindProperty("separatorSlotNames");
|
|
separatorSlotNames = so.FindProperty("separatorSlotNames");
|
|
separatorSlotNames.isExpanded = true;
|
|
separatorSlotNames.isExpanded = true;
|
|
|
|
|
|
|
|
+#if NEWPLAYMODECALLBACKS
|
|
EditorApplication.playModeStateChanged += OnPlaymodeChanged;
|
|
EditorApplication.playModeStateChanged += OnPlaymodeChanged;
|
|
|
|
+#else
|
|
|
|
+ EditorApplication.playmodeStateChanged += OnPlaymodeChanged;
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
|
|
void OnDisable () {
|
|
void OnDisable () {
|
|
|
|
+#if NEWPLAYMODECALLBACKS
|
|
EditorApplication.playModeStateChanged -= OnPlaymodeChanged;
|
|
EditorApplication.playModeStateChanged -= OnPlaymodeChanged;
|
|
|
|
+#else
|
|
|
|
+ EditorApplication.playmodeStateChanged -= OnPlaymodeChanged;
|
|
|
|
+#endif
|
|
DisableEditReferenceRectMode();
|
|
DisableEditReferenceRectMode();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#if NEWPLAYMODECALLBACKS
|
|
void OnPlaymodeChanged (PlayModeStateChange mode) {
|
|
void OnPlaymodeChanged (PlayModeStateChange mode) {
|
|
|
|
+#else
|
|
|
|
+ void OnPlaymodeChanged () {
|
|
|
|
+#endif
|
|
DisableEditReferenceRectMode();
|
|
DisableEditReferenceRectMode();
|
|
}
|
|
}
|
|
|
|
|