using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI; // 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 GameObject changingText;
// NOTE: this will not work with TextMeshPro 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 argument and put your string in here.
{
changingText.GetComponent<Text>().text = newText;
}
}