Unity Timeline动画播放和暂停

2022-04-19  本文已影响0人  114105lijia
using UnityEngine.Playables;

public class MyJoystick : MonoBehaviour
{
     PlayableDirector director;

     void Start()
     {
          director = this.transform.GetComponent<PlayableDirector>();
     }

     private void FixedUpdate()
     {
          float horizontal = variableJoystick.Horizontal;
          float vertical = variableJoystick.Vertical;

         //走路动画
           if (horizontal == 0 && vertical == 0)
           {
               director.Pause();
           }
           else
           {
               director.Play();
           }
     }
}
上一篇下一篇

猜你喜欢

热点阅读