设置动画播放或停止(固定在第一帧)
<span style="white-space:pre"> </span>//通用的设置动画播放或停止方法
<span style="white-space:pre"> </span>void SetSkeletonAni(SkeletonAnimation skeletonAni,string aniName, bool strech){
<span style="white-space:pre"> </span>if (strech) {
<span style="white-space:pre"> </span>skeletonAni.state.SetAnimation (0, aniName, true);
<span style="white-space:pre"> </span>skeletonAni.state.TimeScale = 1f;
<span style="white-space:pre"> </span>} else {
<span style="white-space:pre"> </span>skeletonAni.state.SetAnimation (0, aniName, true).time = 0f;
<span style="white-space:pre"> </span>skeletonAni.state.TimeScale = 0f;
<span style="white-space:pre"> </span>skeletonAni.skeleton.SetToSetupPose ();
<span style="white-space:pre"> </span>}
<span style="white-space:pre"> </span>}