Auto Assigning a Texture Via Script

Is there a way to assign a texture from the project to a Texture variable? Something like assigning objects using their tags.

Read this post about finding assets not yet loaded: [Finding assets from script - Questions & Answers - Unity Discussions][1]
[1]: Finding assets from script - Questions & Answers - Unity Discussions

You can dynamically change the texture variable using:

`var TextureVariable : Texture2D;

// (assign in here the texture asset to TextureVariable)

renderer.material.mainTexture = TextureVariable;`