TouhouLS/Assets/RealCode/Menu/ButtonS/ButtonJoinLobby.cs

28 lines
662 B
C#
Raw Normal View History

2020-08-22 05:29:00 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class ButtonJoinLobby : ButtonOnClick {
public TMP_InputField joinField;
public override void OnClick() {
if (GameTransition.Instance.state == GameState.Multiplayer){
GameTransition.Instance.state = GameState.ConnectionInProgress;
2020-08-22 05:41:26 +00:00
LobbySetup.Instance.Setup();
2020-08-22 05:29:00 +00:00
var roomCode = joinField.text;
Debug.LogFormat("Joining room '{0}'", roomCode);
if (NetworkManager.net.OpJoinRoomWithProperties(roomCode)) {
Debug.Log("Room joined");
} else {
Debug.Log("Couldn't join room");
}
}
}
}