Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

System.DateTime.Today why not working on mobile?

A topic by Ber-C created Aug 03, 2021 Views: 218
Viewing posts 1 to 2
(1 edit)

Hello!

This is my script, I want to save DateTime when I close the android app. It works perfectly on the editor, but on mobile, it doesn't. Why? Thank you!

   void OnApplicationQuit()

    {

        Application.Quit();

        //Savee the current system time as a string in the player prefs class

        PlayerPrefs.SetString("sysString", System.DateTime.Today.ToBinary().ToString());

        print("Saving this date to prefs: " + System.DateTime.Today);

        PlayerPrefs.SetInt("LastScore", 0);

    }

Moderator moved this topic to General Development