void OnDestroy()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Пример #2
0
    /*
     * private void max_five_coins_guest() {
     *      if (PlayerPrefs.GetInt ("facebook_stat") == 0 &&
     *          PlayerPrefs.GetInt ("gemu_stat") == 0 &&
     *          PlayerPrefs.GetInt ("gplus_stat") == 0) {
     *
     *              if(countCoin>5) {
     *                      countCoin=5;
     *                      //waktuCount = 0;
     *                      //isTimerOn = false;
     *                      //jumlahCoinsUser.text = "X " + countCoin.ToString();
     *                      PlayerPrefs.SetInt("coins_user", countCoin);
     *                      PlayerPrefs.Save();
     *              }
     *      }
     * }
     */


    // Update is called once per frame
    void Update()
    {
        updateCoins();

        if (waktuTambahCoins != null)
        {
            waktuTambahCoins.text = CoinTimerHandler.FormatJam(Mathf.Floor(CoinTimerHandler.instance.GetTimeDiff()));
        }
    }
 void Awake()
 {
     realTimeSinceLastFrame = Time.realtimeSinceStartup;
     DontDestroyOnLoad(this.gameObject);
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         DestroyImmediate(this.gameObject);
     }
 }
Пример #4
0
 // Update is called once per frame
 void Update()
 {
     textTimer.text = CoinTimerHandler.FormatJam(Mathf.Floor(CoinTimerHandler.instance.GetTimeDiff()));
 }