diff --git a/spine-tk2d/Assets/Spine/SkeletonAnimation.cs b/spine-tk2d/Assets/Spine/SkeletonAnimation.cs index 36a04fe19..5c9cd68f6 100644 --- a/spine-tk2d/Assets/Spine/SkeletonAnimation.cs +++ b/spine-tk2d/Assets/Spine/SkeletonAnimation.cs @@ -37,7 +37,10 @@ using Spine; public class SkeletonAnimation : SkeletonComponent { public bool loop; public Spine.AnimationState state; - + + public delegate void UpdateBonesDelegate(SkeletonAnimation skeleton); + public UpdateBonesDelegate UpdateBones; + public String _animationName; public String animationName { get { @@ -67,6 +70,8 @@ public class SkeletonAnimation : SkeletonComponent { // Apply the animation. state.Update(deltaTime * timeScale); state.Apply(skeleton); + + if (UpdateBones != null) UpdateBones(this); // Call overridden method to call skeleton Update and UpdateWorldTransform. base.UpdateSkeleton(deltaTime); diff --git a/spine-unity/Assets/Spine/SkeletonAnimation.cs b/spine-unity/Assets/Spine/SkeletonAnimation.cs index d71460983..fb5971fcb 100644 --- a/spine-unity/Assets/Spine/SkeletonAnimation.cs +++ b/spine-unity/Assets/Spine/SkeletonAnimation.cs @@ -38,6 +38,9 @@ public class SkeletonAnimation : SkeletonComponent { public bool loop; public Spine.AnimationState state; + public delegate void UpdateBonesDelegate(SkeletonAnimation skeleton); + public UpdateBonesDelegate UpdateBones; + public String _animationName; public String animationName { get { @@ -68,6 +71,8 @@ public class SkeletonAnimation : SkeletonComponent { state.Update(deltaTime * timeScale); state.Apply(skeleton); + if (UpdateBones != null) UpdateBones(this); + // Call overridden method to call skeleton Update and UpdateWorldTransform. base.UpdateSkeleton(deltaTime); }