private bool TryGetTile(GameObject go, out IndoorTile tile) { if (go.transform.parent == null) { tile = null; return(false); } GameObject parent = go.transform.parent.gameObject; if (parent == null) { tile = null; return(false); } tile = parent.GetComponent <IndoorTile>(); if (tile == null) { return(false); } return(true); }
public void Undo() { IndoorTile tile = _map.GetTile(_tileID); tile.ChangeTileType(_oldType); }
public void Execute() { IndoorTile tile = _map.GetTile(_tileID); tile.ChangeTileType(_newType); }