Пример #1
0
    public void RegisterRoom(RG_Room room)
    {
        room.transform.position = new Vector3(
            currentLoadRoomData.X * room.width,
            currentLoadRoomData.Y * room.height
            );

        room.X                = currentLoadRoomData.X;
        room.Y                = currentLoadRoomData.Y;
        room.name             = currentLoadRoomData.Name + "_" + room.X + ", " + room.Y;
        room.transform.parent = transform;

        // Finished loading
        isLoadingRoom = false;

        // If theres no room assigned to the camera, assign the one thats registering
        if (loadedRooms.Count == 0)
        {
            RG_CameraController.instance.currentRoom = room;
        }

        // Add it to the list
        loadedRooms.Add(room);
    }
Пример #2
0
 public void OnPlayerEnterRoom(RG_Room room)
 {
     // We set so that the current room asigned to the camera changes
     RG_CameraController.instance.currentRoom = room;
     currentRoom = room;
 }