コード例 #1
0
 public void InitRecreationAreaPopup(RecreationAreaData data, UserProductData inventoryData)
 {
     titleText.GetComponent <LocalizationComponent>().SetTheLocalizedText(data.name);
     descriptionText.GetComponent <LocalizationComponent>().SetTheLocalizedText(data.description);
     amountText.text = inventoryData.count.ToString();
     icon.sprite     = data.icon;
 }
コード例 #2
0
    //TODO - add card!

    public override void Init(BasePopupData data)
    {
        base.Init(data);
        userInventory = GameManager.Instance.GetUserInventory();
        UserProductData inventoryData = userInventory.productDataList.Find(x => x.guid == ((AtractionPopupData)data).guid);

        AttractionsDataAsset    attractionsDataAsset = GameManager.Instance.GetAttractionsData();
        AttractionDataAssetItem assetDataItem        = attractionsDataAsset.attractionsDataAsset.Find
                                                           (a => a.gameEventType == attractionsDataAsset.currentEvent);
        RecreationAreaData recreationAreaData = assetDataItem.recreationAreaData.Find(a => a.guid == ((AtractionPopupData)data).guid);

        if (recreationAreaData != null)
        {
            InitRecreationAreaPopup(recreationAreaData, inventoryData);
        }
    }
コード例 #3
0
    public override void Init(BasicAtractionData data)
    {
        inventory           = GameManager.Instance.GetUserInventory();
        gameAsset           = GameManager.Instance.GetGameData();
        _recreationAreaData = (RecreationAreaData)data;
        guid             = data.guid;
        _userProductData = inventory.GetUserProductData(guid);

        if (_userProductData == null || _userProductData.count == 0)
        {
            _recreationAreaData.state = ItemState.LOCKED; //TODO - remove hardcodation
        }
        else
        {
            _recreationAreaData.state = ItemState.IDLE; //TODO - remove hardcodation
        }
        InitUIElements();
        CheckBuyBtnState();
    }