private IEnumerator FadeOut(GazeMover gazeMover, Transform newPosition) { float elapsedTime = 0.0f; Color color = fadeColor; isFading = true; while (elapsedTime < fadeTime) { yield return(fadeInstruction); elapsedTime += Time.deltaTime; color.a = Mathf.Clamp01(elapsedTime / fadeTime); fadeMaterial.color = color; } fadeMaterial.color = Color.black; gazeMover.MoveTo(newPosition); isFading = false; StartCoroutine(FadeIn()); }
public void StartScreenFadeOut(GazeMover gazeMover, Transform to) { StartCoroutine(FadeOut(gazeMover, to)); }