Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / Orc / Actions / ClearTarget.cs
@Rackday Rackday on 3 Sep 465 bytes Minor Update
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MyCollections.AI.FinitStateMachine;

[CreateAssetMenu(menuName = "Finite State Machine/Action/ClearTarget")]
public class ClearTarget : Action
{
    public override void Run(FSM fsm)
    {
        if (fsm.Controller.AgentFOV.GetTarget() != null)
        {
            fsm.Controller.AgentFOV.IsEnabled = false;
            fsm.Controller.AgentFOV.ClearTarget();
        }
    }
}