using System.Collections; using System.Collections.Generic; using UnityEngine; using XWFramework.UI; using UnityEngine.UI; using DG.Tweening; using System; namespace Level1 { public class MaskPanel : UIPanel { public Text content; protected override void Awake() { base.Awake(); type = UIType.Mask; } protected override void Init() { content.gameObject.SetActive(true); //canvasGroup.alpha = 0; } public void ChangeText(string text) { content.text = text; } public void OpenMask(float t) { GetComponent().DOColor(new Color(0, 0, 0, 1), 1); StartCoroutine(Wait(1, () => { gameObject.SetActive(false); })); } IEnumerator Wait(float t, Action action) { yield return new WaitForSeconds(t); action(); } } }