-
How can I get a decimal number in text field?
about 9 years ago
-
about 8 years ago
InputAmount = System.Single.Parse(GameObject.FindGameObjectsWithTag("Amount")[0].GetComponent().text);
Note that the FindGameObjectsWithTag method is expensive and if you are calling this more than once, you should cache the GameObject at start up and use it.
-
-
about 9 years ago
Hello,
First Get a sub string from the text field string(from decimal to end of the string). Then parse it in any datatype you want.
Thanks
-
2 Answer(s)