You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
517 B

using System.Collections;
using UnityEngine.AI;
public class CheckAction : ActionNode
{
public AI_Worker _Worker;
public override IEnumerator Execute()
{
if (_Worker.animator != null)
{
if (_Worker.animator.GetCurrentAnimatorStateInfo(0).IsName("Check") == false)
{
_Worker.GetComponent<NavMeshAgent>().speed = 0f;
_Worker.animator.CrossFade("Check", 0f);
}
}
return base.Execute();
}
}