[noob] Get Textures/Materials from Project Library by script

hi,

I’ve stored materials and textures in the “Project” panel

But i don’t want to drag and drop them on scene objects with polygons, I want to apply them on a empty gameObject whose mesh has been generated by script

So i need to access the texture or the shader stored in the project panel with script, but i can’t find the method to access these objects

I had a similar issue with loading textures programatically for GUI elements. What I came up with is Resources.Load(“filename”). Don’t incude the extension. This requires you to have a Resources folder somewhere in your assets folder, and all the textures within it. I’m sure there is a better way to do it, but this is what worked for me. Have no idea about shaders, though.

thank u much… it’s ok for a small game

i found how to do it with downloaded textures too (using WWW and Texture2D classes)

and i suppose for an offline projector i can do it with c# IO package

about shader i suppose they can be created with script