mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Corrected behaviour of SkeletonGraphic edit reference rect when entering/exiting play mode. See #1640.
This commit is contained in:
parent
25b8310bea
commit
78302ac1d8
@ -141,9 +141,20 @@ namespace Spine.Unity.Editor {
|
|||||||
|
|
||||||
separatorSlotNames = so.FindProperty("separatorSlotNames");
|
separatorSlotNames = so.FindProperty("separatorSlotNames");
|
||||||
separatorSlotNames.isExpanded = true;
|
separatorSlotNames.isExpanded = true;
|
||||||
|
|
||||||
|
EditorApplication.playModeStateChanged += OnPlaymodeChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDisable () {
|
void OnDisable () {
|
||||||
|
EditorApplication.playModeStateChanged -= OnPlaymodeChanged;
|
||||||
|
DisableEditReferenceRectMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnPlaymodeChanged (PlayModeStateChange mode) {
|
||||||
|
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