Cute_demon_attacks/meng_yao/Assets/script/TanChuang/Customer_serviceTanchuang.cs
2024-11-15 15:13:21 +08:00

44 lines
1.6 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 UnityEngine.UI;
public class Customer_serviceTanchuang : 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 = "客服联系方式qq5649846541654" });
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
void Update()
{
}
}