private void ChangePurchaseButtonDisplay(int itemCreditCost, int itemCoinCost, CloudGoodsBundle state)
    {
        Debug.Log("State: " + state.ToString());
        switch (state)
        {
        case CloudGoodsBundle.CreditPurchasable:
            StandardCurrencyPurchaseWindowFull.SetActive(false);
            StandardCurrencyPurchaseWindowHalf.SetActive(false);
            PremiumCurrencyPurchaseWindowFull.SetActive(true);
            PremiumCurrencyPurchaseWindowHalf.SetActive(false);

            UnityUIPurchaseButtonDisplay premiumButtonDisplay = PremiumCurrencyPurchaseWindowFull.GetComponent <UnityUIPurchaseButtonDisplay>();
            premiumButtonDisplay.SetState(itemCreditCost);
            break;

        case CloudGoodsBundle.CoinPurchasable:
            StandardCurrencyPurchaseWindowFull.SetActive(true);
            StandardCurrencyPurchaseWindowHalf.SetActive(false);
            PremiumCurrencyPurchaseWindowFull.SetActive(false);
            PremiumCurrencyPurchaseWindowHalf.SetActive(false);

            UnityUIPurchaseButtonDisplay standardButtonDisplay = StandardCurrencyPurchaseWindowFull.GetComponent <UnityUIPurchaseButtonDisplay>();
            standardButtonDisplay.SetState(itemCoinCost);
            break;

        case CloudGoodsBundle.Free:
            StandardCurrencyPurchaseWindowFull.SetActive(false);
            StandardCurrencyPurchaseWindowHalf.SetActive(false);
            PremiumCurrencyPurchaseWindowFull.SetActive(true);
            PremiumCurrencyPurchaseWindowHalf.SetActive(false);

            UnityUIPurchaseButtonDisplay standardButtonDisplayFree = StandardCurrencyPurchaseWindowFull.GetComponent <UnityUIPurchaseButtonDisplay>();
            standardButtonDisplayFree.SetState(itemCoinCost);
            break;

        default:
            StandardCurrencyPurchaseWindowFull.SetActive(false);
            StandardCurrencyPurchaseWindowHalf.SetActive(true);
            PremiumCurrencyPurchaseWindowFull.SetActive(false);
            PremiumCurrencyPurchaseWindowHalf.SetActive(true);

            UnityUIPurchaseButtonDisplay standardButtonDisplayDefault = StandardCurrencyPurchaseWindowHalf.GetComponent <UnityUIPurchaseButtonDisplay>();
            standardButtonDisplayDefault.SetState(itemCoinCost);

            UnityUIPurchaseButtonDisplay PremiumButtonDisplayDefault = PremiumCurrencyPurchaseWindowHalf.GetComponent <UnityUIPurchaseButtonDisplay>();
            PremiumButtonDisplayDefault.SetState(itemCoinCost);
            break;
        }
    }
Beispiel #2
0
    private void ChangePurchaseButtonDisplay(int itemCreditCost, int itemCoinCost)
    {
        StandardCurrencyFullWindow.SetActive(false);
        StandardCurrencyHalfWindow.SetActive(false);
        PremiumCurrencyFullWindow.SetActive(false);
        PremiumCurrencyHalfWindow.SetActive(false);

        if (itemCreditCost < 0 && itemCreditCost < 0)
        {
            StandardCurrencyFullWindow.SetActive(true);

            UnityUIPurchaseButtonDisplay freeButtonDisplay = StandardCurrencyFullWindow.GetComponent <UnityUIPurchaseButtonDisplay>();
            freeButtonDisplay.SetState(itemCoinCost);
        }
        else if (itemCreditCost < 0)
        {
            StandardCurrencyFullWindow.SetActive(true);

            UnityUIPurchaseButtonDisplay StandardOnlyButtonDisplay = StandardCurrencyFullWindow.GetComponent <UnityUIPurchaseButtonDisplay>();
            StandardOnlyButtonDisplay.SetState(itemCoinCost);
        }
        else if (itemCoinCost < 0)
        {
            PremiumCurrencyFullWindow.SetActive(true);

            UnityUIPurchaseButtonDisplay PremiumOnlyButtonDisplay = PremiumCurrencyFullWindow.GetComponent <UnityUIPurchaseButtonDisplay>();
            PremiumOnlyButtonDisplay.SetState(itemCreditCost);
        }
        else
        {
            PremiumCurrencyHalfWindow.SetActive(true);
            StandardCurrencyHalfWindow.SetActive(true);

            UnityUIPurchaseButtonDisplay PremiumButtonDisplay  = PremiumCurrencyHalfWindow.GetComponent <UnityUIPurchaseButtonDisplay>();
            UnityUIPurchaseButtonDisplay StandardButtonDisplay = StandardCurrencyHalfWindow.GetComponent <UnityUIPurchaseButtonDisplay>();
            PremiumButtonDisplay.SetState(itemCreditCost);
            StandardButtonDisplay.SetState(itemCoinCost);
        }
    }