Cute_demon_attacks/meng_yao/Assets/script/TanChuang/PhTanchuang.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 PhTanchuang : MonoBehaviour
{
2024-11-13 15:07:51 +08:00
public GameObject RankingsPanel;
public Button Rankingsbtn;
2024-11-13 11:15:09 +08:00
public Image hdtxbg;
2024-11-13 15:07:51 +08:00
public RectTransform RankingsRect;
2024-11-13 11:15:09 +08:00
Vector3 Deflate = new Vector3(0.5f, 0.5f, 0.5f);
2024-11-13 15:07:51 +08:00
public Sprite RankingsDownsp;
public Sprite RankingsUpsp;
2024-11-13 11:15:09 +08:00
public Transform canvas;
private void Awake()
{
}
void Start()
{
2024-11-13 15:07:51 +08:00
Rankingsbtn.onClick.AddListener(Display_pop_up_window);
RankingsRect = this.GetComponent<RectTransform>();
RankingsPanel.gameObject.SetActive(false);
2024-11-13 11:15:09 +08:00
}
private void Display_pop_up_window()
{
2024-11-13 15:07:51 +08:00
RankingsRect.DOScale(Deflate, 0.3f).SetEase(Ease.OutBack);
hdtxbg.sprite = RankingsDownsp;
StartCoroutine(Magnify(RankingsRect));
2024-11-13 11:15:09 +08:00
2024-11-13 15:07:51 +08:00
RankingsPanel.gameObject.SetActive(true);
2024-11-13 11:15:09 +08:00
}
public void CloseClick()
{
2024-11-13 15:07:51 +08:00
RankingsPanel.gameObject.SetActive(false);
2024-11-13 11:15:09 +08:00
}
IEnumerator Magnify(RectTransform allpanel)
{
Debug.Log(<>й<EFBFBD><D0B9><EFBFBD><E6B5AF>Э<EFBFBD><D0AD>");
allpanel.DOScale(Vector3.one, 0.8f).SetEase(Ease.OutBack).OnComplete(() =>
{
2024-11-13 15:07:51 +08:00
hdtxbg.sprite = RankingsUpsp;
2024-11-13 11:15:09 +08:00
});
yield return null;
}
}