using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public static class NavMeshAgentExtension { public static bool IsAtDestination(this NavMeshAgent a) { if (!a.pathPending) { if (a.remainingDistance <= (a.stoppingDistance)) { if (!a.hasPath || a.velocity.sqrMagnitude == 0) { return true; } } } return false; } }