public static MapTile CreateTile(Transform _parent, int _x, int _y, int _seed) { MapTileType type = _seed < 80 ? MapTileType.Grass : MapTileType.Water; GameObject tileObj = Instantiate <GameObject>(GetPrefab(type), _parent); tileObj.name = "_tile_" + _x + "_" + _y + "_" + type.ToString(); tileObj.transform.position = new Vector3(_x - m_mapXMiddle, 0, _y - m_mapYMiddle); MapTile newTile = tileObj.AddComponent <MapTile>(); newTile.TileType = type; newTile.Position = new Position(_x, _y); newTile.Walkable = type == MapTileType.Grass; return(newTile); }
public override string ToString() { return(tile.ToString()); }