Unity Spine动画常规使用

Spine动画改颜色 

m_skeletonAnimiation.skeleton.SetColor(new Color(1, 1, 1, 0));

Spine动画即时倒播 //需要动画做正反2个同步循环动画,切换 动画实现 

float time2 = skeletonAnimation.state.GetCurrent(0).AnimationTime;

skeletonAnimation.state.SetAnimation(0, "back", true).TrackTime = alltime- time2;

Spine动画事件

skeletonAnimation.state.Event += State_Event;

 private void State_Event(Spine.TrackEntry trackEntry, Spine.Event e)

 {

    if (e.Data.Name == "throw")

  {

 //DoSomeThing

 }

}

获取动画时间

   float time = m_skeletonAnimation.state.SetAnimation(0, "run", false).Animation.Duration;

//修改皮肤

// skeletonAnimation.initialSkinName = "2";

//skeletonAnimation.Initialize(true);

你可能感兴趣的:(Unity Spine动画常规使用)