Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: will_brett on December 29, 2014, 06:33:44 PM
-
Hey all,
Im creating a scriptable object to manage a load of GUI shop items. The data in the scriptable object then modifies a template item.
My question is how do I define a sprite in a scriptable object? Would I do it as a string to the path of the sprite in the atlas and if so how?
Thanks
Will
-
I am not quite clear on what you're asking. Are you asking how to assign a sprite? If so that's just sprite.spriteName = "Your Sprite". Or are you asking how to add a sprite to the atlas at run time? If so, that's not possible. Or are you asking how to add a new sprite to the scene? If so, NGUITools.AddWidget<UISprite>(parentObject).
-
Sprite.name = "yoursprite" should do the trick thanks