Author Topic: Assigning graphs through code  (Read 1711 times)

Hey,

I have been trying to set up a simple drop box in unity that selects between different graphs in my .sbsar to assign to an object, but unfortunately I don't know how to get unity to find them. If I try to find them via the identifier name in a Resources folder it will not find the material. If I try to find them via the substance it only finds the first graph available and I am unsure of how to find the others.

My code is something like this:

Material MyMat = Resources.Load("MySbsar", typeof(Material)) as Material;
   gameObject.renderer.material = MyMat;

Thanks,
Chris