Created
October 28, 2017 22:06
-
-
Save JonathanYin/e86bf2b5efcd46d762ee2cb8625c3446 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
public class ScoreManager : MonoBehaviour | |
{ | |
public static int score; | |
Text text; | |
void Awake () | |
{ | |
text = GetComponent <Text> (); | |
score = 0; | |
} | |
void Update () | |
{ | |
text.text = "Score: " + score; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment