using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro; // Make sure to add this import statement
public class ChangeText : MonoBehaviour
{
// Place this script on the Canvas.
// Drop the text element into the following channel:
public TextMeshProUGUI changingText;
// NOTE: this will not work with basic text.
public void TextChange(string newText) // Point your button to this method. You can pass whatever text you want through that interface
// or just remove the parameter and put your string in here.
{
changingText.GetComponent<TextMeshProUGUI>().text = newText;
}
}