mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 02:36:56 +08:00
[unity] PointFollower and BoundingBoxFollower now correctly unsubscribe from events on deletion / disable. Closes #1729.
This commit is contained in:
parent
3be202711c
commit
0e2ced5042
@ -177,6 +177,9 @@ namespace Spine.Unity {
|
|||||||
void OnDisable () {
|
void OnDisable () {
|
||||||
if (clearStateOnDisable)
|
if (clearStateOnDisable)
|
||||||
ClearState();
|
ClearState();
|
||||||
|
|
||||||
|
if (skeletonRenderer != null)
|
||||||
|
skeletonRenderer.OnRebuild -= HandleRebuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearState () {
|
public void ClearState () {
|
||||||
|
|||||||
@ -100,6 +100,11 @@ namespace Spine.Unity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnDestroy () {
|
||||||
|
if (skeletonRenderer != null)
|
||||||
|
skeletonRenderer.OnRebuild -= HandleRebuildRenderer;
|
||||||
|
}
|
||||||
|
|
||||||
public void LateUpdate () {
|
public void LateUpdate () {
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (!Application.isPlaying) skeletonTransformIsParent = Transform.ReferenceEquals(skeletonTransform, transform.parent);
|
if (!Application.isPlaying) skeletonTransformIsParent = Transform.ReferenceEquals(skeletonTransform, transform.parent);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user