public EndGameState(NavMeshAgent agent)
{
_agent = agent;
var endPoints = GameObject.FindGameObjectWithTag(Constants.Tags.GameMaster).
GetComponent<EndPoints>().Endpoints;
if (endPoints.Length < 1)
Debug.LogError("No interactables in scene, FUCK!");
foreach (var i in endPoints)
{
var path = new NavMeshPath();
agent.CalculatePath(i.transform.position, path);
if (path.status != NavMeshPathStatus.PathComplete) continue;
_destination = i;
break;
}
if (_destination == null)
_state = State.Done;
}