Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating navigation between Unity3D instantiated UI elements

So in Unity3D I have a script that reads a JSON delivered by a database and converts every field into an UnityEngine.UI InputField so the user can edit the entry. The code literally instantiates an InputField prefab.

The problem is there is no navigation between them, if I just press TAB or any arrow key the focus won't change, and that is not only very user-unfriendly but also annoying.

So my question here is if there is a way by code to change the navigation in the moment I instantiate them, or if should I just go straight making myself a script for that.

Thanks in advance!

like image 301
cortvi Avatar asked Mar 18 '26 16:03

cortvi


1 Answers

Sure, you can set those programmatically

http://docs.unity3d.com/ScriptReference/UI.Navigation.html

enter image description here

Suggest you first just set up some buttons in the Editor, and experiment with it in the editor. THen, get in to doing it in code.

It's the most powerful / unknown feature in Unity!

like image 161
Fattie Avatar answered Mar 20 '26 13:03

Fattie