E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/KDLURL/Dialogue.cs

19 lines
422 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class Dialogue : MonoBehaviour
{
[SerializeField] TextMeshProUGUI text;
[SerializeField] Button Btn;
// Start is called before the first frame update
public void init(string str)
{
text.text= str;
Btn.onClick.AddListener(()=>gameObject.SetActive(false));
}
}