private IEnumerator ContinueGameOver(float sec) { AdsManager.Instance.canShowAd = true; yield return(new WaitForSeconds(sec)); if (isEndlessLevel) { endless.OnGameOver(); } if (!SaveManager.Instance.data.firstGameOver) { print("This is the first gameover"); //this is the first time we show gameover PlayServices.UnlockAchievement(GPGSIds.achievement_first_gameover); SaveManager.Instance.data.firstGameOver = true; SaveManager.Instance.Save(); } gameOver = true; uiTab.SetActive(false); gameOverTab.SetActive(true); AudioManager.instance.PlaySound("GameOverSound"); StartCoroutine(WaitThenUnplay(2.2f, .2f)); cameraController.Stop(); }
//PlayerStats stats; private void Awake() { isCloudDataLoaded = false; Instance = this; DontDestroyOnLoad(gameObject); //Debug.Log("Today is " + System.DateTime.Today.Date); }
public void OnBallBuy() { if (SaveManager.Instance.DoesOwnBall(selectedBallIndex)) { SetBall(selectedBallIndex); } else { if (SaveManager.Instance.BuyBall(selectedBallIndex, ballCosts[selectedBallIndex])) { //succes he bough the ball PlayServices.UnlockAchievement(GPGSIds.achievement_first_purchase); PlayServices.IncrementAchievement(GPGSIds.achievement_5_balls_purchased, 1); SetBall(selectedBallIndex); UpdateText(); } else { //he dont have enough diamonds to buy it :C NotEnoughDiamondsText.text = "You need " + (ballCosts[selectedBallIndex] - SaveManager.Instance.data.diamonds); notEnoughMoneyTab.SetActive(true); } } OnNewPage(); }
private void StartRun() { PlayServices.UnlockAchiviment(CatRunServices.achievement_faa_uma_corrida); canMove = true; an.Play("runStart"); speed = minSpeed; }
void StartRun() { PlayServices.UnlockAnchievment(EndlessRunnerServices.achievement_faa_uma_corrida); anim.Play("runStart"); speed = minSpeed; canMove = true; }
void leaderBtnFunction() { if (PlayerPrefs.GetInt("hasSound") == 0) { temp.Play(); } PlayServices.OnShowLeaderBoard(); }
public static void Death() { lose = true; staticLoseText.SetActive(true); rb.gravityScale = 1; PlayServices.AddScoreToLeaderboard(GPGSIds.leaderboard_high_score__highest, points); SaveingManager.main.DeleteData(); }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Coin")) { PlayServices.IncrementeAchivement(CatRunServices.achievement_colete_100_peixes, 1); coins++; ulManager.UpdateCoins(coins); other.transform.parent.gameObject.SetActive(false); if (coins > PlayServices.GetPlayerScore(CatRunServices.leaderboard_ranking_coins)) { PlayServices.PostScore((long)score, CatRunServices.leaderboard_ranking_coins); } } if (other.CompareTag("DoubleScore")) { StartCoroutine(DoublePoints(doubleScoreTime)); other.gameObject.SetActive(false); } if (invencible) { return; } if (other.CompareTag("Obstacle")) { canMove = false; currentLife--; ulManager.UpdateLives(currentLife); an.SetTrigger("Hit"); speed = 0; if (currentLife <= 0) { speed = 0; an.SetBool("Dead", true); ulManager.gameOverPanel.SetActive(true); if (score > PlayServices.GetPlayerScore(CatRunServices.leaderboard_ranking)) { PlayServices.PostScore((long)score, CatRunServices.leaderboard_ranking); } Invoke("CallMenu", 2f); } else { Invoke("CanMove", 0.75f); StartCoroutine(Blinking(invencibleTime)); } } }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); return; } _instance = this; DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); Debug.Log("Activated Services"); SignIn(); } else { Destroy(gameObject); } }
void Start() { Instance = this; DontDestroyOnLoad(this); try { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); Social.localUser.Authenticate((bool success) => { }); } catch (Exception exception) { Debug.Log(exception); } }
public void AddScoreToLeaderBoard(LevelType type) { if (type == LevelType.NormalLevels) { print("Adding snow score to leaderboard"); PlayServices.IncrementAchievement(GPGSIds.achievement_completed_10_normal_levels, 1); PlayServices.IncrementAchievement(GPGSIds.achievement_completed_all_normal_levels, 1); } else if (type == LevelType.SnowLevels) { print("Adding snow score to leaderboard"); PlayServices.IncrementAchievement(GPGSIds.achievement_completed_10_snow_levels, 1); PlayServices.IncrementAchievement(GPGSIds.achievement_completed_all_snow_levels, 1); } else if (type == LevelType.BlackAndWhite) { //TODO(Klendi): BW levels implement } }
// Update is called once per frame void Update() { if (lives < 1) { PlayerPrefs.SetInt("CoinsC", coins); PlayServices.AddScoreToSkillLeaderboard(); pauseBtn.gameObject.SetActive(false); gameOver.gameObject.SetActive(true); if (isSettingsActive == true) { gameOver.gameObject.SetActive(false); } if (isSettingsActive == false) { gameOver.gameObject.SetActive(true); } Time.timeScale = 0; } }
void DeadCheck() { if (isDead == false && Camera.main.transform.position.y - transform.position.y > 6) { StopPlayer(); DeadEffect(); isDead = true; GameObject.Find("GameManager").GetComponent <GameManager>().GameOver(); if (score > PlayServices.GetPlayerScore(GPGSIds.leaderboard_ranking)) { PlayServices.PostScore((long)score, GPGSIds.leaderboard_ranking); } AdMob.instance.deaths++; if (AdMob.instance.deaths >= 3) { AdMob.instance.deaths = 0; AdMob.instance.ShowPopUp(); } } }
public void OnSnowEndlessClick() { //player can afford it and hasent unlocked snow endless if (SaveManager.Instance.data.specialDiamond >= 10 && !hasUnlockedSnowEndless) { print("Bough Snow Endless"); PlayServices.UnlockAchievement(GPGSIds.achievement_unlock_snow_endless); SaveManager.Instance.data.specialDiamond -= 10; SaveManager.Instance.data.hasUnlockedSnowEndless = true; SaveManager.Instance.Save(); SceneManager.LoadScene("Endless_snow"); } //he has bough it before else if (hasUnlockedNormalEndless) { SceneManager.LoadScene("Endless_snow"); } else if (SaveManager.Instance.data.specialDiamond < 10 && !hasUnlockedSnowEndless) { //not enough diamonds endlessUnlockTab.SetActive(true); youNeedMoreDiamonds.text = "You have " + SaveManager.Instance.data.specialDiamond.ToString(); } }
private void Awake() { isCloudDataLoaded = false; Instance = this; DontDestroyOnLoad(gameObject); }
private void Awake() { playServices = GameObject.Find("GPS").GetComponent <PlayServices>(); }
public void ShowLeaderbordUI() { PlayServices.ShowLeaderBoard(); }
public void ShowLeaderBoardUI() { PlayServices.ShowLeaderboard(EndlessRunnerServices.leaderboard_ranking); }
private void Awake() { playServices = this; DontDestroyOnLoad(gameObject); }
public void ShowLeaderBoardUI() { PlayServices.ShowLeaderboard(GPGSIds.leaderboard_ranking); }
// Update is called once per frame void Update() { if (lives > 6) { lives = 6; } switch (lives) { case 6: life1.gameObject.SetActive(true); life2.gameObject.SetActive(true); life3.gameObject.SetActive(true); life4.gameObject.SetActive(true); life5.gameObject.SetActive(true); life6.gameObject.SetActive(true); break; case 5: life1.gameObject.SetActive(true); life2.gameObject.SetActive(true); life3.gameObject.SetActive(true); life4.gameObject.SetActive(true); life5.gameObject.SetActive(true); life6.gameObject.SetActive(false); break; case 4: life1.gameObject.SetActive(true); life2.gameObject.SetActive(true); life3.gameObject.SetActive(true); life4.gameObject.SetActive(true); life5.gameObject.SetActive(false); life6.gameObject.SetActive(false); break; case 3: life1.gameObject.SetActive(true); life2.gameObject.SetActive(true); life3.gameObject.SetActive(true); life4.gameObject.SetActive(false); life5.gameObject.SetActive(false); life6.gameObject.SetActive(false); break; case 2: life1.gameObject.SetActive(true); life2.gameObject.SetActive(true); life3.gameObject.SetActive(false); life4.gameObject.SetActive(false); life5.gameObject.SetActive(false); life6.gameObject.SetActive(false); break; case 1: life1.gameObject.SetActive(true); life2.gameObject.SetActive(false); life3.gameObject.SetActive(false); life4.gameObject.SetActive(false); life5.gameObject.SetActive(false); life6.gameObject.SetActive(false); break; case 0: PlayerPrefs.SetInt("CoinsC", coins); PlayServices.AddScoreToLeaderboard(); life1.gameObject.SetActive(false); life2.gameObject.SetActive(false); life3.gameObject.SetActive(false); life4.gameObject.SetActive(false); life5.gameObject.SetActive(false); life6.gameObject.SetActive(false); pauseBtn.gameObject.SetActive(false); gameOver.gameObject.SetActive(true); if (isSettingsActive == true) { gameOver.gameObject.SetActive(false); } if (isSettingsActive == false) { gameOver.gameObject.SetActive(true); } Time.timeScale = 0; break; default: PlayerPrefs.SetInt("CoinsC", coins); PlayServices.AddScoreToLeaderboard(); life1.gameObject.SetActive(false); life2.gameObject.SetActive(false); life3.gameObject.SetActive(false); life4.gameObject.SetActive(false); life5.gameObject.SetActive(false); life6.gameObject.SetActive(false); pauseBtn.gameObject.SetActive(false); gameOver.gameObject.SetActive(true); if (isSettingsActive == true) { gameOver.gameObject.SetActive(false); } if (isSettingsActive == false) { gameOver.gameObject.SetActive(true); } Time.timeScale = 0; break; } }
public void ShowAchievmentsUI() { PlayServices.ShowAchievments(); }
private void Awake() { playServices = GameObject.Find("GPS").GetComponent <PlayServices>(); audioController = GameObject.Find("Main Camera").GetComponent <AudioController>(); }
public void OnGameSucces() { cameraController.Play(.2f, false); AudioManager.instance.PlaySound("SuccesSound"); StartCoroutine(WaitThenUnplay(2.2f, .2f)); gameOver = true; succesTab.SetActive(true); uiTab.SetActive(false); highScoreDiamonds.text = string.Format("{0} / {1}", diamonds, totalDiamonds); highScoreSpecialDiamonds.text = string.Format("{0} / {1}", specialDiamonds, totalSpecialDiamonds); SaveManager.Instance.data.diamonds += diamonds; SaveManager.Instance.data.specialDiamond += specialDiamonds; AdsManager.Instance.canShowAd = true; if (isEndlessLevel) { EndlessManager endless = FindObjectOfType <EndlessManager>(); PlayGamesPlatform.Instance.LoadScores( GPGSIds.leaderboard_blitexs_endless, LeaderboardStart.PlayerCentered, 1, LeaderboardCollection.Public, LeaderboardTimeSpan.AllTime, (LeaderboardScoreData data) => { if (data.Valid) { long total = data.PlayerScore.value + (long)endless.score; PlayServices.AddScoreToLeaderBoard(GPGSIds.leaderboard_blitexs_endless, total); } }); } if (SaveManager.Instance.data.completedLevels == 0) { //first level that is played PlayServices.UnlockAchievement(GPGSIds.achievement_first_level); } if (!isSnowLevel) { SaveManager.Instance.CompleteLevel(Manager.Instance.sceneIndex, false); if (SaveManager.Instance.data.completedLevels >= 15 && !SaveManager.Instance.data.hasUnlockedSnowTheme) { //player has completed 15 levels so now he unlocks snow theme print("Congrats u unlocked snow theme"); PlayServices.UnlockAchievement(GPGSIds.achievement_unlocked_snow_theme); unlockedSnowTheme.SetActive(true); SaveManager.Instance.data.hasUnlockedSnowTheme = true; SaveManager.Instance.Save(); } } else if (isSnowLevel) { print("It is a snow level and now calling complete level"); SaveManager.Instance.CompleteLevel(Manager.Instance.sceneIndex, true); } PlayGamesPlatform.Instance.LoadScores( GPGSIds.leaderboard_blitexs_diamonds, LeaderboardStart.PlayerCentered, 1, LeaderboardCollection.Public, LeaderboardTimeSpan.AllTime, (LeaderboardScoreData data) => { if (data.Valid) { long total = data.PlayerScore.value + (long)diamonds; PlayServices.AddScoreToLeaderBoard(GPGSIds.leaderboard_blitexs_diamonds, total); } }); PlayServices.IncrementAchievement(GPGSIds.achievement_100_diamonds, diamonds); PlayServices.IncrementAchievement(GPGSIds.achievement_1000_diamonds, diamonds); PlayServices.IncrementAchievement(GPGSIds.achievement_10_000_diamonds, diamonds); StartCoroutine(WaitThenDestroy(1.5f)); }
/// <summary> /// Creates an instance and activates "PlayGamesPlatform" /// </summary> public void Awake() { instance = this; PlayGamesPlatform.Activate(); }
public void OnLeaderBoardClick() { PlayServices.ShowLeaderBoardUI(); }
private void Awake() { instance = this; DontDestroyOnLoad(gameObject); }
public void OnAchievementsClick() { PlayServices.ShowAchievementsUI(); }