init
This commit is contained in:
28
Assets/Mirror/Examples/Chat/Scripts/LoginUI.cs
Normal file
28
Assets/Mirror/Examples/Chat/Scripts/LoginUI.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Mirror.Examples.Chat
|
||||
{
|
||||
public class LoginUI : MonoBehaviour
|
||||
{
|
||||
[Header("UI Elements")]
|
||||
[SerializeField] internal InputField usernameInput;
|
||||
[SerializeField] internal Button hostButton;
|
||||
[SerializeField] internal Button clientButton;
|
||||
[SerializeField] internal Text errorText;
|
||||
|
||||
public static LoginUI instance;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
|
||||
// Called by UI element UsernameInput.OnValueChanged
|
||||
public void ToggleButtons(string username)
|
||||
{
|
||||
hostButton.interactable = !string.IsNullOrWhiteSpace(username);
|
||||
clientButton.interactable = !string.IsNullOrWhiteSpace(username);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user