using System.Collections; using System.Collections.Generic; using UnityEngine.AI; public class DieAction : ActionNode { public AI_Worker _Worker; public override IEnumerator Execute() { if (_Worker.animator != null) { if (_Worker.animator.GetCurrentAnimatorStateInfo(0).IsName("Die") == false) { _Worker.animator.CrossFade("Die", 0f); _Worker.GetComponent().enabled = false; } } return base.Execute(); } }