コード例 #1
0
        /// <summary>
        /// Handles a store controller initialized event.
        /// </summary>
        public void onSoomlaStoreInitialized()
        {
            ExampleLocalStoreInfo.Init();

            // some usage examples for add/remove currency
            // some examples
            if (ExampleLocalStoreInfo.VirtualCurrencies.Count > 0)
            {
                try {
                    StoreInventory.GiveItem(ExampleLocalStoreInfo.VirtualCurrencies[0].ItemId, 4000);
                    SoomlaUtils.LogDebug("SOOMLA ExampleEventHandler", "Currency balance:" + StoreInventory.GetItemBalance(ExampleLocalStoreInfo.VirtualCurrencies[0].ItemId));
                } catch (VirtualItemNotFoundException ex) {
                    SoomlaUtils.LogError("SOOMLA ExampleEventHandler", ex.Message);
                }
            }

            ExampleWindow.GetInstance().setupItemsTextures();
        }
コード例 #2
0
 /// <summary>
 /// Handles a good balance changed event.
 /// </summary>
 /// <param name="good">Virtual good whose balance has changed.</param>
 /// <param name="balance">Balance.</param>
 /// <param name="amountAdded">Amount added.</param>
 public void onGoodBalanceChanged(VirtualGood good, int balance, int amountAdded)
 {
     ExampleLocalStoreInfo.UpdateBalances();
 }
コード例 #3
0
 /// <summary>
 /// Handles a currency balance changed event.
 /// </summary>
 /// <param name="virtualCurrency">Virtual currency whose balance has changed.</param>
 /// <param name="balance">Balance of the given virtual currency.</param>
 /// <param name="amountAdded">Amount added to the balance.</param>
 public void onCurrencyBalanceChanged(VirtualCurrency virtualCurrency, int balance, int amountAdded)
 {
     ExampleLocalStoreInfo.UpdateBalances();
 }