Exemplo n.º 1
0
    IEnumerator NextSlide()
    {
        vueltas++;
        settings.GetNextDisciplina();
        maskerTitle.text = settings.GetDisciplina().name;

        if (!started)
        {
            maskerTitle.text = "PROYECTATE...";
            Logo.SetActive(true);
            Scene.SetActive(false);
            anim.Play("SlidesMaskerOff");
            yield return(new WaitForSeconds(4));

            maskerTitle.text = settings.GetDisciplina().name;
            anim.Play("SlidesMaskerOn");
            yield return(new WaitForSeconds(2));

            Logo.SetActive(false);
            Scene.SetActive(true);
        }
        else if (vueltas == 3)
        {
            vueltas          = 0;
            maskerTitle.text = "PROYECTATE...";
            anim.Play("SlidesMaskerOn");
            yield return(new WaitForSeconds(2));

            Logo.SetActive(true);
            Scene.SetActive(false);
            anim.Play("SlidesMaskerOff");
            yield return(new WaitForSeconds(4));

            maskerTitle.text = settings.GetDisciplina().name;
            anim.Play("SlidesMaskerOn");
            yield return(new WaitForSeconds(2));

            Logo.SetActive(false);
            Scene.SetActive(true);
        }
        else
        {
            anim.Play("SlidesMaskerOn");
            yield return(new WaitForSeconds(2));
        }

        foreach (Lisiados lisiado in lisiados)
        {
            lisiado.SetOn();
        }

        if (allCharacter != null)
        {
            foreach (CharacterManager cm in allCharacter)
            {
                cm.gameObject.SetActive(true);
            }
            allCharacter.Clear();
        }

        aula.LoadSprite();

        foreach (Transform tr in namesContainer.GetComponent <Transform>())
        {
            Destroy(tr.gameObject);
        }

        foreach (GameObject container in CharactersContainer)
        {
            container.SetActive(false);
        }

        containerId = Random.Range(0, CharactersContainer.Length);
        CharactersContainer[containerId].SetActive(true);



        titleLabel.text = settings.GetDisciplina().name;
        AddPlayers();

        yield return(new WaitForSeconds(1.5f));

        anim.Play("SlidesMaskerOff");

        started = true;

        yield return(new WaitForSeconds(4));

        Resources.UnloadUnusedAssets();
        StartCoroutine("NextSlide");
    }