You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
964 B

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<Image>().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();
}
}
}