using UnityEngine;
using UnityEngine.UI;
public class garbagefreetext : MonoBehaviour {
UILabel _NguiLabel; //NGUI
//Text _UguiLabel; //uGUI
string[] generated;
void Start () {
_NguiLabel = GetComponent<UILabel>(); //NGUI
//_UguiLabel = GetComponent<Text>(); //uGUI
generated
= new string[100];
// go from 0 to 99.
for (int i = 0; i < 100; i++) {
generated [i] = string.Format ("{0:00}", i);
}
}
void Update () {
int random = UnityEngine.Random.Range (0, generated.Length);
_NguiLabel.text = generated [random]; //NGUI
//_UguiLabel.text = generated [random]; //uGUI
}
}