using TMPro;
//Declare variable of type text mesh pro text
TextMeshProUGUI TMPtext;
//Class variables
TMPText.text = "beans";
using UnityEngine;
using TMPro;
public class Score : MonoBehaviour
{
public TextMeshProUGUI text;
public static int Score;
// Use this for initialization
void Start()
{
text = GetComponent<TextMeshProUGUI>();
}
// Update is called once per frame
void Update()
{
text.text = NewScore.ToString();
}
}
//needed in order to use Text Mesh Pro
using TMPro;
public class YourClass : MonoBehaviour
{
public TextMeshProUGUI InfoText;
public void Something() {
//Write to the text mesh pro element InfoText
InfoText.text = "Write whatever text you want here!";
}
}