Esempio n. 1
0
 void OnApplicationQuit()
 {
     System.DateTime Now = System.DateTime.Now;
     //Reset Now
     PlayerPrefs.SetInt("A_Desc", Now.Year);
     PlayerPrefs.SetInt("Me_Desc", Now.Month);
     PlayerPrefs.SetInt("D_Desc", Now.Day);
     PlayerPrefs.SetInt("H_Desc", Now.Hour);
     PlayerPrefs.SetInt("Mi_Desc", Now.Minute);
     PlayerPrefs.SetInt("S_Desc", Now.Second);
     PlayerPrefs.SetInt("dormirEnCama", 0);
     CS.Sueño();
 }
Esempio n. 2
0
    IEnumerator Sleep()
    {
        yield return(new WaitForSeconds(8));

        System.DateTime Now = System.DateTime.Now;
        PlayerPrefs.SetInt("A_Desc", Now.Year);
        PlayerPrefs.SetInt("Me_Desc", Now.Month);
        PlayerPrefs.SetInt("D_Desc", Now.Day);
        PlayerPrefs.SetInt("H_Desc", Now.Hour);
        PlayerPrefs.SetInt("Mi_Desc", Now.Minute);
        PlayerPrefs.SetInt("S_Desc", Now.Second);
        PlayerPrefs.SetInt("dormirEnCama", 1);
        CS.Sueño();
        Application.Quit();
    }