29 lines
908 B
C#
29 lines
908 B
C#
using System.Collections.Generic;
|
|
using Fusion;
|
|
using UnityEngine;
|
|
|
|
public class LobbyManager : MonoBehaviour
|
|
{
|
|
[Header("UI References")]
|
|
public Transform roomListContent; // Ô chứa danh sách phòng (nếu có)
|
|
|
|
public void DisplayRoomList(List<SessionInfo> sessionList)
|
|
{
|
|
Debug.Log($"<color=green>Lobby Update:</color> Đang tìm thấy {sessionList.Count} phòng.");
|
|
|
|
// Xóa danh sách cũ (nếu bạn làm UI)
|
|
/*
|
|
foreach (Transform child in roomListContent) {
|
|
Destroy(child.gameObject);
|
|
}
|
|
*/
|
|
|
|
// Hiển thị danh sách mới
|
|
foreach (var session in sessionList)
|
|
{
|
|
Debug.Log($"- Phòng: {session.Name} | Người chơi: {session.PlayerCount}/{session.MaxPlayers}");
|
|
// Ở đây bạn sẽ Instantiate các Button đại diện cho mỗi phòng
|
|
}
|
|
}
|
|
}
|