Exemple #1
0
    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());
        }
    }
Exemple #2
0
 public static void UpdateAll(bool lag)
 {
     enableLag = lag;
     for (int i = 0; i < all.Count; i++)
     {
         all[i].CheckLag();
     }
     DataStorer.Store(LAG_PATH, enableLag.ToString());
 }
Exemple #3
0
 public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
 {
     // A consumable product has been purchased by this user.
     if (String.Equals(args.purchasedProduct.definition.id, productID_noAds, StringComparison.Ordinal))
     {
         DataStorer.Store(ADS_PATH, ADS_OFF);
     }
     else
     {
         Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id));
     }        // Return a flag indicating wither this product has completely been received, or if the application needs to be reminded of this purchase at next app launch. Is useful when saving purchased products to the cloud, and when that save is delayed.
     return(PurchaseProcessingResult.Complete);
 }
 public void Click()
 {
     if (Time.time - startTime < 1f)
     {
         return;
     }
     if (clicked == 0)
     {
         startTime = Time.time;
         clicked++;
         StopCoroutine("Gen");
         StartCoroutine("Noel");
         saveText.SetActive(false);
         text2.SetActive(true);
         text4.SetActive(true);
         left.isKinematic  = false;
         right.isKinematic = false;
         Destroy(left.gameObject, 2f);
         Destroy(right.gameObject, 2f);
     }
     else if (clicked == 1)
     {
         Time.timeScale = 1.3f;
         startTime      = Time.time + 9f;
         clicked++;
         StopCoroutine("Noel");
         text2.SetActive(false);
         text3.SetActive(true);
         text4.SetActive(false);
         plank.transform.rotation = Quaternion.Euler(0f, 0f, -17f);
         StartCoroutine("Gen2");
     }
     else
     {
         DataStorer.Store("tuto", true.ToString());
         Time.timeScale = 1f;
         SceneManager.LoadScene("Tuto");
     }
 }
Exemple #5
0
    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);
        }
    }