- using MyCollections.AI.FinitStateMachine;
- using UnityEngine;
- [CreateAssetMenu(menuName = "Finite State Machine/Action/LookAt")]
- public class LooAtAction : Action
- {
- public override void Run(FSM fsm)
- {
- FOV fov = fsm.Controller.AgentFOV;
-
- if (fov != null)
- {
- GameObject target = fov.GetTarget();
- if (target != null)
- {
- fsm.Controller.LastDirection = fov.TargetDirection;
- return;
- }
- Debug.Log($"Target is null");
- }
- }
- }