这里的缓动变黑可以用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);
}