Esempio n. 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());
        }
    }
Esempio n. 2
0
    void Start()
    {
        ControlManager.GetInstance().CreateEvent("Anim");
        ControlManager.GetInstance().SubscribeToEvent("Anim", AnimOk);

        DataStorer.InitFile("tuto", false.ToString());
        GPlay.instance.onAuthenticateSucess += PostBestScore;
    }
Esempio n. 3
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());
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 void Awake()
 {
     if (!checkedd)
     {
         DataStorer.InitFile(LAG_PATH, enableLag.ToString());
         string str = DataStorer.Read(LAG_PATH);
         enableLag = bool.Parse(str);
         checkedd  = true;
     }
 }
Esempio n. 6
0
    void Start()
    {
        DataStorer.InitFile("prout", 0.ToString());
        int best = int.Parse(DataStorer.Read("prout"));

        if (best != 0)
        {
            GetComponent <Text>().text = "Best : " + best;
        }
    }
Esempio n. 7
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);
 }
Esempio n. 8
0
    public void ClickPlay()
    {
        bool tutoDone = bool.Parse(DataStorer.Read("tuto"));

        if (tutoDone)
        {
            SceneManager.LoadScene("Startup");
        }
        else
        {
            StartCoroutine("GoTuto");
        }
    }
Esempio n. 9
0
 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");
     }
 }
Esempio n. 10
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);
        }
    }
Esempio n. 11
0
 void PostBestScore()
 {
     GPlay.instance.PostScoreToLeaderboard(int.Parse(DataStorer.Read("prout")));
 }