/// <summary> /// Generates the material variants. /// </summary> static void GenerateMaterialVariants(Shader shader) { var combinations = (from tone in (ToneMode[])Enum.GetValues(typeof(ToneMode)) from color in (ColorMode[])Enum.GetValues(typeof(ColorMode)) from blur in (BlurMode[])Enum.GetValues(typeof(BlurMode)) select new { tone, color, blur }).ToArray(); for (int i = 0; i < combinations.Length; i++) { var comb = combinations[i]; EditorUtility.DisplayProgressBar("Genarate Effect Material", UIEffect.GetVariantName(shader, comb.tone, comb.color, comb.blur), (float)i / combinations.Length); UIEffect.GetOrGenerateMaterialVariant(shader, comb.tone, comb.color, comb.blur); } EditorUtility.ClearProgressBar(); }
static void GenerateMaterialVariants(Shader shader, ToneMode[] tones, ColorMode[] colors, BlurMode[] blurs) { var combinations = (from tone in tones from color in colors from blur in blurs select new { tone, color, blur }).ToArray(); for (int i = 0; i < combinations.Length; i++) { var comb = combinations[i]; EditorUtility.DisplayProgressBar("Genarate Effect Material Bundle", UIEffect.GetVariantName(shader, comb.tone, comb.color, comb.blur), (float)i / combinations.Length); UIEffect.GetOrGenerateMaterialVariant(shader, comb.tone, comb.color, comb.blur); } EditorUtility.ClearProgressBar(); }