先附上git地址
https://github.com/huqiang0204/huqiang.UnitySubThreadUI
public unsafe struct TextInputData
{
public Color inputColor;//输入文字的颜色
public Color tipColor;//提示文字的颜色
public Color pointColor;//光标的颜色
public Color selectColor;//区域选择时光标颜色
public Int32 inputString;//默认输入文字
public Int32 tipString;//默认提示文字
public static int Size = sizeof(TextInputData);
public static int ElementSize = Size / 4;
}
public class TextInput:EventCallBack
事件委托
public Func<TextInput, int, char, char> ValidateChar;
public Action<TextInput> OnValueChanged;
public Action<TextInput> OnSubmit;
public Action<TextInput> OnDone;
public Action<TextInput> LineChanged;
public Action<TextInput, UserAction> OnSelectChanged;
public Action<TextInput, UserAction> OnSelectEnd;
public float Percentage{get;set;}//当前输入文字的位置百分比
效果图就不上了,之前文章里面有,直接可以声明反射注册
class View
{
public TextInput input;
}