- using UnityEngine;
- using MyCollections.AI.FinitStateMachine;
- [CreateAssetMenu(menuName = "Finite State Machine/Action/RequestPosition")]
- public class RequestPosition : Action
- {
- public override void Run(FSM fsm)
- {
- fsm.Controller.Agent.agentStop = true;
- if (fsm == null)
- {
- Debug.Log("Fsm is null");
- }
- if (fsm.Controller == null)
- {
- Debug.Log("Controller is NUll");
- }
- if (fsm.Controller.Agent == null)
- {
- Debug.Log("Agent is NUll");
- }
- if (fsm.Controller.timer > 0f)
- {
- fsm.Controller.timer -= Time.deltaTime;
- }
- else
- {
-
- fsm.Controller.NPCManager.RequestPosition(fsm.Controller.Agent);
- fsm.Controller.timer = 0f;
- }
- }
- }