Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / Orc / Conditions / IsNotOnDestination.cs
@Rackday Rackday on 29 Oct 498 bytes Major Update
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MyCollections.AI.FinitStateMachine;

[CreateAssetMenu(menuName = "Finite State Machine/Condition/IsNotOnDestination")]
public class IsNotOnDestination : Condition
{
    public override bool CheckCondition(FSM fsm)
    {
        Agent agent = fsm.Controller.Agent;
        if (agent.destination != Vector2.zero)
        {
            return agent.remainingDistance > 0.2f;
        }

        return false;
    }
}