using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening; //显示动画 public class main_BaseShowPanel : MonoBehaviour { [Header("父类自动的panel,按需要给")] 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); panel.transform.DOScale(1f, 0.5f); } public void addEventPopUp(string Details, float time = 5f)//添加弹窗 { GameObject prefab = Resources.Load("base/EventPopUp"); prefab.GetComponent().time = time; Canvas canvas = GetComponentInParent(); prefab.GetComponent().text = Details; Instantiate(prefab, canvas.transform); } }