Exemple #1
0
    public void OnPointerClick(PointerEventData eventdata)
    {
        if (!unlocked)
        {
            if (GameControl.control.coin >= coinValue)
            {
                Unlocked();

                GooglePlay.UnlockAchievement(GPGSIds.achievement_new_cannonball);
                GooglePlay.IncrementalAchievement(GPGSIds.achievement_skin_to_win, 1);

                GameControl.control.skinUnlocked[skinNumber] = true;
                GameControl.control.coin -= coinValue;
            }
            else
            {
                Debug.Log("Not Enough Coins");
            }
        }
        else
        {
            RemoveHighlightFromAllSkins();
            HighlightMyskin();
            GameControl.control.skinSelected = this.skinNumber;
        }
    }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     EngineSound  = GameObject.Find("EngineSound").GetComponent <AudioSource>();
     SoundManager = GameObject.Find("SoundManager").GetComponent <SoundManager>();
     GooglePlay   = GameObject.FindGameObjectWithTag("GooglePlay").GetComponent <GooglePlay>();
     EngineSound.Play();
 }
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Block") || other.CompareTag("SpecialBlock"))
        {
            if (GameControl.control.highScore < UpdateScore.updateScore)
            {
                GameControl.control.highScore = UpdateScore.updateScore;
                GooglePlay.AddScoreToLeaderboard(GPGSIds.leaderboard_high_score, (long)UpdateScore.updateScore);

                if (GameControl.control.highScore >= 1000)
                {
                    GooglePlay.UnlockAchievement(GPGSIds.achievement_ultimate_prime_defender);
                }
            }
            GooglePlay.IncrementalAchievement(GPGSIds.achievement_prime_novice, 1);
            GooglePlay.IncrementalAchievement(GPGSIds.achievement_prime_intermediate, 1);
            GooglePlay.IncrementalAchievement(GPGSIds.achievement_prime_expert, 1);
            SceneManager.LoadScene("Main");
        }

        if (other.CompareTag("SPChild"))
        {
            Destroy(other.gameObject);
        }
    }
 void BlockDaeth()
 {
     sc.newBlock.Remove(this.gameObject);
     UpdateScore.score++;
     GooglePlay.UnlockAchievement(GPGSIds.achievement_beginner_candy_crusher);
     myAnim.enabled   = true;
     myCircle.enabled = false;
     myAnim.SetTrigger("Color" + randomColor);
     StartCoroutine(DeathDelay());
     playBlockSound = true;
 }
 public void RestartThisGame()
 {
     //UpdateScore updateScore = (UpdateScore)FindObjectOfType(typeof(UpdateScore));
     if (GameControl.control.highScore < UpdateScore.updateScore)
     {
         GameControl.control.highScore = UpdateScore.updateScore;
         GooglePlay.AddScoreToLeaderboard(GPGSIds.leaderboard_high_score, UpdateScore.updateScore);
     }
     Time.timeScale = 1;
     MenuSound.menuSound.activateClickButtonSound = true;
     SceneManager.LoadScene("Main");
 }
Exemple #6
0
    // Use this for initialization
    void Start()
    {
        SoundManager    = GameObject.Find("SoundManager").GetComponent <SoundManager>();
        BackgroundMusic = GameObject.Find("BackgroundMusic").GetComponent <BackgroundMusic>();
        EngineSound     = GameObject.Find("EngineSound").GetComponent <EngineSound>();
        GooglePlay      = GameObject.FindGameObjectWithTag("GooglePlay").GetComponent <GooglePlay>();

        if (SoundManager.IsOff())
        {
            volume.GetComponent <Image>().sprite = soundOff;
            SoundsEnabled = false;
        }
    }
    void Awake()
    {
        if (gpsingleton == null)
        {
            gpsingleton = this;
        }
        else
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        googlePlay = new GooglePlay();
    }
Exemple #8
0
    public void SaveCurrentLevelWin(int Stars)
    {
        string currentScene;
        int    currentSceneNo;

        currentScene = SceneManager.GetActiveScene().name;

        currentSceneNo = Convert.ToInt32(currentScene.Substring(currentScene.IndexOf("_") + 1, currentScene.Length - Convert.ToInt32(currentScene.IndexOf("_") + 1)));

        if (currentSceneNo == PlayerPrefs.GetInt("UnlockedScenes"))
        {
            PlayerPrefs.SetInt("UnlockedScenes", PlayerPrefs.GetInt("UnlockedScenes") + 1);
            GooglePlay.IncrementAchievement(GPGSIds.leaderboard_high_scores, 10);
            GooglePlayManager.Instance.View5WinsIncrementalAchievment();
            GooglePlayManager.Instance.View10WinsIncrementalAchievment();
            GooglePlayManager.Instance.View15WinsIncrementalAchievment();
            GooglePlayManager.Instance.View20WinsIncrementalAchievment();

            PlayerPrefs.SetInt("WinsInARow", PlayerPrefs.GetInt("WinsInARow") + 1);

            GooglePlayManager.Instance.ViewWins3LevelsInARowIncrementalAchievment();
            GooglePlayManager.Instance.ViewWins5LevelsInARowIncrementalAchievment();
        }


        if (PlayerPrefs.HasKey("Stars_" + currentSceneNo.ToString()))
        {
            if (PlayerPrefs.GetInt("Stars_" + currentSceneNo.ToString()) < Stars)
            {
                PlayerPrefs.SetInt("TotalStars", PlayerPrefs.GetInt("TotalStars") + Stars - PlayerPrefs.GetInt("Stars_" + currentSceneNo.ToString()));
                PlayerPrefs.SetInt("Stars_" + currentSceneNo.ToString(), Stars);
            }
        }
        else
        {
            PlayerPrefs.SetInt("Stars_" + currentSceneNo.ToString(), Stars);
            PlayerPrefs.SetInt("TotalStars", PlayerPrefs.GetInt("TotalStars") + Stars);
        }

        GooglePlay.AddScoreToLeaderboard(GPGSIds.leaderboard_high_scores, PlayerPrefs.GetInt("TotalStars") * 10);
    }
 public void Leaderboard()
 {
     GooglePlay.ShowLeaderboards();
 }
 public void Achievements()
 {
     GooglePlay.ShowAchievementsUI();
 }
 public void UnlockAchievement()
 {
     GooglePlay.UnlockAchievement(GPGSIds.achievement_incremental_achievement_view_ads);
 }
 public void ShowLeaderboard()
 {
     GooglePlay.ShowLeaderbaordsUI();
 }
 // Use this for initialization
 void Start()
 {
     GP      = GetComponent <GooglePlay>();
     manager = GetComponent <Manager>();
 }
Exemple #14
0
 // Use this for initialization
 void Start()
 {
     GooglePlay = GameObject.FindGameObjectWithTag("GooglePlay").GetComponent <GooglePlay>();
 }
 public void Death()
 {
     UiCanvas.instance.Death(true);
     GooglePlay.AddScoreToLeaderboard(EBGPSIds.leaderboard_elemental_ballz, level);
 }