From 47326e39837bd33bd5d4f155049a898810418a63 Mon Sep 17 00:00:00 2001 From: orels1 Date: Thu, 17 Mar 2022 17:49:38 +0400 Subject: [PATCH] Fixed Default Textures from Modular Shader props werent applied - ApplyDefaultTextures function was only grabbing textures from the modules, but not the Shader's props themselves, this little fix addresses that --- Editor/ShaderGenerator.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Editor/ShaderGenerator.cs b/Editor/ShaderGenerator.cs index 3520149..962b7af 100644 --- a/Editor/ShaderGenerator.cs +++ b/Editor/ShaderGenerator.cs @@ -849,6 +849,7 @@ private static void ApplyDefaultTextures(List contexts) { var importedShader = AssetImporter.GetAtPath($"{context.FilePath}/" + context.VariantFileName) as ShaderImporter; var customTextures = context.Modules.SelectMany(x => x.Properties).Where(x => x.DefaultTextureAsset != null).ToList(); + customTextures.AddRange(context.Shader.Properties.Where(x => x.DefaultTextureAsset != null).ToList()); if (importedShader != null) { importedShader.SetDefaultTextures(customTextures.Select(x => x.Name).ToArray(), customTextures.Select(x => x.DefaultTextureAsset).ToArray());