void BuyVirtualItem(string itemId) { if (itemId != null) { switch (buyItemWith) { case BuyMethods.VirtualCurrency: if (StoreInventory.CanAfford(itemId)) { StoreInventory.BuyItem(itemId); } else { Debug.Log("You Dont Have Enough Balance to Buy this Product !"); } break; case BuyMethods.Upgrade: if (StoreInventory.CanAfford(itemId)) { StoreInventory.UpgradeGood(itemId); } else { Debug.Log("You Dont Have Enough Balance to Buy this Product !"); } break; case BuyMethods.Market: SoomlaStore.BuyMarketItem(itemId, "Developer Payload"); break; } } }
private void ChargeFiveDollars() { SoomlaStore.BuyMarketItem(NinjevadeAssets.NINJEVADE_499_UNLOCK_ID, "Full Unlock 5"); // PlayerPrefs.SetInt("hasMadePurchase",1); // PlayerPrefs.SetInt("displayThankYou",1); // //Google/Apple Payment for $5.00 // LowerGrass.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("LowerGrassThankYou", typeof(Sprite)) as Sprite; // DollarAmount.GetComponent<SpriteRenderer>().sprite = (Sprite)Resources.Load ("BLANKButton", typeof(Sprite)) as Sprite; }
//https://www.facebook.com/pages/Ninjevade/670973099690232 //https://twitter.com/Ninjevade private void HandleUserTouches() { for (int i = 0; i < Input.touchCount; i++) { Touch touch = Input.GetTouch(i); if (touch.phase == TouchPhase.Began && touch.tapCount == 1) { Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position); //Pay button if (touchPosition.x > 4.42 && touchPosition.y < 2.22) { //Pay For Ninjevade SoomlaStore.BuyMarketItem(NinjevadeAssets.PAY_FOR_NINJEVADE_ID, "Gratuity"); // PlayerPrefs.SetInt("hasMadePurchase",1); // PlayerPrefs.SetInt("displayThankYou",1); } //Rate Ninjevade Button else if (touchPosition.x < -4.42 && touchPosition.y < 2.22) { //Android Application.OpenURL("market://details?id=com.MatthewBurton.NITM2"); } // else if(touchPosition.x > -3.4 && touchPosition.x < -.5 && touchPosition.y < 3.5 && touchPosition.y > 1){ // //ANDROID // Application.OpenURL("https://www.facebook.com/pages/Ninjevade/670973099690232"); // }else if(touchPosition.x < 3.4 && touchPosition.x > .5 && touchPosition.y < 3.5 && touchPosition.y > 1){ // //ANDROID // Application.OpenURL("https://twitter.com/Ninjevade"); // } else if (touchPosition.x < -2.0 && touchPosition.x > -9.2 && touchPosition.y < 12.5 && touchPosition.y > 11) { //ANDROID Application.OpenURL("https://twitter.com/MattWBurton"); } } } }
private void HandleUserTouches() { if (MenuSprite.GetComponent <SpriteRenderer> ().sprite.name.Equals("MainMenu1")) { //if(Time.timeScale != 0){ for (int i = 0; i < Input.touchCount; i++) { Touch touch = Input.GetTouch(i); if (touch.phase == TouchPhase.Began) { Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position); if (touchPosition.x > -2.55 && touchPosition.x < 2.55) { if (touchPosition.y > 0.92 && touchPosition.y < 2) { displayTwoPlayerMenu(); } else if (touchPosition.y > -.1 && touchPosition.y < 0.79) { displayOnePlayerMenu(); } else if (touchPosition.y > -2.61 && touchPosition.y < -1.55) { //displayAboutMenu(); goToPinPongPage(); } else if (touchPosition.y > -1.43 && touchPosition.y < -.38) { //Social.ShowAchievementsUI(); SoomlaStore.BuyMarketItem(PinPongAssets.REMOVE_ADS_ID, "Remove Ads"); } else if (touchPosition.x > -.6 && touchPosition.x < .6 && touchPosition.y < -3.3 && touchPosition.y > -4.27) { if (Social.localUser.authenticated) { Social.ShowAchievementsUI(); } else { //Social.localUser.Authenticate((bool success) =>{}); Social.localUser.Authenticate((bool success) => { if (success) { //Debug.Log("Succesful Login"); GooglePlayIcon.GetComponent <SpriteRenderer>().sprite = (Sprite)Resources.Load("games_achievements_green", typeof(Sprite)) as Sprite; } else { //Debug.Log("Login Fail"); } }); } } return; } } } //} } if (MenuSprite.GetComponent <SpriteRenderer> ().sprite.name.Equals("OnePlayerMenu")) { //if(Time.timeScale != 0){ for (int i = 0; i < Input.touchCount; i++) { Touch touch = Input.GetTouch(i); if (touch.phase == TouchPhase.Began) { Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position); if (touchPosition.x > -2.55 && touchPosition.x < 2.55) { if (touchPosition.y > 1.21 && touchPosition.y < 2) { startGame(true, 9, 13, .6f, .38f); } else if (touchPosition.y > 0.25 && touchPosition.y < 1.05) { startGame(true, 11, 16, .5f, .3f); } else if (touchPosition.y > -0.68 && touchPosition.y < 0.07) { //startGame(true, 13, 19, .42f, .25f); startGame(true, 13.2f, 19.5f, .405f, .23f); } else if (touchPosition.y > -1.65 && touchPosition.y < -0.85) { //startGame(true, 14.5f, 21, .38f, .2f); //startGame(true, 16, 23.5f, .34f, .185f); startGame(true, 15.2f, 23, .348f, .19f); } else if (touchPosition.y > -2.6 && touchPosition.y < -1.81) { displayMainMenu(); } } } } //} } if (MenuSprite.GetComponent <SpriteRenderer> ().sprite.name.Equals("TwoPlayerMenu")) { //if(Time.timeScale != 0){ for (int i = 0; i < Input.touchCount; i++) { Touch touch = Input.GetTouch(i); if (touch.phase == TouchPhase.Began) { Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position); if (touchPosition.x > -2.55 && touchPosition.x < 2.55) { if (touchPosition.y > 1.21 && touchPosition.y < 2) { startGame(false, 9, 13); } else if (touchPosition.y > 0.25 && touchPosition.y < 1.05) { startGame(false, 11, 16); } else if (touchPosition.y > -0.68 && touchPosition.y < 0.07) { //startGame(false, 13, 19); startGame(false, 13.2f, 19.5f); } else if (touchPosition.y > -1.65 && touchPosition.y < -0.85) { //startGame(false, 14.5f, 21); //startGame(false, 16, 23.5f); startGame(false, 15.2f, 23); } else if (touchPosition.y > -2.6 && touchPosition.y < -1.81) { displayMainMenu(); } } } } //} } if (MenuSprite.GetComponent <SpriteRenderer> ().sprite.name.Equals("AboutMenu")) { //if(Time.timeScale != 0){ for (int i = 0; i < Input.touchCount; i++) { Touch touch = Input.GetTouch(i); if (touch.phase == TouchPhase.Began) { Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position); if (touchPosition.x > -2.55 && touchPosition.x < 2.55) { if (touchPosition.y > 0.09 && touchPosition.y < 0.845) { goToPinPongPage(); } else if (touchPosition.y > -2.3 && touchPosition.y < -1.5) { goToNinjevadePage(); } else if (touchPosition.y > -4.6 && touchPosition.y < -3.9) { startUpMainMenu(); } else if (touchPosition.y > 3.46 && touchPosition.y < 4.08 && touchPosition.x > 0.06 && touchPosition.x < 3.2) { goToMyTwitter(); } } } } } //} if (MenuSprite.GetComponent <SpriteRenderer> ().sprite.name.Equals("PipSpinAd")) { //if(Time.timeScale != 0){ for (int i = 0; i < Input.touchCount; i++) { Touch touch = Input.GetTouch(i); if (touch.phase == TouchPhase.Began) { Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position); if (touchPosition.x < -1.4 && touchPosition.x > -3 && touchPosition.y < -1 && touchPosition.y > -2.35) { displayMainMenu(); } else if (touchPosition.x < 3 && touchPosition.x > 1.4 && touchPosition.y < -1 && touchPosition.y > -2.35) { // goToPipSpinPage(); } } } } }
public void Purchase(Frog frog) { string productID = frog.frogName.Replace(" ", "_").ToLower(); SoomlaStore.BuyMarketItem(productID, "Purchase Complete"); }