I have an OBJ file which is my 3D model I upload at runtime. Now, I want to attach a Texture as soon as it is loaded up. So, I thought that calling
gObj.AddComponent(Material) would be helpful but apparently I can't do it as Material doesn't derive from Component. So, I decided to create a separate script, and call
and modify the Start() function in a way to load the texture and attach it.. but I can't find the way to load a texture from a file.
Any help or simple example?