public static Material SimpleSolidColorMaterial(Color col, bool careAboutVertexColors = false) { Material material = default(Material); if (careAboutVertexColors) { if (!SolidColorMaterials.simpleColorAndVertexColorMats.TryGetValue(col, out material)) { material = SolidColorMaterials.NewSolidColorMaterial(col, ShaderDatabase.VertexColor); SolidColorMaterials.simpleColorAndVertexColorMats.Add(col, material); } } else if (!SolidColorMaterials.simpleColorMats.TryGetValue(col, out material)) { material = SolidColorMaterials.NewSolidColorMaterial(col, ShaderDatabase.SolidColor); SolidColorMaterials.simpleColorMats.Add(col, material); } return(material); }
public static Material Get(Color[] spectrum, float val, Shader shader) { Color col = ColorsFromSpectrum.Get(spectrum, val); return(SolidColorMaterials.NewSolidColorMaterial(col, shader)); }