using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using DG.Tweening; public class Donghua : MonoBehaviour { RawImage rimage; // Start is called before the first frame update void Awake() { rimage = this.GetComponent(); } // Update is called once per frame void Update() { } public void Show() { if(rimage ==null) rimage = this.GetComponent(); rimage.DOKill(); rimage.color = Color.black; rimage.DOColor(new Color(Color.black.r, Color.black.g, Color.black.b, 0),0.5f); } public void Hide() { if (rimage == null) rimage = this.GetComponent(); rimage.DOKill(); rimage.DOColor(Color.black, 0.5f).OnComplete(()=> { }).OnComplete(() => { this.transform.parent.parent.gameObject.SetActive(false); }); } }