52 lines
1018 B
C#
52 lines
1018 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using GCGame;
|
|
using System;
|
|
using UnityEngine.Events;
|
|
|
|
public class UIInputField : UIBase
|
|
{
|
|
public InputField _InputField;
|
|
|
|
public string text
|
|
{
|
|
get
|
|
{
|
|
return _InputField.text;
|
|
}
|
|
set
|
|
{
|
|
_InputField.text = value;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class InputEditEnd : UnityEvent
|
|
{
|
|
public InputEditEnd() { }
|
|
}
|
|
|
|
public InputEditEnd _InputEditEnd;
|
|
|
|
private int _TextLength;
|
|
|
|
public void InitField(int maxLength)
|
|
{
|
|
_TextLength = maxLength;
|
|
_InputField.characterLimit = _TextLength;
|
|
_InputField.text = "";
|
|
}
|
|
|
|
public void OnInputText()
|
|
{
|
|
//if (_InputField.text.Length > _TextLength)
|
|
//{
|
|
// _InputField.text = _InputField.text.Substring(0, _TextLength);
|
|
//}
|
|
|
|
_InputField.text = Utils.StrFilter_Chat(_InputField.text);
|
|
_InputEditEnd.Invoke();
|
|
}
|
|
}
|