Control UI Input Field entirely with code?
I have a canvas UI Input Field object in my game, and I want to prevent the user from entering it, and exiting it, and control that completely with code.
There is a variable named "Interactable" in the Input Field script, which prevent you from interacting with it, but I still don't know how to do it with code.
I found this, but I don't know how to use it, or if it's the right thing to use.
http://docs.unity3d.com/460/Documentation/ScriptReference/UI.Selectable.DoStateTransition.html
Thanks.
Answer by flashframe · Jan 30, 2016 at 03:26 AM
To activate the input field programmatically you can use:
inputField.ActivateInputField();
inputField.Select();
Your answer
Follow this Question
Related Questions
Detecting if is currently entering text on any component. 0 Answers
Use InputField to be a search bar with a ScrollRect 0 Answers
Display PlayerPref in InputField 1 Answer
Block Input.GetMouseButtonDown() when clicking on UI element 2 Answers
How do I let users change the background color of a selected word in an input field? 0 Answers