UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"Save Coins Uisng Playerpref"
public class CoinsManager : MonoBehaviour { Text coinsScore; public static int coinAmount; public static int coinsCount; void Start () { coinsCount = PlayerPrefs.GetInt("Coins"); } void Update() { coinsCount = coinAmount; coinsScore.text = "Coins: " coinsCount; PlayerPrefs.SetInt("Coins", coinsCount); } }