Cute_demon_attacks/meng_yao/Assets/script/TanChuang/Lingjiang_Tanchuang.cs

40 lines
1.5 KiB
C#
Raw Normal View History

2024-11-16 17:56:30 +08:00
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>();
2024-12-25 12:02:14 +08:00
boxTypes.Add(new BoxType { Name = "", prompt = "", Type = 13, content = "<22>˹<EFBFBD><CBB9><EFBFBD>δ<EFBFBD><CEB4>ͨ" });
boxTypes.Add(new BoxType { Name = "", prompt = <><C8B7>", Type = 11 });
2024-11-16 17:56:30 +08:00
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;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸߶<CDB8>
gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>ģʽΪ<CABD><CEAA><EFBFBD><EFBFBD>
//gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>ģʽΪ<CABD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//<2F><>¼ȷ<C2BC><C8B7><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
{
if (type == 1)
{
gameObject.GetComponent<input_box_pop_up_window>().destroy();
}
});
}
// Update is called once per frame
}