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

79 lines
2.7 KiB
C#
Raw Normal View History

2024-11-07 18:03:20 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class GgTanchuang : mount
{
public Button Ggbtn;
public Image hdtxbg;
public RectTransform GgPanel;
Vector3 Deflate = new Vector3(0.5f, 0.5f, 0.5f);
public Sprite GgglDownsp;
public Sprite GgglUpsp;
public Transform canvas;
// Start is called before the first frame update
2024-11-14 20:14:49 +08:00
public GameObject Musk;
2024-11-07 18:03:20 +08:00
private void Awake()
{
}
void Start()
{
Ggbtn.onClick.AddListener(Display_pop_up_window);
2024-11-08 16:29:30 +08:00
//GgPanel = this.GetComponent<RectTransform>();
2024-11-07 18:03:20 +08:00
}
private void Display_pop_up_window()
{
GgPanel.DOScale(Deflate, 0.3f).SetEase(Ease.OutBack);
hdtxbg.sprite = GgglDownsp;
StartCoroutine(Magnify(GgPanel));
2024-11-14 20:14:49 +08:00
Musk.gameObject.SetActive(true);
2024-11-07 18:03:20 +08:00
List<BoxType> boxTypes = new List<BoxType>();
2024-11-07 20:27:33 +08:00
boxTypes.Add(new BoxType { Name = "", prompt = "", Type = 9,widthnum =700,WidthHeight =650 ,content = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" }) ;
2024-11-07 18:03:20 +08:00
boxTypes.Add(new BoxType { Name = "", prompt = "", Type = 11 });
GameObject gameObject = add_pop_up();
2024-11-12 21:10:56 +08:00
gameObject.transform.position = new Vector3(Screen.width/2,Screen.height/2,0);
2024-11-07 18:03:20 +08:00
gameObject.transform.SetParent(canvas);
gameObject.GetComponent<input_box_pop_up_window>().minHeight = 800;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸߶<CDB8>
2024-11-15 15:13:21 +08:00
gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>ģʽΪ<CABD><CEAA><EFBFBD><EFBFBD>
2024-11-07 18:03:20 +08:00
//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>");//<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();
2024-11-14 20:14:49 +08:00
Musk.gameObject.SetActive(false);
2024-11-07 18:03:20 +08:00
}
});
}
IEnumerator Magnify(RectTransform allpanel)
{
2024-11-08 16:29:30 +08:00
Debug.Log(<>й<EFBFBD><D0B9><EFBFBD><E6B5AF>Э<EFBFBD><D0AD>");
allpanel.DOScale(Vector3.one, 0.8f).SetEase(Ease.OutBack).OnComplete(() =>
{
hdtxbg.sprite = GgglUpsp;
});
2024-11-07 18:03:20 +08:00
yield return null;
2024-11-08 16:29:30 +08:00
2024-11-07 18:03:20 +08:00
}
// Update is called once per frame
void Update()
{
}
}