mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[unity] Fixed SkeletonUtilityConstraint subclasses not updating. Closes #2587.
This commit is contained in:
parent
d794d2649c
commit
195c65ffd9
@ -238,6 +238,11 @@ namespace Spine.Unity {
|
||||
bool needToReprocessBones;
|
||||
|
||||
public void ResubscribeEvents () {
|
||||
ResubscribeIndependentEvents();
|
||||
ResubscribeDependentEvents();
|
||||
}
|
||||
|
||||
void ResubscribeIndependentEvents () {
|
||||
if (skeletonRenderer != null) {
|
||||
skeletonRenderer.OnRebuild -= HandleRendererReset;
|
||||
skeletonRenderer.OnRebuild += HandleRendererReset;
|
||||
@ -250,10 +255,15 @@ namespace Spine.Unity {
|
||||
|
||||
if (skeletonAnimation != null) {
|
||||
skeletonAnimation.UpdateLocal -= UpdateLocal;
|
||||
skeletonAnimation.UpdateLocal += UpdateLocal;
|
||||
}
|
||||
}
|
||||
|
||||
void ResubscribeDependentEvents () {
|
||||
if (skeletonAnimation != null) {
|
||||
skeletonAnimation.UpdateWorld -= UpdateWorld;
|
||||
skeletonAnimation.UpdateComplete -= UpdateComplete;
|
||||
|
||||
skeletonAnimation.UpdateLocal += UpdateLocal;
|
||||
if (hasOverrideBones || hasConstraints)
|
||||
skeletonAnimation.UpdateWorld += UpdateWorld;
|
||||
if (hasConstraints)
|
||||
@ -369,6 +379,7 @@ namespace Spine.Unity {
|
||||
boneComponents.Clear();
|
||||
constraintComponents.Clear();
|
||||
}
|
||||
ResubscribeDependentEvents();
|
||||
}
|
||||
|
||||
void UpdateLocal (ISkeletonAnimation anim) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user