Text variable type unity

Code examples

1
0

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;
    }
}

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................