Exemple #1
0
    // Change the currency balance text when the balance changed
    public void OnCurrencyBalanceChanged(VirtualCurrency vc, int balance, int amountAdded)
    {
        GameObject temp_1 = GameObject.Find("store_ui_gr");

        if (temp_1 != null)
        {
            store_manager_script = temp_1.GetComponent <SOAPStoreManager>();
        }

        store_manager_script.setStoreCoinText();
        store_manager_script.setGameOverCoinText();
        store_manager_script.setPauseCoinText();

        // Unlock achievement for accumulating coins
        #if UNITY_ANDROID
        if (balance >= 20000 && balance < 100000)
        {
            Achievements.forARainyDayAchievement();
        }

        if (balance > 100000)
        {
            Achievements.mustHaveThemAllAchievement();
        }
        #endif
    }
Exemple #2
0
    // Pause the game, update the coin balance text, and score texts
    public void doPause()
    {
        Time.timeScale = 0;
        pause_button.SetActive(false);
        game_screen_score_text.SetActive(false);
        pause_menu.SetActive(true);
        store_manager_script.setPauseCoinText();

        // Update the score texts
        point_manager_script.updateBestScoreText();
        point_manager_script.updateCurrentScoreText();
        pause_play_btn = GameObject.Find("pause_play_btn").GetComponent <Button>();
        pause_play_btn.Select();
        is_paused = true;
    }