///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void BackButtonPressed() { //MENU if (Application.loadedLevelName == "03 Menu") { settingsPopUp.HidePopUp(); quitPopUp.ShowPopUp(); } //WORLDS else if (Application.loadedLevelName == "04 World Menu") { //GameAnalytics.NewProgressionEvent (GA_Progression.GAProgressionStatus.GAProgressionStatusFail, LevelManager.levelNo.ToString()); Application.LoadLevel("03 Menu"); //Go to Menu Scene } //GAME-WORLDS else if (Application.loadedLevelName == "05 Game Scene") { settingsPopUp.HidePopUp(); livesPopUp.ShowPopUp(); } //GAME-ARCADE else if (Application.loadedLevelName == "06 Arcade Game Scene") { settingsPopUp.HidePopUp(); quitArcadePopUp.ShowPopUp(); } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Hemos SUPERADO el nivel public void GameIsFinished() { //GameAnalytics.NewProgressionEvent (GA_Progression.GAProgressionStatus.GAProgressionStatusComplete, levelNo.ToString ()); gameState = GameState.GameFinish; AudioManager.instance.StopAudio(); winPop.ShowPopUp(); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* * void Update() * { * //Nos esperamos un frame antes de mostrar el popup ya que PopUpMgr se espera un frame para evitar problemas con el Update del InputScript * if(bShowCoinsPopUp){ * ShopCoinsPopUp.ShowPopUp(); * bShowCoinsPopUp=false; * } * } */ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void PurchaseBall() { int price = int.Parse(textPrice.text); //Comprar un booster y restar dinero disponible if (PlayerPrefs.GetInt("Coins") >= price) { int quantity = PlayerPrefs.GetInt(BallString) + numBalls; int coins = PlayerPrefs.GetInt("Coins") - price; PlayerPrefs.SetInt(BallString, quantity); CoinsManager.instance.SetCoins(coins); NumberBallText.text = PlayerPrefs.GetInt(BallString).ToString(); if (OnSpecialBallBuyed != null) { OnSpecialBallBuyed(); } } //Si no hay suficiente dinero, abrir el popup para comprar monedas else { ShopBoostersPopUp.HidePopUp(); //bShowCoinsPopUp=true; ShopCoinsPopUp.ShowPopUp(); } }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void ShowTutorial() { if (tutorialsList.Contains(LevelManager.levelNo)) { int index = tutorialsList.IndexOf(LevelManager.levelNo); tutorialImage.sprite = tutorialSprites[index]; tutorialText.text = LanguageManager.GetText("id_" + tutorialImage.sprite.name); tutorialPopUp.ShowPopUp(); } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void purchaseLives() { if (LivesManager.lives < 5 && PlayerPrefs.GetInt("Coins") >= 100) { LivesManager.lives = 5; CoinsManager.instance.SetCoins(PlayerPrefs.GetInt("Coins") - 100); coinstext.text = PlayerPrefs.GetInt("Coins").ToString(); LivesPopUp.HidePopUp(); //ParseManager.instance.SaveCurrentData(); //Adjust.trackEvent(new AdjustEvent("ydzqno")); } else if (LivesManager.lives < 5 && PlayerPrefs.GetInt("Coins") < 100) { LivesPopUp.HidePopUp(); ShopCoinsPopUp.ShowPopUp(); } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Hemos PERDIDO el nivel public void GameIsOver() { if (gameState != GameState.Start) { return; } if (LevelManager.GameType == LevelManager.GameTypes.NORMAL) { //GameAnalytics.NewProgressionEvent (GA_Progression.GAProgressionStatus.GAProgressionStatusFail, levelNo.ToString ()); } else { //GameAnalytics.NewProgressionEvent (GA_Progression.GAProgressionStatus.GAProgressionStatusComplete, "Arcade", score); } gameState = GameState.GameOver; AudioManager.instance.StopAudio(); losePop.ShowPopUp(); if (LevelManager.GameType == LevelManager.GameTypes.ARCADE) { if (score > PlayerPrefs.GetInt("Highscore")) { PlayerPrefs.SetInt("Highscore", score); highscoretext.text = score.ToString(); } } else { //LivesManager.lives--; } //ParseManager.instance.SaveCurrentData(); //PlayerPrefs.SetInt("Lives", PlayerPrefs.GetInt("Lives") - 1 ); //Invoke("LoadLevelAgain", 3f); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public IEnumerator Finishing() { yield return(new WaitForSeconds(0.6f)); moreBubblesPop.ShowPopUp(); }