Ejemplo n.º 1
0
    IEnumerator AcionarPorta()
    {
        fade.FadeIn();
        yield return(new WaitWhile(() => fade.fume.color.a < 0.9f));

        _PlayerScript.gameObject.SetActive(false);
        switch (escuro)
        {
        case true:
            _PlayerScript.ChangeMaterial(luz2D);
            break;

        case false:
            _PlayerScript.ChangeMaterial(padrao2D);
            break;
        }
        _PlayerScript.transform.position = destino.position;
        yield return(new WaitForSeconds(0.3f));

        _PlayerScript.gameObject.SetActive(true);
        fade.FadeOut();
    }