All we know that we can edit string value of the Text with this code:
public Text text1;
//code
text1.text = "blablabla";
also we can get value from it;)
Okay, thats awesome, but what about InputField? Lets see
As in Text we also can edit this string value:
public InputField inputField1;
//code
inputField1.text = "blablabla";
of course, we can get value from it;) really???![]()
Stop man, what you talking about?
As you know, InputField have few childrens in hierarchy - âPlaceholderâ & âTextâ
Text has string value of inputted text in InputField, logically, we can use it!
But thete`s something wrong. I can get value of this Text:
public Text textInsideInputField; //text from InputField
public Text text2; //simple text
//code
text2.text = textInsideInputField.text;
Yeah! Success!
But what about we want change this Text component directly :
public Text textInsideInputField; //text from InputField
public Text text2; //simple text
//code
textInsideInputField.text = text2.text;
It havent any error message, but value doesnt change.
I came to the conclusion that when try to access to the Text object in InputField its read only. (its strange)
This is a bug, or it should be?![]()