mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Made delta time easier to customize.
This commit is contained in:
parent
6be3dbb7ed
commit
03610fcaad
@ -66,12 +66,12 @@ public class SkeletonAnimation : SkeletonComponent {
|
|||||||
if (_animationName != null && _animationName.Length > 0) state.SetAnimation(0, _animationName, loop);
|
if (_animationName != null && _animationName.Length > 0) state.SetAnimation(0, _animationName, loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
override public void UpdateSkeleton () {
|
override public void UpdateSkeleton (float deltaTime) {
|
||||||
// Apply the animation.
|
// Apply the animation.
|
||||||
state.Update(Time.deltaTime * timeScale);
|
state.Update(deltaTime * timeScale);
|
||||||
state.Apply(skeleton);
|
state.Apply(skeleton);
|
||||||
|
|
||||||
// Call overridden method to call skeleton Update and UpdateWorldTransform.
|
// Call overridden method to call skeleton Update and UpdateWorldTransform.
|
||||||
base.UpdateSkeleton();
|
base.UpdateSkeleton(deltaTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,8 +91,8 @@ public class SkeletonComponent : MonoBehaviour {
|
|||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void UpdateSkeleton () {
|
public virtual void UpdateSkeleton (float deltaTime) {
|
||||||
skeleton.Update(Time.deltaTime * timeScale);
|
skeleton.Update(deltaTime * timeScale);
|
||||||
skeleton.UpdateWorldTransform();
|
skeleton.UpdateWorldTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ public class SkeletonComponent : MonoBehaviour {
|
|||||||
if (skeleton == null || skeleton.Data != skeletonData)
|
if (skeleton == null || skeleton.Data != skeletonData)
|
||||||
Initialize();
|
Initialize();
|
||||||
|
|
||||||
UpdateSkeleton();
|
UpdateSkeleton(Time.deltaTime);
|
||||||
|
|
||||||
// Count quads and submeshes.
|
// Count quads and submeshes.
|
||||||
int quadCount = 0, submeshQuadCount = 0;
|
int quadCount = 0, submeshQuadCount = 0;
|
||||||
|
|||||||
@ -66,12 +66,12 @@ public class SkeletonAnimation : SkeletonComponent {
|
|||||||
if (_animationName != null && _animationName.Length > 0) state.SetAnimation(0, _animationName, loop);
|
if (_animationName != null && _animationName.Length > 0) state.SetAnimation(0, _animationName, loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
override public void UpdateSkeleton () {
|
override public void UpdateSkeleton (float deltaTime) {
|
||||||
// Apply the animation.
|
// Apply the animation.
|
||||||
state.Update(Time.deltaTime * timeScale);
|
state.Update(deltaTime * timeScale);
|
||||||
state.Apply(skeleton);
|
state.Apply(skeleton);
|
||||||
|
|
||||||
// Call overridden method to call skeleton Update and UpdateWorldTransform.
|
// Call overridden method to call skeleton Update and UpdateWorldTransform.
|
||||||
base.UpdateSkeleton();
|
base.UpdateSkeleton(deltaTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,8 +91,8 @@ public class SkeletonComponent : MonoBehaviour {
|
|||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void UpdateSkeleton () {
|
public virtual void UpdateSkeleton (float deltaTime) {
|
||||||
skeleton.Update(Time.deltaTime * timeScale);
|
skeleton.Update(deltaTime * timeScale);
|
||||||
skeleton.UpdateWorldTransform();
|
skeleton.UpdateWorldTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ public class SkeletonComponent : MonoBehaviour {
|
|||||||
if (skeleton == null || skeleton.Data != skeletonData)
|
if (skeleton == null || skeleton.Data != skeletonData)
|
||||||
Initialize();
|
Initialize();
|
||||||
|
|
||||||
UpdateSkeleton();
|
UpdateSkeleton(Time.deltaTime);
|
||||||
|
|
||||||
// Count quads and submeshes.
|
// Count quads and submeshes.
|
||||||
int quadCount = 0, submeshQuadCount = 0;
|
int quadCount = 0, submeshQuadCount = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user