Beispiel #1
0
    public IEnumerator BeginGame()
    {
        Debug.Log(enemiesCounter);
        mazeInstance = Instantiate(mazePrefab) as Maze;
        mazeInstance.Generate();
        yield return(StartCoroutine(mazeInstance.Generate()));

        playerInstance      = Instantiate(playerPrefab) as Player;
        playerInstance.name = "PlayerTrack";
        playerInstance.SetLocation(mazeInstance.GetCell(mazeInstance.RandomCoordinates));

        sp.SpawnEnemy();
        sp.SpawnPortal();
        sp.SpawnCoin();
        while (!check)
        {
            sp.SpawnPortal();
        }
        Debug.Log(mazeInstance.roomSettings);
    }