public static GetOptimizedShaderName ( |
||
shader | ||
Résultat | string |
private static void ExtractOptimizedShaders(List <TreeMaterial> materials, out Shader optimizedSolidShader, out Shader optimizedCutoutShader) { List <Shader> list = new List <Shader>(); List <Shader> list2 = new List <Shader>(); foreach (TreeMaterial current in materials) { Material material = current.material; if (material && material.shader) { if (TreeEditorHelper.IsTreeBarkShader(material.shader)) { list.Add(material.shader); } else { if (TreeEditorHelper.IsTreeLeafShader(material.shader)) { list2.Add(material.shader); } } } } optimizedSolidShader = null; optimizedCutoutShader = null; if (list.Count > 0) { optimizedSolidShader = Shader.Find(TreeEditorHelper.GetOptimizedShaderName(list[0])); } if (list2.Count > 0) { optimizedCutoutShader = Shader.Find(TreeEditorHelper.GetOptimizedShaderName(list2[0])); } if (!optimizedSolidShader) { optimizedSolidShader = TreeEditorHelper.DefaultOptimizedBarkShader; } if (!optimizedCutoutShader) { optimizedCutoutShader = TreeEditorHelper.DefaultOptimizedLeafShader; } }
private static bool HasOptimizedShaderAndNameContains(Shader shader, string name) { return(TreeEditorHelper.GetOptimizedShaderName(shader) != null && shader.name.ToLower().Contains(name)); }