32 lines
892 B
C#
32 lines
892 B
C#
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<GameObject>("base/EventPopUp");
|
||
prefab.GetComponent<EventPopUp>().time = time;
|
||
Canvas canvas = GetComponentInParent<Canvas>();
|
||
prefab.GetComponent<EventPopUp>().text = Details;
|
||
Instantiate(prefab, canvas.transform);
|
||
}
|
||
}
|