mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-05 23:05:01 +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 () {
|
||||
if (clearStateOnDisable)
|
||||
ClearState();
|
||||
|
||||
if (skeletonRenderer != null)
|
||||
skeletonRenderer.OnRebuild -= HandleRebuild;
|
||||
}
|
||||
|
||||
public void ClearState () {
|
||||
|
||||
@ -100,6 +100,11 @@ namespace Spine.Unity {
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy () {
|
||||
if (skeletonRenderer != null)
|
||||
skeletonRenderer.OnRebuild -= HandleRebuildRenderer;
|
||||
}
|
||||
|
||||
public void LateUpdate () {
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying) skeletonTransformIsParent = Transform.ReferenceEquals(skeletonTransform, transform.parent);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user