using System.Collections; using System.Collections.Generic; using UnityEngine; using MyCollections.AI.FinitStateMachine; [CreateAssetMenu(menuName = "Finite State Machine/Action/ChaseTarget")] public class ChaseTartet : Action { public override void Run(FSM fsm) { Agent agent = fsm.Controller.Agent; EnemyNPCContoller controller = (EnemyNPCContoller)fsm.Controller; GameObject target = controller.AgentFOV.GetTarget(); if (agent != null) { if (target != null) { agent.SetDestination(target.transform.position); agent.agentStop = false; } } } }