void CompleteFadeIn() { if (OnFadeInComplete != null) { OnFadeInComplete.Invoke(); } if (mode == FadeMode.PingPong) { FadeOut(); } else { mode = FadeMode.None; currentState = FadeMode.None; } }
IEnumerator FadeIn() { float t = 0f; canvas.blocksRaycasts = true; while (t < fadeDuration) { canvas.alpha = t / fadeDuration; //previewImage.canvasRenderer.SetColor(col); t += Time.deltaTime; yield return(null); } canvas.alpha = 1f; canvas.interactable = true; OnFadeInComplete?.Invoke(); }