mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '4.1' into 4.2-beta
This commit is contained in:
commit
9c368baa16
@ -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;
|
||||||
@ -141,9 +145,32 @@ namespace Spine.Unity.Editor {
|
|||||||
|
|
||||||
separatorSlotNames = so.FindProperty("separatorSlotNames");
|
separatorSlotNames = so.FindProperty("separatorSlotNames");
|
||||||
separatorSlotNames.isExpanded = true;
|
separatorSlotNames.isExpanded = true;
|
||||||
|
|
||||||
|
#if NEWPLAYMODECALLBACKS
|
||||||
|
EditorApplication.playModeStateChanged += OnPlaymodeChanged;
|
||||||
|
#else
|
||||||
|
EditorApplication.playmodeStateChanged += OnPlaymodeChanged;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDisable () {
|
void OnDisable () {
|
||||||
|
#if NEWPLAYMODECALLBACKS
|
||||||
|
EditorApplication.playModeStateChanged -= OnPlaymodeChanged;
|
||||||
|
#else
|
||||||
|
EditorApplication.playmodeStateChanged -= OnPlaymodeChanged;
|
||||||
|
#endif
|
||||||
|
DisableEditReferenceRectMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if NEWPLAYMODECALLBACKS
|
||||||
|
void OnPlaymodeChanged (PlayModeStateChange mode) {
|
||||||
|
#else
|
||||||
|
void OnPlaymodeChanged () {
|
||||||
|
#endif
|
||||||
|
DisableEditReferenceRectMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DisableEditReferenceRectMode () {
|
||||||
foreach (UnityEngine.Object c in targets) {
|
foreach (UnityEngine.Object c in targets) {
|
||||||
SkeletonGraphic component = (SkeletonGraphic)c;
|
SkeletonGraphic component = (SkeletonGraphic)c;
|
||||||
component.EditReferenceRect = false;
|
component.EditReferenceRect = false;
|
||||||
|
|||||||
@ -321,8 +321,8 @@ namespace Spine.Unity {
|
|||||||
|
|
||||||
public virtual void Update () {
|
public virtual void Update () {
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
|
UpdateReferenceRectSizes();
|
||||||
if (!Application.isPlaying) {
|
if (!Application.isPlaying) {
|
||||||
UpdateReferenceRectSizes();
|
|
||||||
Update(0f);
|
Update(0f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user