40 lines
1.5 KiB
C#
40 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
public class Lingjiang_Tanchuang : mount
|
|
{
|
|
public Button Kfbtn;
|
|
public Transform canvas;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
Kfbtn.onClick.AddListener(Display_pop_up_window);
|
|
}
|
|
|
|
|
|
private void Display_pop_up_window()
|
|
{
|
|
|
|
|
|
List<BoxType> boxTypes = new List<BoxType>();
|
|
boxTypes.Add(new BoxType { Name = "", prompt = "", Type = 13, content = "此功能未开通" });
|
|
boxTypes.Add(new BoxType { Name = "", prompt = "确认", Type = 11 });
|
|
GameObject gameObject = add_pop_up();
|
|
gameObject.transform.position = new Vector3(Screen.width / 2, Screen.height / 2, 0);
|
|
gameObject.transform.SetParent(canvas);
|
|
gameObject.GetComponent<input_box_pop_up_window>().minHeight = 300;//设置最低高度
|
|
gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//设置滚动模式为滚动
|
|
//gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//设置滚动模式为自动填充
|
|
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "绑定提示");//测试输入框回调处理
|
|
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
|
{
|
|
if (type == 1)
|
|
{
|
|
gameObject.GetComponent<input_box_pop_up_window>().destroy();
|
|
}
|
|
});
|
|
}
|
|
// Update is called once per frame
|
|
}
|