Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class IdleCommand : CharacterCommand
- {
- private Animator anim;
- public IdleCommand(GameObject owner) : base(owner)
- {
- anim = owner.GetComponent<Animator>();
- }
- public override IEnumerator Excecute()
- {
- if (anim == null)
- yield break;
- // play animator idle here.
- anim.Play("Idle");
- yield return new WaitForSeconds(Random.Range(2, 3f));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement