I have a rather vague question. I’m sure that if I knew the proper terms I’d be able to search and resolve this on my own. But I can’t, so I’m here.
I would like to have one generic UI panel that displayed the contents of image and text components that are attached to trigger game objects, ones that when clicked on open the UI panel.
The game I’m working on is an educational type game, so when a player clicks on a certain object I would like a UI panel to appear giving information, basically an info box.
Honestly, I have no idea how to search for this solution so any information is appreciated.
Thanks for the link, that’s a really great video. There’s a lot of useful little bits in there.
Unfortunately, that’s not really what I was trying to describe. My issue is that I have, say, 100 triggers in a scene. Each trigger corresponds to a UI page that displays information, an image and a brief description of the image.
How I have it now is there are 100 UI panels (they simply get turned on and off when the corresponding trigger is activated. It works but it’s rather cumbersome as I have two folders: one for triggers in the game; and one in the UI Canvas. I need to make sure that each are sync’d.
What I imagine is having one single UI panel that functions as a template and is fed, in real time, the contents from the triggers as they are activated. So the panel would display the info form a text box and image component that is a part of the trigger game object. I’d actually like to get from referencing a database, but baby steps.
But thanks for you response, that video will help with other elements a lot.
Nathan
Out of curiosity, is this your code or is there a link to more information about this? I’m not a strong programmer but if I have examples or materials to work with I can piece my way together. This is exactly what I was hoping to get to eventually, but if I can actually do it now I might as well put my energy into it now.
That is extremely generous of you and would be amazing if it’s not too much work. I should be able to put the pieces together if you just give me the general idea of how to go about this.
For example, one thing that still completely escapes me is to have the content displayed in the generic UI panel.
Let me know if I can help at all or return the favour somehow.
Thank you so much for doing this. Yes, I still have a need for it. I won’t get a chance to tackle this until later in the week, but i’ll let you know how it all goes.
Just a little bump for this thread. This is an awesome example for those unfamiliar with incorporating XML databases into their unity projects. The tutorial is very straightforward and easy to follow and provides you with a very easy to understand foundation for further modification.