using UnityEngine.UI;
GameObject go = GameObject.Find(
"inputFieldName"
);
go.GetComponent<InputField>().text = hitInfo.transform.parent.GetComponent<TextMesh>().text;
获取文本
GameObject go = GameObject.Find(
"inputFieldName"
)
go.GetComponent<Text>().text