35 lines
605 B
C#
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;
|
||
|
|
}
|
||
|
|
}
|