text variable type unity code example
Example: text variable type unity
using UnityEngine;
using UnityEngine.UI; //make sure to add this!
public class Script : MonoBehaviour
{
public int counter = 0;
public Text variable; //make reference in Unity Inspector Window
void Update()
{
counter++;
variable.text = "counter: " + counter;
}
}