public void SetName() { Text[] textArray = inputField.GetComponentsInChildren <Text>(); foreach (Text t in textArray) { if (t.gameObject.name == "Text_UserName") { vars.SetPlayerName(t.text); } } Debug.Log(vars.GetPlayerName()); // Activate Button }
public void SetName() { string n = playerName_Text.text; var.SetPlayerName(n); }