NG_/Assets/Scripts/UI/全局/ChangeText.cs
2024-12-13 19:40:05 +08:00

35 lines
605 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
public class ChangeText : MonoBehaviour,IPointerClickHandler
{
public TextMeshProUGUI textUI;
public string text;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void OnPointerClick(PointerEventData eventData)
{
textUI.text = text;
}
public void OnMouseDown()
{
textUI.text = text;
}
}