Unity高薪就业班-1v1服务 就业无忧 扫二维码继续学习 二维码时效为半小时

(9评价)
价格: 15800.00元

这里的缓动变黑可以用DOTWeen的  DOTween.To

private CanvasGroup fadeCanvaseGroup;
private bool isFade; 

private void Start() 
{ 
  fadeCanvaseGroup = FindObjectOfType();
  Fade(1); 
} 
private void Fade(float alpha) 
{
  isFade = true; DOTween.To(() => fadeCanvaseGroup.alpha, a => fadeCanvaseGroup.alpha = a, alpha, 10);
}

 

[展开全文]
皆是浮生若梦 · 2023-02-24 · 0

定时销毁可以不用协程

Destroy(gameObject, timer);

timer就是时间

放在Start即可

[展开全文]
皆是浮生若梦 · 2023-02-24 · 1