Hi everyone
I wd like in a c# file (*.cs) change material for a MeshInSpace
My folder for Materials is (Assets/Materials)
private Component_Material LoadMaterial(string nom, Component_Scene gh)
{
Component_Material matiere;
string fileName = "Materials\\" + nom + ".material";
if (VirtualFile.Exists(fileName))
{
matiere = (Component_Material)ResourceManager.LoadSeparateInstance<Component_Material>
(fileName, false,true);
gh.AddComponent(matiere);
}
matiere = (Component_Material)ResourceManager.LoadSeparateInstance<Component_Material>
(fileName, false,true);
return matiere;
}
x est un Component_MeshInSpace
Scene est un Component_Scene
x.ReplaceMaterial = (Component_Material) LoadMaterial(Comn.ToString(), Scene);
Why material loaded is the default material?
Thank you for reading and for your answer.