Question by
Mortis-Mutilati · Sep 17, 2016 at 10:42 AM ·
timer countdownquit
OnApplicationQuit Timer
Hi guys. I made a timer for gaining life but i have a problem. Time.deltatime doesnt work on application quit and how can i restart quittime again on application quit?
void OnApplicationQuit()
{
if (calculate.kalan < 5)
{
quittime = PlayerPrefs.GetFloat("LastTime");
quittime -= Time.deltaTime;
if (quittime < 0)
{
calculate.kalan++;
PlayerPrefs.SetInt("Hak", calculate.kalan);
quittime = 300;
}
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612092953im_/https://answers.unity.com/themes/thub/images/avi.jpg)