Example #1
0
 public void UpdateTimeClockText()
 {
     if (!CUtils.IsActionAvailable(action, duration, availableFirstTime))
     {
         int delta = (int)(CUtils.GetCurrentTime() - CUtils.GetActionTime(action));
         remainingTime = duration - delta;
         UpdateText();
     }
 }
Example #2
0
    private void InGame()
    {
        if (ingame)
        {
            return;
        }
        ingame = true;

        if (!PlayerPrefs.HasKey("out_game_time"))
        {
            return;
        }

        double restTimeSecs = CUtils.GetCurrentTime() - CUtils.GetActionTime("out_game");
        double restTime     = restTimeSecs / 3600;

        if (Prefs.isNoti1Enabled && restTime > NOTI_DELAY_1)
        {
            UnlockLetter();
        }

        if (Prefs.isNoti2Enabled && restTime > NOTI_DELAY_2)
        {
            UnlockLetter();
        }

        if (restTime > NOTI_DELAY_3)
        {
            GiveFreeRuby(Prefs.noti3Ruby);
        }

        if (restTime > NOTI_DELAY_4)
        {
            GiveFreeRuby(Prefs.noti4Ruby);
        }

        if (restTime > NOTI_DELAY_5)
        {
            GiveFreeRuby(Prefs.noti5Ruby);
        }

        if (restTime > NOTI_DELAY_6)
        {
            GiveFreeRuby(Prefs.noti6Ruby);
        }

        if (restTime > NOTI_DELAY_7)
        {
            GiveFreeRuby(Prefs.noti7Ruby);
        }

        Prefs.isNoti1Enabled = false;
        Prefs.isNoti2Enabled = false;
        NotificationManager.CancelAll();
    }
Example #3
0
 public void ShowClockText()
 {
     if (!CUtils.IsActionAvailable(action, duration, availableFirstTime))
     {
         int delta = (int)(CUtils.GetCurrentTime() - CUtils.GetActionTime(action));
         remainingTime = duration - delta;
         StartCoroutine(UpdateClockText());
     }
     else
     {
         ClockComplete();
     }
 }
Example #4
0
    private void InGame()
    {
        if (ingame)
        {
            return;
        }
        ingame = true;

        if (!PlayerPrefs.HasKey("out_game_time"))
        {
            return;
        }

        double restTimeSecs = CUtils.GetCurrentTime() - CUtils.GetActionTime("out_game");
        double restTime     = restTimeSecs / 3600;

        if (PlayerPrefs.HasKey("level_progress"))
        {
            if (Prefs.isNoti1Enabled && restTime > NOTI_DELAY_1)
            {
                UnlockLetter();
            }

            if (Prefs.isNoti2Enabled && restTime > NOTI_DELAY_2)
            {
                UnlockLetter();
            }
        }

        int num = 0;

        if (restTime > NOTI_DELAY_3)
        {
            GiveFreeRuby(Prefs.noti3Ruby);
            num += Prefs.noti3Ruby;
        }

        if (restTime > NOTI_DELAY_4)
        {
            GiveFreeRuby(Prefs.noti4Ruby);
            num += Prefs.noti4Ruby;
        }

        if (restTime > NOTI_DELAY_5)
        {
            GiveFreeRuby(Prefs.noti5Ruby);
            num += Prefs.noti5Ruby;
        }

        if (restTime > NOTI_DELAY_6)
        {
            GiveFreeRuby(Prefs.noti6Ruby);
            num += Prefs.noti6Ruby;
        }

        if (restTime > NOTI_DELAY_7)
        {
            GiveFreeRuby(Prefs.noti7Ruby);
            num += Prefs.noti7Ruby;
        }

        if (num > 0)
        {
            Toast.instance.ShowMessage(string.Format("You got {0} free rubies", num));
        }

        Prefs.isNoti1Enabled = false;
        Prefs.isNoti2Enabled = false;
        NotificationManager.CancelAll();
    }