void Start() { DataStorer.InitFile("game", 0.ToString()); start = Time.time; //check if the best score is beat, if yes post it to gplay if authenticated int currentBest = int.Parse(DataStorer.Read("prout")); int currentScore = FindObjectOfType <ScoreCounter>().score; if (currentScore > currentBest) { currentBest = currentScore; DataStorer.Store("prout", currentScore.ToString()); GPlay gplay = FindObjectOfType <GPlay>(); if (gplay.authenticated) { gplay.PostScoreToLeaderboard(currentScore); } } transform.FindChild("Best score").GetComponent <Text>().text = "Best : " + currentBest; int game = int.Parse(DataStorer.Read("game")); if (game >= 4) { DataStorer.Store("game", 0.ToString()); StartCoroutine(AdManager.instance.ShowGoogleAd()); } else { game++; DataStorer.Store("game", game.ToString()); } }
void Awake() { if (!checkedd) { DataStorer.InitFile(LAG_PATH, enableLag.ToString()); string str = DataStorer.Read(LAG_PATH); enableLag = bool.Parse(str); checkedd = true; } }
void Start() { DataStorer.InitFile("prout", 0.ToString()); int best = int.Parse(DataStorer.Read("prout")); if (best != 0) { GetComponent <Text>().text = "Best : " + best; } }
public void ClickPlay() { bool tutoDone = bool.Parse(DataStorer.Read("tuto")); if (tutoDone) { SceneManager.LoadScene("Startup"); } else { StartCoroutine("GoTuto"); } }
void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; #if DEBUG Advertisement.Initialize(GAME_ID, true); #else Advertisement.Initialize(GAME_ID, false); #endif DataStorer.Store(Purchaser.ADS_PATH, Purchaser.ADS_ON); if (DataStorer.Read(Purchaser.ADS_PATH).Equals(Purchaser.ADS_OFF)) { doAds = false; } } else { Destroy(gameObject); } }
void PostBestScore() { GPlay.instance.PostScoreToLeaderboard(int.Parse(DataStorer.Read("prout"))); }