To Mods: – I had to create two topics on this because the first one wasn’t going live. Sorry about that.
Hi, I need to convert a string to a sprite.
I tried making an array of 99 sprites, but it causes the scene load time to be slow (this scene is loaded often)
I decided to instead, have an array of 99 strings, pull a string from the array and convert it to sprite… But can’t seem to find anywhere how to do this:
Pseudocode:
String imagename = “Thetestimage”;
…
gameObject.Sprite = imagename;
instead of (which is the way I think most people will suggest doing this)
public Sprite spritename ;
…
gameObject.Sprite = spritename;
Thanks for you time.