예제 #1
0
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    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();
        }
    }
예제 #2
0
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //Hemos SUPERADO el nivel
 public void GameIsFinished()
 {
     //GameAnalytics.NewProgressionEvent (GA_Progression.GAProgressionStatus.GAProgressionStatusComplete, levelNo.ToString ());
     gameState = GameState.GameFinish;
     AudioManager.instance.StopAudio();
     winPop.ShowPopUp();
 }
예제 #3
0
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /*
     * 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();
        }
    }
예제 #4
0
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    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();
        }
    }
예제 #5
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    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();
        }
    }
예제 #6
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //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);
    }
예제 #7
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public IEnumerator Finishing()
    {
        yield return(new WaitForSeconds(0.6f));

        moreBubblesPop.ShowPopUp();
    }