mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-12 22:44:35 +01:00
22 lines
396 B
C#
22 lines
396 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace MoleMole
|
|
{
|
|
public class InputFieldHelper : MonoBehaviour
|
|
{
|
|
public int mCharacterlimit;
|
|
|
|
public void OnEndEdit(InputField vInput)
|
|
{
|
|
if (mCharacterlimit > 0)
|
|
{
|
|
string text = vInput.text.Trim();
|
|
int length = Mathf.Min(mCharacterlimit, text.Length);
|
|
text = text.Substring(0, length);
|
|
vInput.text = text;
|
|
}
|
|
}
|
|
}
|
|
}
|