using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using DG.Tweening; using System; namespace Level2 { public class InfoPanel : Level1.InfoPanel { public Text yishiText; public Text huxiText; public Image yishiImg; public Image huxiImg; protected override void Awake() { type = UIType.Info; base.Awake(); } public void ChangeYishi() { yishiText.text = "无"; yishiImg.gameObject.SetActive(true); yishiImg.DOColor(new Color(0, 1, 0, 1), 1); StartCoroutine(Wait(() => { yishiImg.DOColor(new Color(0, 0, 0, 1), 2); }, 1f)); StartCoroutine(Wait(() => { yishiImg.DOColor(new Color(0, 1, 0, 1), 2); }, 2f)); StartCoroutine(Wait(() => { yishiImg.gameObject.SetActive(false); }, 3f)); } public void ChangeHuxi() { huxiText.text = "无"; huxiImg.gameObject.SetActive(true); huxiImg.DOColor(new Color(0, 1, 0, 1), 1); StartCoroutine(Wait(() => { huxiImg.DOColor(new Color(0, 0, 0, 1), 2); }, 1f)); StartCoroutine(Wait(() => { huxiImg.DOColor(new Color(0, 1, 0, 1), 2); }, 2f)); StartCoroutine(Wait(() => { huxiImg.gameObject.SetActive(false); }, 3f)); } IEnumerator Wait(Action action,float t) { yield return new WaitForSeconds(t); action(); } } }