public void ApplyProduct(Item item = null) { buttonChangeProduct.SetActive(item != null); if (product != null) { product.isProduction = false; if (productionData.coroutineProduce != null) { productSlot.StopCoroutine(productionData.coroutineProduce); productionData.coroutineProduce = null; } } product = item; productSlot.gameObject.SetActive(false); if (product == null) { return; } productSlot.InitSlot(productionData); productSlot.gameObject.SetActive(true); product.isProduction = true; }
public void Show(string placeID, placeInfoType infoType) { panelPlaceInfo.SetActive(true); place = WorldMapController.Instance.placeDic[placeID]; place.placeData.onChangedPlaceLevel += OnChagedPlaceLevel; place.placeData.onChangedHeroList += OnChangedDeployHeroData; productSlot.InitSlot(place.placeData); OnChangedDeployHeroData(); textPlaceName.text = GameDataManager.placeBaseDataDic[placeID].name; string description = GameDataManager.placeBaseDataDic[placeID].placeBuffDescription.Replace("[formula]", "<color=#00ff00ff>" + place.placeData.power.ToString() + "</color>"); textDiscripcion.text = description; KingdomManagement.Item baseData = GameDataManager.itemDic[GameDataManager.placeBaseDataDic[placeID].productID]; textProductName.text = baseData.name; AssetLoader.AssignImage(imageProduct, "sprite/material", "Atlas_Material", baseData.image); textPlaceLevel.text = place.placeLevel.ToString(); textAddCost.text = place.addCost.ToStringABC(); textUpgradeCost.text = place.upgradeCost.ToStringABC(); addPlaceInfopPanel.SetActive(infoType == placeInfoType.AddPlace); emptyPlaceInfoPanel.SetActive(infoType == placeInfoType.EmptyPlace); for (int i = 0; i < resourcePoolList.Count; i++) { resourcePoolList[i].gameObject.SetActive(false); } if (MoneyManager.GetMoney(MoneyType.placeTicket).value == 0) { buttonUpgrade.interactable = false; buttonPlaceAdd.interactable = false; return; } if (place != null) { //buttonUpgrade.interactable = MoneyManager.GetMoney(MoneyType.gold).value >= place.upgradeCost; //buttonPlaceAdd.interactable = MoneyManager.GetMoney(MoneyType.gold).value >= place.addCost; //to do : 테스트를 위해 placeTicket만 사용하여 영지 점령과 강화를 한다. buttonUpgrade.interactable = true; buttonPlaceAdd.interactable = true; } }
/// <summary> 생산품 리스트 초기화 </summary> void InitProductionList(string type = "food") { for (int i = 0; i < productSlotList.Count; i++) { productSlotList[i].gameObject.SetActive(false); } int slotCount = 0; if (type == "food") { foodList.Sort((Item a, Item b) => { int indexA = a.index; int indexB = b.index; return(indexA.CompareTo(indexB)); }); for (int i = 0; i < foodList.Count; i++) { if (foodList[i].isProduction && foodList[i].id != productID) { continue; } slotCount++; UIProductSlot slot = CreateSlot(); slot.InitSlot(foodList[i]); slot.gameObject.SetActive(true); } } else { etcList.Sort((Item a, Item b) => { int indexA = a.index; int indexB = b.index; return(indexA.CompareTo(indexB)); }); for (int i = 0; i < etcList.Count; i++) { if (etcList[i].isProduction && etcList[i].id != productID) { continue; } slotCount++; UIProductSlot slot = CreateSlot(); slot.InitSlot(etcList[i]); slot.gameObject.SetActive(true); } } SizeControl(slotCount); }