Hi, I have sort of shop where I dynamically add items.
I have template NGUI prefab, where I insert string for name, level etc.
I also have sort of database of objects that should appear on shop. This is array of struct class and you just fill out it's child variables, and this data gets copied into NGUI shop template.
now this template also has icon field, icon is ngui sprite. So basically what I want to do is, to be able to set icon image in database, then insert this icon image into shop template. So when shop items are dynamically generated, each item has appropriate icon, name text, descr etc.
Now because ngui sprite has two field, Atlass and Sprite in Atlass, Like this
I have two problems here
1) I'm not sure how to add those Atlas/Sprite fields to my database(adding atlas/sprite as public variables in another class), so I can assign correct icon there
2) I'm not sure how to pass this variable into actual ngui sprite and thus change its icon image.
To sum up, I want to have array of blueprints, based on which I fill out data in template and thus build shop items at runtime.
And the problem I have is assigning icon variable in blueprint, and setting this variable in template.
as an alternative, I have done this with NGUI unity2D sprite, because here it's simple. sprite is just 1 variable, and you can pass it to another object easily, but this generates extra draw calls and I would rather use nguis own sprite.
Thanks and I hope I made some sense.