Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class IdleCommand : CharacterCommand
  6. {
  7. private Animator anim;
  8. public IdleCommand(GameObject owner) : base(owner)
  9. {
  10. anim = owner.GetComponent<Animator>();
  11. }
  12.  
  13. public override IEnumerator Excecute()
  14. {
  15. if (anim == null)
  16. yield break;
  17.  
  18. // play animator idle here.
  19. anim.Play("Idle");
  20.  
  21. yield return new WaitForSeconds(Random.Range(2, 3f));
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement