_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Scene_main/main_BaseShowPanel.cs

32 lines
892 B
C#
Raw Normal View History

2024-11-27 11:25:42 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
public class main_BaseShowPanel : MonoBehaviour
2024-11-27 11:49:57 +08:00
{
2024-11-27 11:25:42 +08:00
[Header("<22><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>panel<65><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>")]
public GameObject _panel;
public void showPanel(GameObject panel)
{
if (panel == null)
{
Debug.LogError("panel==null");
return;
}
panel.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
2024-11-27 16:14:34 +08:00
panel.transform.DOScale(1f, 0.5f);
2024-11-27 11:25:42 +08:00
}
2024-11-28 05:52:04 +08:00
public void addEventPopUp(string Details, float time = 5f)//<2F><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD>
{
GameObject prefab = Resources.Load<GameObject>("base/EventPopUp");
prefab.GetComponent<EventPopUp>().time = time;
Canvas canvas = GetComponentInParent<Canvas>();
prefab.GetComponent<EventPopUp>().text = Details;
Instantiate(prefab, canvas.transform);
}
2024-11-27 11:25:42 +08:00
}