void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { cMan.AddCurrency(valueAmount); Destroy(gameObject); } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.name == "Player") { tomatoSoundID = AndroidNativeAudio.play(tomatoFileID, 0.3f); scoreManager.AddScore(scoreToGive); currencyManager.AddCurrency(currencyToGive); gameObject.SetActive(false); } }
void HandleShowResultStars(ShowResult result) { if (result == ShowResult.Finished) { print("Video Complete"); currencyManagerScript.AddCurrency(25, new Vector3(0, 0, 0)); displayCurrencyCountScript.UpdateTotal(); showVideoStars.SetActive(false); } }
private bool PayPriceShopItem() { if (_price <= CurrencyManager.CurrentCurrency) { CurrencyManager.AddCurrency(-_price); return(true); } else { return(false); } }
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 }
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(); } }
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); }
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); } }
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); } }
private void HandleShowResult(ShowResult result) { switch (result) { case ShowResult.Finished: CurrencyManager.AddCurrency(_currentIapItem.Definition.Currency); break; case ShowResult.Skipped: break; case ShowResult.Failed: break; } }
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"); } }
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 }
public void EarnCoins(Vector3 pos) { currencyManagerScript.AddCurrency(coinsIncreaseAmount, pos); displayCurrencyCountScript.UpdateTotal(); }