Exemple #1
0
    void Awake()
    {
        if (Instance != null)
        {
            Object.Destroy(Instance);
            Instance = null;
        }
        Instance          = this;
        SelectedSlotType  = GuiShop.E_ItemType.Weapon;
        SelectedSlotIndex = 0;

        m_SkinModel.Init();
        ShopDataBridge.CreateInstance();
    }
Exemple #2
0
    IEnumerator InitInAppPurchases()
    {
        while (!CloudUser.instance.isUserAuthenticated)
        {
            yield return(new WaitForEndOfFrame());
        }

        while (!SettingsCloudSync.GetInstance().isDone)
        {
            yield return(new WaitForEndOfFrame());
        }

        List <InAppInitRequest> iapList = new List <InAppInitRequest>();

        FundSettings[] items = FundSettingsManager.Instance.GetAll();

        foreach (FundSettings s in items)
        {
            if (s.DISABLED)
            {
                continue;
            }

            if (s.AddGold > 0 || s.AddMoney > 0)
            {
                iapList.Add(new InAppInitRequest
                {
                    ProductId   = s.GUID.ToString(),
                    ProductName = ShopDataBridge.GetFundName(s),
                    ProductType = InAppProductType.Consumable
                });
            }
        }

        InAppPurchaseMgr.Instance.Init(iapList.ToArray());
    }