mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
Added UpdateBones delegate to more easily adjust bones after the animation is applied.
This commit is contained in:
parent
41c36a89d3
commit
8506ed5154
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user