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

62 lines
1.3 KiB
C#
Raw Normal View History

2024-11-13 11:15:09 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class First_Charge : MonoBehaviour
{
public GameObject First_ChargePanel;
public Button First_Chargebtn;
public Image hdtxbg;
public RectTransform First_ChargeRect;
Vector3 Deflate = new Vector3(0.5f, 0.5f, 0.5f);
public Sprite First_ChargeDownsp;
public Sprite First_ChargeUpsp;
public Transform canvas;
private void Awake()
{
}
void Start()
{
First_Chargebtn.onClick.AddListener(Display_pop_up_window);
First_ChargeRect = this.GetComponent<RectTransform>();
First_ChargePanel.gameObject.SetActive(false);
}
private void Display_pop_up_window()
{
First_ChargeRect.DOScale(Deflate, 0.3f).SetEase(Ease.OutBack);
hdtxbg.sprite = First_ChargeDownsp;
StartCoroutine(Magnify(First_ChargeRect));
First_ChargePanel.gameObject.SetActive(true);
}
public void CloseClick()
{
First_ChargePanel.gameObject.SetActive(false);
}
IEnumerator Magnify(RectTransform allpanel)
{
Debug.Log(<>й<EFBFBD><D0B9><EFBFBD><E6B5AF>Э<EFBFBD><D0AD>");
allpanel.DOScale(Vector3.one, 0.8f).SetEase(Ease.OutBack).OnComplete(() =>
{
hdtxbg.sprite = First_ChargeUpsp;
});
yield return null;
}
}