Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
557 B
7
Indexable
Never
using Unity.Netcode;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class TestingLobbyUI : MonoBehaviour
{
	[SerializeField] private Button hostBtn;
	[SerializeField] private Button joinBtn;

	private void Awake()
	{

		hostBtn.onClick.AddListener(() =>
		{
			NetworkManager.Singleton.StartHost();
			NetworkManager.Singleton.SceneManager.LoadScene("CharacterSelect", LoadSceneMode.Single);
		});
		joinBtn.onClick.AddListener(() =>
		{
			NetworkManager.Singleton.StartClient();
		});
	}

}