You can do it by first getting reference to the gameObject somehow then getting the InputField
component from it and taking the component's text
variable:
GameObject inputFieldGo = GameObject.Find("PathToTheGameObject");
InputField inputFieldCo = inputFieldGo.GetComponent<InputField>();
Debug.Log(inputFieldCo.text);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…