public static getShader ( string name ) : |
||
name | string | |
리턴 |
public static void updateRenderer(Renderer rend, string shader, string diffuse, string normal, string specular, string emissive, string occlusion, ShaderProperty[] props) { Material m = rend.material; if (!String.IsNullOrEmpty(shader) && shader != m.shader.name) { m.shader = SSTUDatabase.getShader(shader); } if (!String.IsNullOrEmpty(diffuse)) { m.mainTexture = GameDatabase.Instance.GetTexture(diffuse, false); } if (!String.IsNullOrEmpty(normal)) { m.SetTexture("_BumpMap", GameDatabase.Instance.GetTexture(normal, true)); } if (!String.IsNullOrEmpty(specular)) { m.SetTexture("_SpecMap", GameDatabase.Instance.GetTexture(specular, false)); } if (!String.IsNullOrEmpty(emissive)) { m.SetTexture("_Emissive", GameDatabase.Instance.GetTexture(emissive, false)); } if (!String.IsNullOrEmpty(occlusion)) { m.SetTexture("_AOMap", GameDatabase.Instance.GetTexture(occlusion, false)); } updateMaterialProperties(m, props); }
private static void replaceShader(Material m, string name) { m.shader = SSTUDatabase.getShader(name); }