You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
847 B
C#
35 lines
847 B
C#
using System;
|
|
using TMPro;
|
|
using Unity.BossRoom.UnityServices.Lobbies;
|
|
using UnityEngine;
|
|
using VContainer;
|
|
|
|
namespace Unity.BossRoom.Gameplay.UI
|
|
{
|
|
/// <summary>
|
|
/// An individual Lobby UI in the list of available lobbies
|
|
/// </summary>
|
|
public class LobbyListItemUI : MonoBehaviour
|
|
{
|
|
[SerializeField] TextMeshProUGUI m_lobbyNameText;
|
|
[SerializeField] TextMeshProUGUI m_lobbyCountText;
|
|
|
|
[Inject] LobbyUIMediator m_LobbyUIMediator;
|
|
|
|
LocalLobby m_Data;
|
|
|
|
|
|
public void SetData(LocalLobby data)
|
|
{
|
|
m_Data = data;
|
|
m_lobbyNameText.SetText(data.LobbyName);
|
|
m_lobbyCountText.SetText($"{data.PlayerCount}/{data.MaxPlayerCount}");
|
|
}
|
|
|
|
public void OnClick()
|
|
{
|
|
m_LobbyUIMediator.JoinLobbyRequest(m_Data);
|
|
}
|
|
}
|
|
}
|