using UnityEngine; using UnityEngine.UI; using TMPro; /// /// Attach to any manager GO in join lobby.unity. /// Converts the "code" button GO into a working TMP_InputField at runtime /// and wires the join button to call GameManager.JoinLobbyButton(). /// public class JoinLobbyUI : MonoBehaviour { private TMP_InputField _codeInput; private TMP_Text _errorText; void Start() { // ── Build proper code input from the "code" Button GO ───────────────── var codeGO = GameObject.Find("code"); if (codeGO != null) { var rt = codeGO.GetComponent(); if (rt != null) { // Remove Button — it swallows click events before input field can act var btn = codeGO.GetComponent