I understand you can assign a texture(s) to public vars in a script, but I will not know what textures to load (into the gui) until runtime. Is there a way to do this in C#? I have looked everywhere…
yes, put them into the resources subfolder of your project and use Instantiate( Resources.Load( … ), … )
Perfect, that worked.
FYI, if you’re dealing with JPG or PNG files you can also have them externally stored on a server, then load them on demand via the WWW class. Just thought I’d offer that as extra information for you to consider.
Also on the additional information train, you can load up textures from any data stream (like an external file for instance or a network stream) by reading the data into a byte array and using Texture2D.LoadImage: http://unity3d.com/support/documentation/ScriptReference/Texture2D.LoadImage.html . For instance I’m using this to load images stored in the resource fork of .net assemblies.