Esempio n. 1
0
    void InstantiateRoom()//Instancia uma sala aleatoria e remove ela da lista
    {
        onNewRoom?.Invoke();

        if (roomsPassed < 10)//salas faceis
        {
            int random = UnityEngine.Random.Range(0, easyRooms.Count);
            currentRoom = Instantiate(easyRooms[random], spawnRoomPoint.position, Quaternion.identity);
            easyRooms.Remove(easyRooms[random]);
        }
        else if (roomsPassed >= 10 && roomsPassed < 20)//salas medias
        {
            int random = UnityEngine.Random.Range(0, mediumRooms.Count);
            currentRoom = Instantiate(mediumRooms[random], spawnRoomPoint.position, Quaternion.identity);
            mediumRooms.Remove(mediumRooms[random]);
        }
        else if (roomsPassed >= 20 && roomsPassed <= 30)//salas dificeis
        {
            if (hardRooms.Count > 0)
            {
                int random = UnityEngine.Random.Range(0, hardRooms.Count);
                currentRoom = Instantiate(hardRooms[random], spawnRoomPoint.position, Quaternion.identity);
                hardRooms.Remove(hardRooms[random]);
            }
            else
            {
                HelpfulFunctions.LoadScene("MenuInicial");
            }
        }

        roomsPassed++;
        navMesh.BuildNavMesh();
    }
Esempio n. 2
0
    IEnumerator LoadScene(string cena)
    {
        AM.SetTrigger("Ficar grande");
        yield return(new WaitForSeconds(1.5f));

        HelpfulFunctions.LoadScene(cena);
    }
Esempio n. 3
0
    IEnumerator LoadScene(string sceneName)
    {
        AM.SetTrigger("Ficar grande");
        yield return(new WaitForSeconds(1.5f));

        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStatus>().Save();
        HelpfulFunctions.LoadScene(sceneName);
    }