Vladkiber

Влад

Mar 30th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6.  
  7. public class CoinPrefs : MonoBehaviour
  8. {
  9.    
  10.     void Start()
  11.     {
  12.         GetComponent<Text>().text = PlayerPrefs.GetInt("Score").ToString();
  13.     }
  14.     public void OnDisable()
  15.     {
  16.     PlayerPrefs.SetInt("Score", Int32.Parse(GetComponent<Text>().text));
  17.     }
  18. }
Add Comment
Please, Sign In to add comment