1.这个是几个InputField 换行
using LitJson;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class HTTPLogin : MonoBehaviour
{
public InputField[] IfArray;//外部 拖拽 赋值
private EventSystem es;
void Start()
{
// Instance = this;
es = EventSystem.current;
es.SetSelectedGameObject(IfArray[index].gameObject, new BaseEventData(es));
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Tab))
{
index++;
Debug.Log("index="+ index+ " IfArray.Length="+ IfArray.Length);
if (index >= IfArray.Length)
{
index = 0;
}
es.SetSelectedGameObject(IfArray[index].gameObject, new BaseEventData(es));
}
}
}
2.一个InputField换行,按回车自动换行