Beispiel #1
0
 public void dontShowAdd()
 {
     alreadyContinued = true;
     m_showVideoToContinue.gameObject.SetActive(false);
     GoogleGamesManager.noContinue5();
     endGame();
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     if (instance != null)
     {
         Destroy(this.gameObject);
         return;
     }
     instance = this;
     DontDestroyOnLoad(this.gameObject);
     initialize();
 }
Beispiel #3
0
    void AdCallbackhandler(ShowResult result)
    {
        Debug.Log("class called");
        switch (result)
        {
        case ShowResult.Finished:
            Debug.Log("Ad Finished. Rewarding player...");
            AdsManager.getInstance().myCallback(true);
            GoogleGamesManager.continue10Times();
            break;

        case ShowResult.Skipped:
            Debug.Log("Ad skipped. Son, I am dissapointed in you");
            AdsManager.getInstance().myCallback(false);
            break;

        case ShowResult.Failed:
            Debug.Log("I swear this has never happened to me before");
            AdsManager.getInstance().myCallback(false);
            break;
        }
    }
Beispiel #4
0
    public void endGame()
    {
        if (!alreadyContinued)
        {
            if (!tryToShowVideo)
            {
                showOptionVideo();
            }
            tryToShowVideo = true;
            return;
        }

        if (!gameEnded)
        {
            m_gameOverScreen.OpenCloseObjectAnimation();
            m_actualPuntuation.text = m_score.ToString();

            if (PlayerPrefs.GetInt("Score") < m_score)
            {
                PlayerPrefs.SetInt("Score", m_score);
            }
            int getBest = PlayerPrefs.GetInt("Score");
            m_bestPuntuation.text = getBest.ToString();
            gameEnded             = true;

            if (getBest >= 10)
            {
                GoogleGamesManager.scoreOf10();
            }
            if (getBest >= 30)
            {
                GoogleGamesManager.scoreOf30();
            }

            GoogleGamesManager.saveScore(getBest);
        }
    }
 // Use this for initialization
 void Start()
 {
     if(instance != null) {
         Destroy(this.gameObject);
         return;
     }
     instance = this;
     DontDestroyOnLoad(this.gameObject);
     initialize();
 }
Beispiel #6
0
 public void viewLeaderBoard()
 {
     GoogleGamesManager.viewLeaderBoard();
 }