/// <summary> /// 刷新 /// </summary> void Refresh() { if (coinLabel != null) { coinLabel.text = GameCenter.treasureHouseMng.coinNum.ToString(); } foreach (TreasureHouseRef data in treasureHouseDic.Values) { treasureRef = data; //抽取按钮上的需要元宝数量 if (extractOneLabel != null) { extractOneLabel.text = data.extract1.ToString(); } if (extractTenLabel != null) { extractTenLabel.text = data.extract10.ToString(); } if (extractFiftyLabel != null) { extractFiftyLabel.text = data.extract50.ToString(); } //钥匙 if (keyLabel != null) { keyLabel.text = GameCenter.inventoryMng.GetNumberByType(data.keyID).ToString(); } //元宝 if (goldLabel != null) { goldLabel.text = GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount.ToString(); } } }
void Refresh() { SetExtract(); foreach (TreasureHouseRef data in treasureHouseDic.Values) { treasureRef = data; for (int i = 0; i < smallItems.Count; i++) { if (i < data.smallAward.Count) { smallItems[i].FillInfo(new EquipmentInfo(data.smallAward[i], EquipmentBelongTo.PREVIEW)); } } int prof = GameCenter.mainPlayerMng.MainPlayerInfo.Prof; for (int i = 0; i < bigItems.Count; i++) { if (i < data.bigAward.Count && prof == 1)//战士 { bigItems[i].FillInfo(new EquipmentInfo(data.bigAward[i], EquipmentBelongTo.PREVIEW)); } else if (i < data.bigAward1.Count && prof == 2)//法师 { bigItems[i].FillInfo(new EquipmentInfo(data.bigAward1[i], EquipmentBelongTo.PREVIEW)); } else if (i < data.bigAward2.Count && prof == 3)//刺客 { bigItems[i].FillInfo(new EquipmentInfo(data.bigAward2[i], EquipmentBelongTo.PREVIEW)); } } if (extractOneLabel != null) { extractOneLabel.text = data.extract1.ToString(); } if (extractTenLabel != null) { extractTenLabel.text = data.extract10.ToString(); } if (extractFiftyLabel != null) { extractFiftyLabel.text = data.extract50.ToString(); } //钥匙 if (keyLabel != null) { keyLabel.text = GameCenter.inventoryMng.GetNumberByType(data.keyID).ToString(); } //元宝 if (goldLabel != null) { goldLabel.text = GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount.ToString(); } } if (redPoint != null) { redPoint.gameObject.SetActive(GameCenter.treasureHouseMng.isRed); } }