Files
BH3/Assets/Scripts/Assembly-CSharp/MoleMole/InputFieldHelper.cs
2025-08-13 09:26:42 +08:00

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;
}
}
}
}