Пример #1
0
    // Function that's called to spawn hallways and talks with the LevelGeneration script to continue to the next room generation.
    public void CurrentHallway()
    {
        //rand = 0;
        if (AvailableHallways.Count > 0)
        {
            SpawnHallway(AvailableHallways[0], rand, false);
        }

        if (stats.RoomList.Count >= 1 && AvailableHallways.Count == 0)
        {
            //Debug.Log("SPAWNING NEXT ROOM");
            stats.RoomList.RemoveAt(0);
            stats.Direction.RemoveAt(0);
            if (stats.RoomList.Count == 0)
            {
                Debug.Log("SPAWNLIST COUNT: " + stats.RoomList.Count);
                Debug.Log("Finished Generating Dungeon.");
                stats.ClearRooms();
            }
            stats.Generate();
        }
    }