Hello,
I wonder how can I load a texture (image) in script. Do I just put - Texture.name; - of the texture and it will find it in the asset?
Thanks for help
Hello,
I wonder how can I load a texture (image) in script. Do I just put - Texture.name; - of the texture and it will find it in the asset?
Thanks for help
Once you put this code in, the inspector will let you drag a texture into an open Texture2D slot. put the new texture in that spot and run your code.
var newTexture = Texture;
function Start()
{
this.renderer.material.mainTexture = newTexture;
}