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

45 lines
1.0 KiB
C#
Raw Normal View History

2024-11-14 16:05:27 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class PetHomeTanChuang : MonoBehaviour
{
public GameObject PetHomePanel;
public Button PetHomeBtn;
public RectTransform PetHomeRect;
Vector3 Deflate = new Vector3(0.5f, 0.5f, 0.5f);
void Start()
{
PetHomeBtn.onClick.AddListener(Display_pop_up_window);
PetHomeRect = this.GetComponent<RectTransform>();
PetHomePanel.gameObject.SetActive(false);
}
private void Display_pop_up_window()
{
PetHomeRect.DOScale(Deflate, 0.3f).SetEase(Ease.OutBack);
StartCoroutine(Magnify(PetHomeRect));
PetHomePanel.gameObject.SetActive(true);
}
public void CloseClick()
{
PetHomePanel.gameObject.SetActive(false);
}
IEnumerator Magnify(RectTransform allpanel)
{
Debug.Log(<>й<EFBFBD><D0B9><EFBFBD><E6B5AF>Э<EFBFBD><D0AD>");
allpanel.DOScale(Vector3.one, 0.8f).SetEase(Ease.OutBack);
yield return null;
}
}