protected virtual void Start()
 {
     tilemapGraph = new TilemapGraph(tilemap, allowedTiles.Get());
     //tilemapGraph = new TilemapGraphAStar(tilemap, allowedTiles.Get());
     timeBetweenSteps = 1 / speed;
     StartCoroutine(MoveTowardsTheTarget());
 }
Example #2
0
    protected virtual void Start()
    {
        pathFinder = new BFS <Vector3Int>();//Initialize to BFS algorithm

        tilemapGraph     = new TilemapGraph(tilemap, allowedTiles.Get());
        timeBetweenSteps = 1 / speed;
        StartCoroutine(MoveTowardsTheTarget());
    }
Example #3
0
    private void Start()
    {
        var pathHeuristic = new EuclideanHeuristic();
        var graph         = new TilemapGraph(_tilemap);
        var graphNodeCost = new NodeCostChainOfResponsibilities(new List <IGraphNodeCost>
        {
            new ObstacleGraphNodeCost(_obstacles),
            new FloorGraphNodeCost(_tilemap)
        });

        _pathFinder             = new PathFinder(graph, graphNodeCost, pathHeuristic);
        _reevaluatePathInterval = 3;
    }
Example #4
0
    private void Start()
    {
        var pathHeuristic = new ManhattanHeuristic();
        var graph         = new TilemapGraph(_floor);

        _obstacleNodeCost = new ObstacleGraphNodeCost(_obstacles);
        _floorNodeCost    = new FloorGraphNodeCost(_floor);
        _graphNode        = new NodeCostChainOfResponsibilities(new List <IGraphNodeCost>
        {
            _obstacleNodeCost,
            _floorNodeCost
        });
        _pathFinder = new PathFinder(graph, _graphNode, pathHeuristic);
    }