private bool IsRefreshNeeded(ITilemap tilemap, Vector3Int position) { //we must check refresh if tile in map is SolidWall1, same type as our tile. RogueLikeTile tile = tilemap.GetTile(position) as RogueLikeTile; if (tile != null && this.GetCode().Equals(tile.GetCode())) { return(true); } return(false); //return tilemap.GetTile(position) == this; }
public RogueLikeTile getTileFromWorld(Vector3 worldPoint) { Tilemap tilemap = GetComponent <Tilemap>(); Vector3Int cell = tilemap.WorldToCell(worldPoint); TileBase tilebase = tilemap.GetTile(cell); RogueLikeTile roguetile = null; if (tilebase != null) { counter++; roguetile = tilebase as RogueLikeTile; Debug.Log("Worldpoint(" + worldPoint + ") code=" + roguetile.GetCode() + " nameFound=" + tilebase.name + " " + counter); } return(roguetile); }