JiNanCementPlantForUnity/Assets/Scripts/UITIPData.cs

32 lines
640 B
C#

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class UITIPData : MonoBehaviour
{
public TextMeshProUGUI[] textMeshProUGUIs;
public List<string> Datas;
void Start()
{
}
public void DatShow()
{
for (int i = 0; i < textMeshProUGUIs.Length; i++)
{
if (i < Datas.Count)
textMeshProUGUIs[i].text = Datas[i];
}
}
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonUp(0))
{
gameObject.SetActive(false);
}
}
}