using UnityEngine; using UnityEngine.UIElements; using System.Collections.Generic; using System.Threading.Tasks; using Fusion; using System.Linq; namespace Hallucinate.UI { public class LobbyController : BaseUIController { private VisualTreeAsset _roomItemTemplate; private PlayerDataManager _playerDataManager; private VisualElement _joinContainer, _createContainer, _loungeContainer, _passOverlay; private TextField _roomIDInput, _roomNameInput, _roomPassInput; private Toggle _passToggle; private Label _createErrorLabel; private Button _confirmCreateBtn; private ScrollView _roomList; private TextField _joinPassInput; private Label _joinPassError; private SessionInfo _selectedSession; private Label _loungeRoomName; private Button _readyBtn, _startBtn; private Label _hostNameLabel, _hostStatusLabel; private VisualElement _hostChatBox; private Label _hostChatMessage; private Label _guestNameLabel, _guestStatusLabel; private VisualElement _guestChatBox; private Label _guestChatMessage; private TextField _chatInput; private VisualElement _hostAvatar, _guestAvatar; private VisualElement _transferHostOverlay; private Button _confirmTransferBtn, _closeTransferBtn; private PlayerRef _pendingTransferPlayer; private bool _isBusy = false; public override void Initialize(VisualElement uxmlRoot, UIManager manager) { base.Initialize(uxmlRoot, manager); _joinContainer = root.Q("JoinContainer"); _createContainer = root.Q("CreateContainer"); _loungeContainer = root.Q("LoungeContainer"); _passOverlay = root.Q("PasswordOverlay"); _roomIDInput = root.Q("RoomIDInput"); _roomNameInput = root.Q("RoomNameInput"); _roomPassInput = root.Q("RoomPassInput"); _passToggle = root.Q("PassToggle"); _createErrorLabel = root.Q