public IEnumerator RefreshCells() { for (int x = 0; x < sizeMap.x; x++) { for (int y = 0; y < sizeMap.y; y++) { UIEmpireCell cell = cells[new Vector2(x, y)]; int status = (int)UIEmpireManager.Instance.curLand.LandData[x, y]; cell.ChangeState((UIEmpireCell.State)status); } yield return(null); } }
public void OnRemoveBuilding(UIEmpireBuildingFinished building) { Vector2 startpos = Vector2.zero; Vector2 endPos = Vector2.zero; // GetRectOfBuiding(cells[building.posInMap], building._empireBuilding, out startpos, out endPos); for (int x = (int)startpos.x; x <= endPos.x; x++) { for (int y = (int)startpos.y; y <= endPos.y; y++) { Vector2 curCellPos = new Vector2(x, y); if (cells.ContainsKey(curCellPos)) { UIEmpireCell curCell = cells[curCellPos]; curCell.ChangeState(UIEmpireCell.State.Free); } } } }