Ejemplo n.º 1
0
    void SetLose()
    {
        //Find gamemode script
        GameObject gamemode       = GameObject.Find("Gamemode");
        Gamemode   gamemodeScript = gamemode.GetComponent <Gamemode>();

        //Sets screen text
        gamemodeScript.winCondition = false;
        gamemodeScript.SetRoundEnd();

        //Find Audio script
        GameObject          audioControllerMain       = GameObject.Find("AudioControllerMain");
        AudioControllerMain audioControllerMainScript = audioControllerMain.GetComponent <AudioControllerMain>();

        //Play correct path Audio
        audioControllerMainScript.pathWrong.pitch = Random.Range(.9f, 1.1f);
        audioControllerMainScript.pathWrong.Play();
    }
Ejemplo n.º 2
0
    IEnumerator SetWin()
    {
        //Find gamemode script
        GameObject gamemode       = GameObject.Find("Gamemode");
        Gamemode   gamemodeScript = gamemode.GetComponent <Gamemode>();

        //Sets screen text
        gamemodeScript.winCondition = true;
        gamemodeScript.SetRoundEnd();

        //Find Audio script
        GameObject          audioControllerMain       = GameObject.Find("AudioControllerMain");
        AudioControllerMain audioControllerMainScript = audioControllerMain.GetComponent <AudioControllerMain>();

        //Play correct path Audio
        audioControllerMainScript.pathCorrect.pitch = Random.Range(.9f, 1.1f);
        audioControllerMainScript.pathCorrect.Play();

        yield return(new WaitForSeconds(0.1f));

        //Enemy thinks of new wrong answer
        gamemodeScript.Think();
    }