how to retrieve material from project window to script

Hello all !

Probably a stoopid question, but i browsed
many online resources/forums/tutos, and
didn’t find any clue about how to retrieve
in a script, a material already build in project
window, and apply it on a game object renderer.

Could anyone help please by showing me the
two JS lines that allow to do this ?

thanks a lot !

there are various ways to do that, you can load a material from the resource folder at runtime and assign it to a gameobject’s renderer.
have a look in the documentation and look for resources.load and the renderer.

thanks for answer.

What i want to do is not about any resources folder, or
any file at all.
inside unity3D editor’s project window, i got some
thingies ( shaders, scripts, materials, textures, etc… ).
eg: i have a material in a folder. this material is called “steel_material”.

what i want is a way to do the folowing:

var the_material: Material;
the_material = BrowseThingsInProjectWindowAndFindTheMaterial(“steel_material”);

Is there a way to do this please ?

thanks a lot for your answers…