Example #1
0
 public void OnChangeRoom(RoomTemplate template)
 {
     if (currentRoom.gameObject.transform.GetSiblingIndex() != template.gameObject.transform.GetSiblingIndex())
     {
         currentRoom.DeactivateRoom();
         currentRoom = template;
         currentRoom.ActivateRoom();
     }
 }
Example #2
0
    private void CreateRooms()
    {
        roomList = new List <RoomTemplate>();
        RoomTemplate roomPrefab = GetRoomTemplate(RoomsTypes.C).GetComponent <RoomTemplate>();
        RoomTemplate room       = Instantiate(roomPrefab, transform.position, roomPrefab.transform.rotation, roomsContainer);

        startRoom   = room;
        currentRoom = startRoom;
        currentRoom.ActivateRoom();
        AddRoom(room);
    }