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 Start() { ControlManager.GetInstance().CreateEvent("Anim"); ControlManager.GetInstance().SubscribeToEvent("Anim", AnimOk); DataStorer.InitFile("tuto", false.ToString()); GPlay.instance.onAuthenticateSucess += PostBestScore; }
void Start() { // If we haven't set up the Unity Purchasing reference if (m_StoreController == null) { // Begin to configure our connection to Purchasing InitializePurchasing(); } DataStorer.InitFile(ADS_PATH, ADS_ON); }
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; } }