// Use this for initialization
    void Start()
    {
        GameObject lobbyCanvasObject = MainCanvasManager.Instance.LobbyCanvas.gameObject;

        if (lobbyCanvasObject == null)
        {
            return;
        }

        LobbyCanvas lobbyCanvas = lobbyCanvasObject.GetComponent <LobbyCanvas>();

        Button button = GetComponent <Button>();

        button.onClick.AddListener(() => lobbyCanvas.OnJoinRoom(RoomNameText.text));
    }