If you want to implement an energy system or record the player's highest score and always show it to him or so on, you need to save the player's information on player device.
here we can use PlayerPrefs.
in term of description : PlayerPrefs is a class that stores Player preferences between game sessions. It can store string, float and integer values into the user’s platform registry.
***warn:Unity stores PlayerPrefs in a local registry, without encryption. Do not use PlayerPrefs data to store sensitive data.*
Here I put some codes to access this feature:
Unity-C# :
PlayerPrefs.SetInt(string key , int value);//To store numerical data in the player's device with a special label
PlayerPrefs.GetInt(string key , default value);//To get numerical information from the player's device.
Top comments (0)