脚本挂在输入框的父物体上即可 [code]csharpcode: using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI; public class CutInput : MonoBehaviour {
private EventSystem system;
//输入框集合
private InputField[] inputArray;
// Use this for initialization
void Start () {
system = EventSystem.current;
inputArray = this.GetComponentsInChildren<InputField>();
}
int index = 0;
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Tab))
{
if (index>=inputArray.Length)
index = 0; system.SetSelectedGameObject(inputArray[index].gameObject,new BaseEventData(system));
index++;
}
}
}