示例#1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         cMan.AddCurrency(valueAmount);
         Destroy(gameObject);
     }
 }
示例#2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.name == "Player")
     {
         tomatoSoundID = AndroidNativeAudio.play(tomatoFileID, 0.3f);
         scoreManager.AddScore(scoreToGive);
         currencyManager.AddCurrency(currencyToGive);
         gameObject.SetActive(false);
     }
 }
示例#3
0
    void HandleShowResultStars(ShowResult result)
    {
        if (result == ShowResult.Finished)
        {
            print("Video Complete");

            currencyManagerScript.AddCurrency(25, new Vector3(0, 0, 0));
            displayCurrencyCountScript.UpdateTotal();
            showVideoStars.SetActive(false);
        }
    }
示例#4
0
 private bool PayPriceShopItem()
 {
     if (_price <= CurrencyManager.CurrentCurrency)
     {
         CurrencyManager.AddCurrency(-_price);
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#5
0
            static bool Prefix(CurrencyManager __instance, ref string userName, ref Currency __result)
            {
                __result = __instance.Currencies.FirstOrDefault <Currency>(x => x.CurrencyName.Length > 0);

                // create default currency if none exists
                if (__result == null)
                {
                    __instance.AddCurrency(userName, "Dollar", Eco.Shared.Items.CurrencyType.Backed);
                    __result = __instance.GetCurrency("Dollar");
                }

                return(false); // prevent default method execution
            }
示例#6
0
    public void ClaimReward()
    {
        currencyManagerScript.AddCurrency(reward, new Vector3(0, 0, 0));
        displayCurrencyCountScript.UpdateTotal();
        panel.SetActive(false);

        LeanTween.value(yellow, 1, 0, 1).setOnUpdate((float flt) => {
            yellow.GetComponent <Image>().fillAmount = flt;
        });
        star.GetComponent <Animator>().Play("New State");
        particles.SetActive(false);

        if (SecurePlayerPrefs.GetInt("Notif", 0) == 0)
        {
            notifPanel.SetActive(true);
            SecurePlayerPrefs.SetInt("Notif", 1);
        }
        else
        {
            UpdateNotifs();
        }
    }
示例#7
0
    public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
    {
        // A consumable product has been purchased by the user.
        if (System.String.Equals(args.purchasedProduct.definition.id, PURCHASE_GETCURRENCY_SMALL, System.StringComparison.Ordinal))
        {
            //The currency has been purchased. Add the currency to the existing currency.
            cm.AddCurrency(5);
            Debug.Log("You purchased 5 diamonds or whatever we call these. We thank you but also hope you go buy some more because this is only enough for like one beer, if that.");
        }
        else if (System.String.Equals(args.purchasedProduct.definition.id, PURCHASE_GETCURRENCY_MEDIUM, System.StringComparison.Ordinal))
        {
            //The currency has been purchased. Add the currency to the existing currency.
            cm.AddCurrency(10);
            Debug.Log("You purchased 10 diamonds or whatever we call these. This is better, but come on, we're greedy bastards. Give us money!!");
        }
        // Or ... a subscription product has been purchased by this user.
        else if (System.String.Equals(args.purchasedProduct.definition.id, PURCHASE_GETCURRENCY_BIG, System.StringComparison.Ordinal))
        {
            //The currency has been purchased. Add the currency to the existing currency.
            cm.AddCurrency(50);
            Debug.Log("You purchased 50 diamonds or whatever we call these. Okay, now we're talking! Here I come, Jamaica!");
        }
        else if (System.String.Equals(args.purchasedProduct.definition.id, PURCHASE_GETNOADS, System.StringComparison.Ordinal))
        {
            //The player gave money to get rid of the adds. Stop the adds from playing.
            Debug.Log("Thaaank youuu!");
        }
        // An unknown product has been purchased by this user
        else
        {
            Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id));
        }

        // Return a flag indicating whether this product has completely been received, or if the application needs
        // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still
        // saving purchased products to the cloud, and when that save is delayed.
        return(PurchaseProcessingResult.Complete);
    }
示例#8
0
 private void OnBuyCoffeeClick(GameObject go)
 {
     if (CurrencyManager.CurrentCurrency >= _goodItem.Price)
     {
         CurrencyManager.AddCurrency(-_goodItem.Price);
         GameManager.PlayerModel.Inventory.AddItem(HolderObjectFactory.GetItem(typeof(Adrenaline), _goodItem.RewardAmount));
         UpdateBalance();
         UpdateAmountCoffeeInInventory();
     }
     else
     {
         GoldObject.SetActive(true);
     }
 }
示例#9
0
        public override void Use(GameManager gameManager)
        {
            base.Use(gameManager);

            if (CurrencyManager.CurrentCurrency < 60)
            {
                GameManager.Player.MainHud.ShowHudText(Localization.Get("no_money"), HudTextColor.Red);
            }
            else
            {
                SpawnCoke();
                CurrencyManager.AddCurrency(-60);
            }
        }
示例#10
0
        private void HandleShowResult(ShowResult result)
        {
            switch (result)
            {
            case ShowResult.Finished:
                CurrencyManager.AddCurrency(_currentIapItem.Definition.Currency);
                break;

            case ShowResult.Skipped:
                break;

            case ShowResult.Failed:
                break;
            }
        }
示例#11
0
 private void OnBuyClick(GameObject go)
 {
     if (CurrencyManager.CurrentCurrency >= IapItem.Price)
     {
         CurrencyManager.AddCurrency(-IapItem.Price);
         var item  = HolderObjectFactory.GetItem(_item.GetType(), IapItem.RewardAmount);
         var isAdd = GameManager.PlayerModel.Inventory.AddItem(item);
         if (!isAdd)
         {
             GameManager.PlacementItemsController.DropItemToGround(GameManager, item);
         }
         StartCoroutine(AnimateBuyItem());
     }
     else
     {
         _shop.SelectCategory(NewShopCategory.Gold);
         _shop.NoManyAnimate();
     }
 }
 public void OnClick()
 {
     if (text.text == "500")
     {
         currency.AddCurrency(500, transform.position);
         displayCurrency.UpdateTotal();
         SecurePlayerPrefs.SetInt(collectionPrefName, 1);
         text.text = "Complete";
         starImage.SetActive(false);
     }
     else if (text.text == "Complete")
     {
         // Do Nothing
     }
     else
     {
         anims.Animate();
         StartCoroutine("LoadNextScene");
     }
 }
示例#13
0
        private void OnRequestClick(GameObject go)
        {
#if FACEBOOK
            if (FB.IsLoggedIn)
            {
                FbManager.InviteFriendsRequest(result =>
                {
                    if (!string.IsNullOrEmpty(result.RawResult))
                    {
                        if (PlayerPrefs.GetInt("is_add_friends", 0) == 0)
                        {
                            CurrencyManager.AddCurrency(100);
                            PlayerPrefs.SetInt("is_add_friends", 1);
                            AddfriendsRewardObject.SetActive(false);
                        }
                    }
                });
            }
            else
            {
                FbManager.Login();
            }
#endif
        }
示例#14
0
 public void EarnCoins(Vector3 pos)
 {
     currencyManagerScript.AddCurrency(coinsIncreaseAmount, pos);
     displayCurrencyCountScript.UpdateTotal();
 }