public void InitFoodAndBeveragePopup(FoodAndBeverageData data, UserProductData inventoryData)
 {
     titleText.GetComponent <LocalizationComponent>().SetTheLocalizedText(data.name);
     descriptionText.GetComponent <LocalizationComponent>().SetTheLocalizedText(data.description);
     amountText.text = inventoryData.count.ToString();
     icon.sprite     = data.icon;
 }
    //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);
        FoodAndBeverageData foodAndBeverageData = assetDataItem.foodAndBeverageData.Find(a => a.guid == ((AtractionPopupData)data).guid);

        if (foodAndBeverageData != null)
        {
            InitFoodAndBeveragePopup(foodAndBeverageData, inventoryData);
        }
    }
示例#3
0
    public override void Init(BasicAtractionData data)
    {
        inventory            = GameManager.Instance.GetUserInventory();
        gameAsset            = GameManager.Instance.GetGameData();
        _foodAndBeverageData = (FoodAndBeverageData)data;
        guid             = data.guid;
        _userProductData = inventory.GetUserProductData(guid);

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

        fillAnimation.Init(fillImage, _foodAndBeverageData.fillTimeSeconds, OnAnimComplete);
    }