static string _GetProperty(MToonMaterial mtoon, MaterialBindType bindType) { switch (bindType) { // case MaterialBindType.UvOffset: // case MaterialBindType.UvScale: // return UV_PROPERTY; case MaterialBindType.Color: return(COLOR_PROPERTY); case MaterialBindType.EmissionColor: return(EMISSION_COLOR_PROPERTY); case MaterialBindType.ShadeColor: return(SHADE_COLOR_PROPERTY); case MaterialBindType.RimColor: return(RIM_COLOR_PROPERTY); case MaterialBindType.OutlineColor: return(OUTLINE_COLOR_PROPERTY); } throw new NotImplementedException(); }
static string _GetProperty(UnlitMaterial unlit, MaterialBindType bindType) { switch (bindType) { // case MaterialBindType.UvOffset: // case MaterialBindType.UvScale: // return UV_PROPERTY; case MaterialBindType.Color: return(COLOR_PROPERTY); } throw new NotImplementedException(); }
static string _GetProperty(PBRMaterial pbr, MaterialBindType bindType) { switch (bindType) { // case MaterialBindType.UvOffset: // case MaterialBindType.UvScale: // return UV_PROPERTY; case MaterialBindType.Color: return(COLOR_PROPERTY); case MaterialBindType.EmissionColor: return(EMISSION_COLOR_PROPERTY); } throw new NotImplementedException(); }
public static string GetProperty(this MaterialBindType bindType, Material material) { if (material is MToonMaterial mtoon) { return(_GetProperty(mtoon, bindType)); } if (material is UnlitMaterial unlit) { return(_GetProperty(unlit, bindType)); } if (material is PBRMaterial pbr) { return(_GetProperty(pbr, bindType)); } throw new NotImplementedException(); }
public MaterialBindValue(Material material, MaterialBindType bindType, Vector4 value) { Material = material; BindType = bindType; Value = value; }
// public MaterialBindValue(Material material, String property, Vector4 value) // { // Material = material; // BindType = material.GetBindType(property); // m_value = value; // } public MaterialColorBind(Material material, MaterialBindType bindType, Vector4 value) { Material = material; BindType = bindType; m_value = value; }