almost 6 years ago
Currently I am using this code:
InputAmount = System.Int32.Parse(GameObject.FindGameObjectsWithTag("Amount").GetComponent().text);
Declare with float but how can I get a decimal number from the text field? Because I am doing a calculator with it.
about 5 years ago
InputAmount = System.Single.Parse(GameObject.FindGameObjectsWithTag("Amount").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.
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.
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Terms of Service
| © copyright 2021 FindNerd.com. All rights reserved.
Sign up using