E_ElecCompetition/Electrical_inspectionCompet.../Assets/Adam/Scripts/NameplateController.cs

48 lines
1.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using static UnityEditor.Progress;
public class NameplateController : MonoSingleton<NameplateController>
{
public GameObject NameplatePanel;
public RectTransform backTransform;
public RectTransform mtTransform;
public Image NameplateImage;
public List<TextMeshProUGUI> NameplateTextUGUI;
public GameObject[] Obj_Nameplate;
public Dictionary<string, TextMeshProUGUI> DictextMeshPro;
private void Start()
{
AddNameplateClick();
}
public void AddNameplateClick()
{
DictextMeshPro = new Dictionary<string, TextMeshProUGUI>();
DictextMeshPro.Add("低压互感器铭牌", NameplateTextUGUI[0]);
DictextMeshPro.Add("光伏并网逆变器_铭牌", NameplateTextUGUI[1]);
DictextMeshPro.Add("光伏板_铭牌", NameplateTextUGUI[2]);
Obj_Nameplate = GameObject.FindGameObjectsWithTag("铭牌");
foreach (GameObject item in Obj_Nameplate)
{
item.AddComponent<ShowNameplate>();
}
}
public void RefreshShown()
{
foreach (TextMeshProUGUI item in NameplateTextUGUI)
{
item.gameObject.SetActive(false);
}
}
}