Skip to content

Instantly share code, notes, and snippets.

@moon-goon
Last active February 9, 2016 03:19
Show Gist options
  • Save moon-goon/8016bfd0152b29083cb9 to your computer and use it in GitHub Desktop.
Save moon-goon/8016bfd0152b29083cb9 to your computer and use it in GitHub Desktop.
using UnityEngine;
using UnityEngine.UI;
public class score_manager : MonoBehaviour {
public Text txtScore;
private int myScore;
void Start () {
myScore = 0;
}
void scoreUpdate() {
txtScore.text = "SCORE : " + myScore;
}
public void addScore(int newScore) {
myScore += newScore;
scoreUpdate();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment