public bool FindAvailableIAP(TargetedBundleVO offerVO, out string currentIapId, out string offerCost)
        {
            bool            result         = false;
            IDataController dataController = Service.Get <IDataController>();

            currentIapId = string.Empty;
            offerCost    = string.Empty;
            InAppPurchaseController inAppPurchaseController = Service.Get <InAppPurchaseController>();
            int i     = 0;
            int count = offerVO.LinkedIAPs.Count;

            while (i < count)
            {
                string uid = offerVO.LinkedIAPs[i];
                InAppPurchaseTypeVO optional = dataController.GetOptional <InAppPurchaseTypeVO>(uid);
                if (optional != null)
                {
                    InAppPurchaseProductInfo iAPProduct = inAppPurchaseController.GetIAPProduct(optional.ProductId);
                    if (iAPProduct != null)
                    {
                        currentIapId = optional.ProductId;
                        offerCost    = iAPProduct.FormattedRealCost;
                        result       = true;
                        break;
                    }
                }
                i++;
            }
            return(result);
        }
Esempio n. 2
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(this);
        }

        DontDestroyOnLoad(this);
    }