ict.shenzhi/Assets/Scripts/UI/MainScenesUI/APIWindows.cs

41 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class APIWindows : MonoBehaviour
{
[SerializeField] List<TextMeshProUGUI> text = new List<TextMeshProUGUI>();
// Start is called before the first frame update
//void Start()
//{
// //init("创建机器人方法CREATE参数无参重载2重载返回值无返回值SZPT");
//}
public void init(string item)
{
if (!string.IsNullOrEmpty(item))
{
var temp1 = item.Split('');
foreach (var item2 in temp1)
{
Debug.Log(item2);
}
for (int i = 0; i < text.Count; i++)
{
var temp2 = temp1[i].Split("");
if (temp2.Length >= 2)
{
text[i].text = "<color=#2CC9FE>" + temp2[0] + "</color>" + temp2[1];
}
else
{
text[i].text = temp2[0];
}
}
}
}
public void show()
{
}
}