//农场信息更新 private void UpdateFarmInfo() { remainTimeDic.Clear(); FarmInfo farmInfo = Singleton <FarmMode> .Instance.farmInfo; Dictionary <byte, LandVo> landInfo = farmInfo.landInfo; //判断是否为自己的农场 if (farmInfo.id == MeVo.instance.Id) { btn_sh.gameObject.SetActive(true); btn_sjtd.gameObject.SetActive(landInfo.Count >= LAND_MAX_NUM?true:false); this.UpdateFarmAttr(); btn_fhjy.gameObject.SetActive(false); info.gameObject.SetActive(true); btn_kj1.gameObject.SetActive(true); btn_kj2.gameObject.SetActive(true); btn_kj3.gameObject.SetActive(true); btn_kj4.gameObject.SetActive(true); btn_kj5.gameObject.SetActive(true); btn_kj6.gameObject.SetActive(true); btn_kj7.gameObject.SetActive(true); btn_kj8.gameObject.SetActive(true); // btn_kj9.gameObject.SetActive(true); } else { btn_sh.gameObject.SetActive(false); btn_sjtd.gameObject.SetActive(false); btn_fhjy.gameObject.SetActive(true); info.gameObject.SetActive(false); btn_kj1.gameObject.SetActive(false); btn_kj2.gameObject.SetActive(false); btn_kj3.gameObject.SetActive(false); btn_kj4.gameObject.SetActive(false); btn_kj5.gameObject.SetActive(false); btn_kj6.gameObject.SetActive(false); btn_kj7.gameObject.SetActive(false); btn_kj8.gameObject.SetActive(false); // btn_kj9.gameObject.SetActive(false); } //显示土地 byte pos; foreach (Transform child in lands) { pos = byte.Parse(child.name); if (landInfo.ContainsKey(pos)) { this.ShowOpenedLand(landInfo[pos]); } else { this.ShowClosedLand(pos); } } // foreach (byte key in landInfo.Keys) // { // this.ShowOpenedLand(landInfo[key]); // Log.info(this, "土地编号:" + landInfo[key].pos); // Log.info(this, "土地颜色:" + landInfo[key].color); // Log.info(this, "种子ID:" + landInfo[key].seedId); // Log.info(this, "收获剩余时间:" + landInfo[key].remainTime); // Log.info(this, "数量:" + landInfo[key].num); // Log.info(this, "是否可偷:" + landInfo[key].canSteal); // Log.info(this, "田地状态:" + landInfo[key].status); // } }