Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- //namespace CompleteProject
- //{
- public class ScoreManager : MonoBehaviour
- {
- public static int score; // The player's score.
- Text text; // Reference to the Text component.
- void Start (){
- score = PlayerPrefs.GetInt ("skorum"); //PlayerPrefs.GetInt ("skorum", score);
- }
- void Awake ()
- {
- //PlayerPrefs.SetInt("skorum",score);
- // Set up the reference.
- text = GetComponent <Text> ();
- // Reset the score.
- score = 0;
- }
- void Update ()
- {
- PlayerPrefs.SetInt ("skorum", score);
- // Set the displayed text to be the word "Score" followed by the score value.
- //text.text = "" + score;
- text.text = "" + score;
- }
- }
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement