public void addObstacle(GameObject obst)
    {
        ObstManager obstManager = obst.GetComponent <ObstManager>();

        obstManager.setIsActive(true);

        //if obstacle has not yet been asigned an index
        if (obstManager.getIndex() == -1)
        {
            Obstacles.Add(obstManager);
            obstManager.setIndex(heighestIndex);
            heighestIndex++;
            numOfObstacles++;
            gridScript.addObstPath();
        }
        else
        {
            Obstacles[obstManager.getIndex()] = obstManager;
        }

        if (managerScipt.isLocalAvoidance)
        {
            obstManager.GetComponent <PredictPath>().enabled     = false;
            obstManager.GetComponent <GetCoveredNodes>().enabled = false;
        }
    }
    public void removeObstacle(GameObject obst)
    {
        ObstManager obstManager = obst.GetComponent <ObstManager>();

        obstManager.setIsActive(false);
        obstManager.cleanPath();
        Obstacles[obstManager.getIndex()] = null;
        numOfObstacles--;
    }