unity persistent data
private int health;
private void Load()
{
if(PlayerPrefs.HasKey("health"))
{
health = PlayerPrefs.GetInt("health");
}
}
private void Save()
{
PlayerPrefs.SetInt("health", health);
PlayerPrefs.Save();
}
Also in C#:
- random from list c#
- how to raycast unit
- print content of array c#
- foreach c#
- Instantiate c#
- mongodb c# batch find
- unity change text
- c# tab character
- how to reference the position of a game object unity
- c# read a webpage data
- how to close a form c#
- unity fall damage c#
- blazor onchange event not firing with inputselect
- how to insert into a list c#
- c# join string array
- internal c#
- get attribute value of xml element c#
- c# while loop
- get string character by index c#
- unity cycle children
- c# get desktop path
- asp.net textarea disable resize
- c# display float with 2 decimal places
- xarray: create 2d dataset