Exemplo n.º 1
0
    IEnumerator InitItems()
    {
        JsonData json = null;

        yield return(StartCoroutine(AssetLoader.LoadJsonData("data/item", "Item", x => json = x)));

        for (int i = 0; i < json.Count; i++)
        {
            KingdomManagement.Item item = new KingdomManagement.Item(json[i]);
            itemDic.Add(item.id, item);
        }
    }
Exemplo n.º 2
0
    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;
        }
    }