Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / Orc / Actions / ClearTarget.cs
@Rackday Rackday on 29 Oct 513 bytes Major Update
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using MyCollections.AI.FinitStateMachine;
  5. [CreateAssetMenu(menuName = "Finite State Machine/Action/ClearTarget")]
  6. public class ClearTarget : Action
  7. {
  8. public override void Run(FSM fsm)
  9. {
  10. if (fsm.Controller.AgentFOV.GetTarget() != null)
  11. {
  12. fsm.Controller.AgentFOV.IsEnabled = false;
  13. fsm.Controller.AgentFOV.ClearTarget();
  14. }
  15. fsm.Controller.Agent.agentStop = true;
  16. }
  17. }