public void PokeDwight() { DwightCounter++; if (DwightCounter == 10) { PlayGames.UnlockAchievement(GPGSIds.achievement_stop_poking_me); } }
private IEnumerator _GameOver() { if (gameOver) { yield break; } PlayGames.PostScore(GPGSIds.leaderboard_high_scores, score); DataIO.WriteData(FileType.Score, score + "", true); yield return(new WaitForSeconds(1f)); StartCoroutine(SplashScreen.Fade(false, cover, "MenuScene")); }
// Start is called before the first frame update private void Start() { _highScoreText = GameObject.Find("HighScoreText").GetComponent <Text>(); scoreText.text = "Score: " + 0; _highScore = PlayerPrefs.GetInt("HighScore", 0); Debug.Log("Adding Current High Score to Leaderboard"); PlayGames.AddScoreToLeaderboard(GPGSIds.leaderboard_leaderboard, _highScore); _highScoreText.text = "High Score: " + _highScore; InvokeRepeating(nameof(UpdateScores), 1f, 1f); }
/// <summary> /// End the game /// </summary> private void GameOver() { // Kill player playerAlive = false; if (PlayerPrefs.GetInt("TopScore") < score) { PlayerPrefs.SetInt("TopScore", score); PlayGames.AddScoreToLeaderboard(GPGSIds.leaderboard_highscores, score); } // 1000 Steps progress PlayGames.IncrementAchievement(GPGSIds.achievement_stack_addict, score); // Worst Stacker Achievement if (score == 0) { PlayGames.UnlockAchievement(GPGSIds.achievement_worst_stacker_ever); } // Make cut-off-s var deadPlayer = new GameObject[8]; for (int i = 0; i < deadPlayer.Length; i++) { deadPlayer[i] = GameObject.CreatePrimitive(PrimitiveType.Cube); deadPlayer[i].transform.localScale = newTile.transform.localScale / 2; deadPlayer[i].transform.position = newTile.transform.position; deadPlayer[i].AddComponent <Rigidbody>(); deadPlayer[i].GetComponent <Renderer>().material.color = newTile.GetComponent <Renderer>().material.color; theDeathPile.Add(deadPlayer[i]); } // Set them where the old one stood deadPlayer[0].transform.position += new Vector3(-newTile.transform.localScale.x, -newTile.transform.localScale.y, -newTile.transform.localScale.z) / 6; deadPlayer[1].transform.position += new Vector3(-newTile.transform.localScale.x, -newTile.transform.localScale.y, newTile.transform.localScale.z) / 6; deadPlayer[2].transform.position += new Vector3(-newTile.transform.localScale.x, newTile.transform.localScale.y, -newTile.transform.localScale.z) / 6; deadPlayer[3].transform.position += new Vector3(-newTile.transform.localScale.x, newTile.transform.localScale.y, newTile.transform.localScale.z) / 6; deadPlayer[4].transform.position += new Vector3(newTile.transform.localScale.x, -newTile.transform.localScale.y, -newTile.transform.localScale.z) / 6; deadPlayer[5].transform.position += new Vector3(newTile.transform.localScale.x, -newTile.transform.localScale.y, newTile.transform.localScale.z) / 6; deadPlayer[6].transform.position += new Vector3(newTile.transform.localScale.x, newTile.transform.localScale.y, -newTile.transform.localScale.z) / 6; deadPlayer[7].transform.position += new Vector3(newTile.transform.localScale.x, newTile.transform.localScale.y, newTile.transform.localScale.z) / 6; // Destroy the original Destroy(newTile); // Set camera to floor camera_goal = defaultCameraPosition; // Show end panel EndPanel.SetActive(true); }
private void UpdateScores() { _score += 1; if (_score > _highScore) { PlayerPrefs.SetInt("HighScore", _score); _highScoreText.text = "High Score: " + _score; } if (_score >= 10) { PlayGames.UnlockAchievement(GPGSIds.achievement_reach_10_score); } if (_score >= 50) { PlayGames.UnlockAchievement(GPGSIds.achievement_one_fire__reach_50_score); } }
public void PersonalWins() { PersonalStatus.GetComponent <Text>().text = "You won!"; OpponentStatus.GetComponent <Text>().text = "Loser!"; personalWins++; WinCounter.GetComponent <Text> ().text = personalWins.ToString() + "-" + opponentWins.ToString(); if (PlayerPrefs.GetInt("Friend") == 0) { PlayerPrefs.SetInt("GamesWon", PlayerPrefs.GetInt("GamesWon") + 1); PlayGames.AddScoreToLeaderboard(GPGSIds.leaderboard_global_ranking, PlayerPrefs.GetInt("GamesWon")); if (PlayerPrefs.GetInt("GamesWon") > 2 && PlayerPrefs.GetInt("rate") == 0) { PlayerPrefs.SetInt("isLoadScene", 0); } } Greeting.SetActive(true); Balloons.GetComponent <ParticleSystem> ().Play(); //Balloons.GetComponent<ParticleSystem> ().emission.enabled = true; }
void Awake() { if (Instance) { DestroyImmediate(gameObject); } else { Instance = this; DontDestroyOnLoad(gameObject); PlayGamesPlatform.Activate(); Social.localUser.Authenticate((bool success) => { if (success) { } else { } }); } }
private void UpdateScore() { score++; ScoreText.text = score.ToString(); //Achievements if (score == 1) { PlayGames.UnlockAchievement(GPGSIds.achievement_hello_world); } else if (score == 10) { PlayGames.UnlockAchievement(GPGSIds.achievement_baby_steps); } else if (score == 30) { PlayGames.UnlockAchievement(GPGSIds.achievement_getting_there); } else if (score == 100) { PlayGames.UnlockAchievement(GPGSIds.achievement_stack_champ); } }
public void ShowLeaderboard() { PlayGames.ShowLeaderboardsUI(); }
public void ShowAchievements() { PlayGames.ShowAchievementsUI(); }
public void Unlock() { if (PlayerPrefs.GetInt("skill") == 24) { PlayerPrefs.SetInt("Godlies", PlayerPrefs.GetInt("Godlies") + 3); PopUp("You received 3 Godly Fingers!"); } else if (PlayerPrefs.GetInt("skill") == 23) { PlayerPrefs.SetInt("Godlies", PlayerPrefs.GetInt("Godlies") + 4); PopUp("You received 4 Godly Fingers!"); } else if (PlayerPrefs.GetInt("skill") == 22) { PlayGames.UnlockAchievement(GPGSIds.achievement_fastest_dialler_aspirant); PlayerPrefs.SetString("title", "Fastest Dialler Aspirant!"); PopUp(PlayerPrefs.GetString("title")); } else if (PlayerPrefs.GetInt("skill") == 21) { PlayGames.UnlockAchievement(GPGSIds.achievement_you_received_5_godly_fingers); PlayerPrefs.SetInt("Godlies", PlayerPrefs.GetInt("Godlies") + 5); PopUp("You received 5 Godly Fingers!"); } else if (PlayerPrefs.GetInt("skill") == 20) { PlayGames.UnlockAchievement(GPGSIds.achievement_hardworker); PlayerPrefs.SetString("title", "Hardworker!"); PopUp(PlayerPrefs.GetString("title")); } else if (PlayerPrefs.GetInt("skill") == 19) { PlayGames.UnlockAchievement(GPGSIds.achievement_you_received_10_godly_fingers); PlayerPrefs.SetInt("Godlies", PlayerPrefs.GetInt("Godlies") + 10); PopUp("You received 10 Godly Fingers!"); } else if (PlayerPrefs.GetInt("skill") == 18) { PlayGames.UnlockAchievement(GPGSIds.achievement_fully_dedicated); PlayerPrefs.SetString("title", "Fully Dedicated!"); PopUp(PlayerPrefs.GetString("title")); } else if (PlayerPrefs.GetInt("skill") == 17) { PlayGames.UnlockAchievement(GPGSIds.achievement_new_car_unlocked); PlayerPrefs.SetInt("DeCara", 1); PopUp("You unlocked DeCara!"); } else if (PlayerPrefs.GetInt("skill") == 16) { PlayGames.UnlockAchievement(GPGSIds.achievement_born_to_be_the_best); PlayerPrefs.SetString("title", "Born to be the best!"); PopUp(PlayerPrefs.GetString("title")); } else if (PlayerPrefs.GetInt("skill") == 15) { PlayGames.UnlockAchievement(GPGSIds.achievement_new_car_yay); PlayerPrefs.SetInt("Bobman", 1); PopUp("You unlocked Bobman!"); } else if (PlayerPrefs.GetInt("skill") == 14) { PlayGames.UnlockAchievement(GPGSIds.achievement_you_received_20_godly_fingers); PlayerPrefs.SetInt("Godlies", PlayerPrefs.GetInt("Godlies") + 20); PopUp("You received 20 Godly Fingers!"); } else if (PlayerPrefs.GetInt("skill") == 13) { PlayGames.UnlockAchievement(GPGSIds.achievement_new_ride_marvellous); PlayerPrefs.SetInt("Hoaxer", 1); PopUp("You unlocked Hoaxer!"); } else if (PlayerPrefs.GetInt("skill") == 12) { PlayGames.UnlockAchievement(GPGSIds.achievement_new_car_sassy); PlayerPrefs.SetInt("GarelioST", 1); PopUp("You unlocked GarelioST"); } else if (PlayerPrefs.GetInt("skill") == 11) { PlayGames.UnlockAchievement(GPGSIds.achievement_new_ride_so_classy); PlayerPrefs.SetInt("ZetaX", 1); PopUp("You unlocked ZetaX!"); } else if (PlayerPrefs.GetInt("skill") == 10) { PlayGames.UnlockAchievement(GPGSIds.achievement_master_sooo_great); PlayerPrefs.SetString("title", "Master!"); PopUp(PlayerPrefs.GetString("title")); } else if (PlayerPrefs.GetInt("skill") == 9) { PlayGames.UnlockAchievement(GPGSIds.achievement_you_unlocked_the_car); PlayerPrefs.SetInt("XpeedRX", 1); PopUp("You unlocked XpeedRX!"); } else { //Unlock contentment :D, no such thing... chill out. } }
public void OnLeaderboard() { PlayGames.ShowLeaderboardUI(); }