示例#1
0
    void MoveToNextRoom()
    {
        RoomGen currentRoom = rooms[currentRoomIdx];

        if (currentRoomIdx - 1 >= 0)
        {
            rooms[currentRoomIdx - 1].spawner.ClearCurrentDrops();
        }

        CameraTracker tracker = CameraController.instance.GetCurrentCam().GetComponent <CameraTracker>();

        tracker.ChangeRooms(currentRoom.roomSize.x * currentRoom.tileSize,
                            currentRoom.roomSize.y * currentRoom.tileSize, currentRoom.transform.position);

        if (enemiesEnabled)
        {
            currentRoom.spawner.minEnemies = 1 + (int)(minMaxEnemyPercent.x * currentRoom.roomSize.x * currentRoom.roomSize.y);
            currentRoom.spawner.maxEnemies = (int)(minMaxEnemyPercent.y * currentRoom.roomSize.x * currentRoom.roomSize.y);
            currentRoom.spawner.SpawnEnemies();
        }
        if (currentRoom.prevDoor != null)
        {
            currentRoom.prevDoor.CloseDoor();
        }
        currentRoomIdx++;
    }
示例#2
0
    IEnumerator SetupCam()
    {
        //DIRTY CHECK FeelsBadMan
        if (CameraController.instance != null)
        {
            yield return(new WaitUntil(() => CameraController.instance.GetCurrentCam().gameObject.name == "BossCam"));

            CameraTracker tracker = CameraController.instance.GetCurrentCam().GetComponent <CameraTracker>();
            if (yRot == 90 || yRot == -90)
            {
                tracker.ChangeRooms(roomSize.y, roomSize.x, bossSpawnPos.position);
            }
            else
            {
                tracker.ChangeRooms(roomSize.x, roomSize.y, bossSpawnPos.position);
            }
        }
    }