Exemplo n.º 1
0
    public virtual void ReturnHome()
    {
        List <Node> entrances = Origin.GetAdjRoadTiles();

        if (entrances.Count == 0)
        {
            DestroySelf();
            return;
        }
        Path = pathfinder.FindPath(new Node(this), entrances, name);

        if (Path.Count == 0)
        {
            DestroySelf();
        }

        data.ReturningHome = true;
        Stuck = true;
    }