Example #1
0
    //---------------------------------------------------------------------------------------------------------------------------\\
    // Member Functions Start
    //---------------------------------------------------------------------------------------------------------------------------\\

    /// <summary>
    /// This will allow for this cell to be assigned a new tile.
    /// </summary>
    /// <param name="newTile">The new tile enum allows for external checking for this tile. </param>
    /// <param name="newMaterial">This is the new sprite for the tile, this will change the look of the cell. </param>
    public void m_SetTile(CellTile newTile, Sprite newMaterial)
    {
        // Debug.Log("This cell recived sprite " + newMaterial.name);

        m_TileType = newTile;

        if (m_TileType == CellTile.water)
        {
            // If the tile is a select few types then they will be an obsticle.

            m_bObsticle = true;
        }

        m_CellMaterial = newMaterial;

        gameObject.GetComponent <SpriteRenderer>().sprite = newMaterial;
    }
Example #2
0
 public ITile GetTile(Loc loc) => CellTile.FromCell(this.Map.GetCell(loc.X, loc.Y));