AutoPlayPlayerAnimation.cs 358 B

123456789101112131415161718192021
  1. using System;
  2. using UnityEngine;
  3. public class AutoPlayPlayerAnimation : MonoBehaviour
  4. {
  5. private void Start()
  6. {
  7. }
  8. private void Update()
  9. {
  10. if (UnityEngine.Input.GetKeyDown(KeyCode.Space))
  11. {
  12. this.animation.state.SetAnimation(0, this.animeName, false);
  13. }
  14. }
  15. public SkeletonAnimation animation;
  16. public string animeName;
  17. }