Example #1
0
    private LandTile [] highlightedTiles;                   // Collection of the tiles that are highlighted (generally as part of movement or attack distance indicators).


    private void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else if (_instance != this)
        {
            Destroy(this.gameObject);
        }
        DontDestroyOnLoad(this.gameObject);

        pathfinder = new Pathfinding(this);
        gridCursor = GetComponentInChildren <GridCursor> ();

        if (TileMapContainer == null)
        {
            TileMapContainer = new GameObject();
        }
        TileMapContainer.transform.position = Vector3.zero;             // The tiles are based on LandTileMap's position; so making sure it's 0.
        CreateGrid();                                                   // !Temporary! creates the grid (currently semi-random grid)
    }
Example #2
0
    private LandTileMap tileMap;                                    // A reference to the LandTileMap


    public Pathfinding(LandTileMap tileMap)
    {
        this.tileMap = tileMap;
    }