MegaTestAnimator.cs 446 B

12345678910111213141516171819202122232425262728293031323334
  1. 
  2. using UnityEngine;
  3. public class MegaTestAnimator : MonoBehaviour
  4. {
  5. MegaMorphAnimator anim;
  6. void Update()
  7. {
  8. if ( anim == null )
  9. {
  10. anim = GetComponent<MegaMorphAnimator>();
  11. }
  12. if ( anim )
  13. {
  14. if ( Input.GetKeyDown(KeyCode.Alpha1) )
  15. {
  16. anim.PlayClip(0);
  17. }
  18. if ( Input.GetKeyDown(KeyCode.Alpha2) )
  19. {
  20. anim.PlayClip(1);
  21. }
  22. if ( Input.GetKeyDown(KeyCode.Alpha3) )
  23. {
  24. anim.PlayClip(2);
  25. }
  26. }
  27. }
  28. }