Right, basic question. Don’t normally ask questions like this but don’t know where to start.
So i know how to make a text field that can be filled in. Simple stuff.
I am making a code entry. So someone finds a code in the level and has to input it in order to proceed.
What do i need to look into in order to check if what has been entered into the text field is correct.
Not asking anyone to do it for me, just want to know what i have to look at in the script reference. But any code to get me kicked off would be appriciated
There’s an example that shows you how to use it. Basically, all of the Unity GUI’s operate in an ‘immediate mode’ - you call the controls as a static function and immediately receive whatever input they’ve received as a return value. You should put them all in your OnGUI() function (or functions called from it). Note: OnGUI() is called more than once every frame.
Good luck!
Not sure what you're asking. If you want to know what value has been entered by the user, it's stored in stringToEdit. GUI.TextField() takes a string argument (text in) and returns a string (text out). If you use the same variable to pass value and store return, it'll basically give you real-time updates. Only problem is if you want to store that value and disallow further changes to it.
I figured this out. My problem was that you need to check if stringToEding is the value inside the update not the function itself. Was me being stupid. So it would work as follows:
Not sure what you're asking. If you want to know what value has been entered by the user, it's stored in
– rutterstringToEdit.GUI.TextField()takes a string argument (text in) and returns a string (text out). If you use the same variable to pass value and store return, it'll basically give you real-time updates. Only problem is if you want to store that value and disallow further changes to it.