private void Start()
 {
     GooglePlaySignIn.onClick.AddListener(gpm.TestAuthLogin);
     GooglePlayLeaderboard.onClick.AddListener(gpm.TestShowLeaderboard);
     GooglePlayAchievement.onClick.AddListener(gpm.TestShowAchievement);
     AddLevelPoints.onClick.AddListener(() => gpm.OnUpdateClearedLevel(0));
     UpgradeAvatar.onClick.AddListener(() => { gpm.UnlockAchievement(1, 0, true); });
 }
    IEnumerator Level_Tracking_Timer(int CurrentLevel)
    {
        Debug.Log("Activating achievement tracking system level 1");

        yield return(new WaitForSeconds(Level_Unlock_Timer[CurrentLevel]));

        //Debug.Log("Achievement Increased");

        _googleplay.UnlockAchievement(1, 1, false);
    }
Exemplo n.º 3
0
    void Update()
    {
        //	If we are touching and not dragging.
        if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
        {
            RaycastHit hit;
            Ray        ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
            if (Physics.Raycast(ray, out hit))                                                                                                          //------ EVERYTHING INSIDE THIS IF STATEMENT WILL ONLY HAPPEN IF WE TOUCH THE SCREEN... MOUSE CLICKS DO NOTHING!!!!!!!!!
            {
                if (hit.collider.gameObject.tag == "Spider" && LevelManager.Instance.gameOver == false)
                {
                    //	Play the SquishSFX/
                    SoundManager.Instance.PlaySquishSFX();
                    //	Instanciate the splatterFX
                    Instantiate(bloodSplatter, hit.transform.position, bloodSplatter.transform.rotation);
                    //	get the amount of spiders squished.
                    spidersSquishedCount = PlayerPrefs.GetInt("SpidersSquished", 0);
                    //	Add 1 to the spider squished count
                    spidersSquishedCount += 1;

                    // Check if we have reached an achievment target.
                    switch (spidersSquishedCount)
                    {
                    case 100:
                        GooglePlayManager.UnlockAchievement(GPGSIds.achievement_100_spiders_squished);
                        break;

                    case 500:
                        GooglePlayManager.UnlockAchievement(GPGSIds.achievement_500_spiders_squished);
                        break;

                    case 1000:
                        GooglePlayManager.UnlockAchievement(GPGSIds.achievement_1000_spiders_squished);
                        break;

                    case 5000:
                        GooglePlayManager.UnlockAchievement(GPGSIds.achievement_5000_spiders_squished);
                        break;

                    case 10000:
                        GooglePlayManager.UnlockAchievement(GPGSIds.achievement_10000_spiders_squished);
                        break;

                    default:
                        break;
                    }

                    //	set the player prefs SpidersSquished value to the new spidersSquishedcount.
                    PlayerPrefs.SetInt("SpidersSquished", spidersSquishedCount);
                    //	Destroy the object that was hit by the ray
                    Destroy(hit.transform.gameObject);
                }
            }
        }
    }
Exemplo n.º 4
0
    private void OnParticleCollision(GameObject col)
    {
        //	get the amount of spiders sprayed.
        spidersSprayedCount = PlayerPrefs.GetInt("SpidersSprayed", 0);
        //	Add 1 to the spider squished count
        spidersSprayedCount += 1;

        // Check if we have reached an achievment target.
        switch (spidersSprayedCount)
        {
        case 50:
            GooglePlayManager.UnlockAchievement(GPGSIds.achievement_50_spiders_sprayed);
            break;

        case 100:
            GooglePlayManager.UnlockAchievement(GPGSIds.achievement_100_spiders_sprayed);
            break;

        case 250:
            GooglePlayManager.UnlockAchievement(GPGSIds.achievement_250_spiders_sprayed);
            break;

        case 500:
            GooglePlayManager.UnlockAchievement(GPGSIds.achievement_500_spiders_sprayed);
            break;

        case 1000:
            GooglePlayManager.UnlockAchievement(GPGSIds.achievement_1000_spiders_sprayed);
            break;

        default:
            break;
        }

        //	set the player prefs SpidersSquished value to the new spidersSquishedcount.
        PlayerPrefs.SetInt("SpidersSprayed", spidersSprayedCount);

        //	Play the die SFX
        SoundManager.Instance.DieSFX();
        //	Destroy the sprayed spider.
        Destroy(transform.parent.gameObject);
    }
Exemplo n.º 5
0
 public void OnAchiveClear()
 {
     GooglePlayManager.UnlockAchievement(GPGSIds.achievement, 100);
 }