本文整理汇总了C#中SkeletonAnimation.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# SkeletonAnimation.Reset方法的具体用法?C# SkeletonAnimation.Reset怎么用?C# SkeletonAnimation.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkeletonAnimation
的用法示例。
在下文中一共展示了SkeletonAnimation.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
controller = GetComponent<Controller2D>();
audio = GetComponent<AudioSource> ();
scale = transform.localScale;
// Ok we should get gravity and jumpVelocity from jumpHeight and timeToJumpApex
// For gravity we will use the motion equation: delta(Movement) = v0 * time + (acceleration * time^2) / 2
// in our case v0 = 0, time = timeToJumpApex, and delta(Movement) = jumpHeight...
// so gravity = 2 * jumpHeight / timeToJumpApex^2
gravity = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2); // we added a "-" because we want it to be negative
// Now we should get jump velocity from: velocity = v0 + acceleration * time
jumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
// Debug.Log("gravity: " + gravity + "; jumpVelocity: " + jumpVelocity);
spineAnim = GetComponent<SkeletonAnimation>();
spineAnim.Reset();
spineAnim.state.SetAnimation(0, "idle", true);
curr_anim = "idle";
}