mergemilitary/Assets/MMOModule/Scripts/MMOUIs/MMOGuide/MMOGuideInput.cs

42 lines
938 B
C#
Raw Normal View History

2022-07-04 11:17:39 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace MMO
{
public class MMOGuideInput : MMOGuideStep
{
2022-09-09 14:35:49 +00:00
public string InputStr => mInputStr;
2022-07-04 11:17:39 +00:00
[SerializeField] InputField mIptUsername;
2022-09-09 14:35:49 +00:00
private string mInputStr;
2022-07-04 11:17:39 +00:00
private void Awake()
{
mIptUsername.onEndEdit.AddListener(OnInputEnd);
}
private void OnEnable()
{
mIptUsername.gameObject.SetActive(true);
}
private void OnInputEnd(string pStr)
{
2022-09-09 14:35:49 +00:00
mInputStr = mIptUsername.text.Replace(" ", "");
if (string.IsNullOrEmpty(mInputStr))
{
MMOModule.Instance.ShowTip("Username can't be empty!");
return;
}
2022-07-04 11:17:39 +00:00
if (!string.IsNullOrEmpty(pStr))
{
DelExcute?.Invoke();
}
}
}
}