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

49 lines
1.1 KiB
C#
Raw Permalink 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 TMPro;
using UnityEngine;
using UnityEngine.UI;
public class APISon : UIController
{
[SerializeField] Button Btn;
public APIWindows windows2;
int sum = 1;
public string data = "创建机器人方法CREATE参数无参重载2重载返回值无返回值SZPT";
public string name;
[SerializeField] TextMeshProUGUI text;
// Start is called before the first frame update
void Start()
{
init();
}
void init()
{
Btn.onClick.AddListener(() =>
{
try
{
if (sum % 2 != 0)
{
windows2.gameObject.SetActive(true);
windows2?.init(data);
}
else
{
windows2.gameObject.SetActive(false);
}
sum++;
}
catch (System.Exception ex)
{
Debug.Log(ex.Message);
}
});
if (text != null)
{
text.text = name;
}
}
}