mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-29 20:52:10 +01:00
added Ready, NameChange, LobbyTitleChange
Added the function "AuthHost" (lobby.cs) )which can be used to check if the request comes from a host
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
using Mirror;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class MenuStartHost : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_InputField UsernameInput;
|
||||
public void StartHost()
|
||||
{
|
||||
Debug.Log("[MENU] Starting host...");
|
||||
NetworkManager.singleton.StartHost();
|
||||
if (UsernameInput.text != null)
|
||||
{
|
||||
Debug.Log("[MENU] Starting host...");
|
||||
GameObject.FindGameObjectWithTag("VariableSaver").GetComponent<VariableSaver>().username = UsernameInput.text;
|
||||
NetworkManager.singleton.StartHost();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user