Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class CoinPrefs : MonoBehaviour
- {
- void Start()
- {
- GetComponent<Text>().text = PlayerPrefs.GetInt("Score").ToString();
- }
- public void OnDisable()
- {
- PlayerPrefs.SetInt("Score", Int32.Parse(GetComponent<Text>().text));
- }
- }
Add Comment
Please, Sign In to add comment