Esempio n. 1
0
    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());
    }
Esempio n. 2
0
 public void StartScreenFadeOut(GazeMover gazeMover, Transform to)
 {
     StartCoroutine(FadeOut(gazeMover, to));
 }