Label(Count)っていうオブジェクト名のUILabelがある。
いまのところ「Count:」って文字を入れているが、そこに別の値を突っ込む。
using UnityEngine; using System.Collections; public class BallScript : MonoBehaviour { private UILabel label; // Use this for initialization void Start () { label = GameObject.Find("Label(Count)").GetComponent<UILabel>(); } // Update is called once per frame void Update () { label.text = "Count:" + 1.ToString (); } }
→GameObject.Find("Label(Count)").GetComponent
→label変数のtextに"Count:" + 1.ToString ()って文字を入れた。
この要領で、カウントとかスコアとかもいける。