JiNanCementPlantForUnity/Assets/Scripts/UITIP.cs

70 lines
2.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public enum TipType
{
None,
,
,
}
public class UITIP : MonoBehaviour
{
public TipType type;
public string Message;
// Start is called before the first frame update
void Start()
{
GameObject go = GameObject.Find("Canvas/FloatingTip");
GetComponentInChildren<Button>().onClick.AddListener(() =>
{
switch (type)
{
case TipType.None:
break;
case TipType.:
go.transform.Find("水").gameObject.SetActive(true);
go.transform.Find("水/Name").GetComponent<TextMeshProUGUI>().text = Message;
go.transform.Find("水").GetComponent<UITIPData>().DatShow();
break;
case TipType.:
go.transform.Find("电").gameObject.SetActive(true);
go.transform.Find("电/Name").GetComponent<TextMeshProUGUI>().text = Message;
go.transform.Find("电").GetComponent<UITIPData>().DatShow();
break;
case TipType.:
go.transform.Find("煤").gameObject.SetActive(true);
go.transform.Find("煤/Name").GetComponent<TextMeshProUGUI>().text = Message;
//if (Message == "3号线煤磨")
//{
// go.transform.Find("煤/videoBtn").gameObject.SetActive(true);
//}
go.transform.Find("煤").GetComponent<UITIPData>().DatShow();
break;
default:
break;
}
});
}
/// <summary>
/// 对接后端参数
/// </summary>
public void xxx()
{
}
public void BtnClick()
{
}
// Update is called once per frame
void Update()
{
}
}