adb logcat | grep --line-buffered 'Compiled shader' > D:\shaderCompiled%date:~0,4%%date:~5,2%%date:~8,2%.txt
代码里怎么创建ShaderVariantCollection ?没找到相关接口,直接创建一个文件,写入下面内容.
const string emptyShaderVariantCollectionFileContent =
@"%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!200 &20000000
ShaderVariantCollection:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {{fileID: 0}}
m_PrefabInstance: {{fileID: 0}}
m_PrefabAsset: {{fileID: 0}}
m_Name: {0}
m_Shaders: {{}}
";
File.WriteAll(filname, string.format(emptyShaderVariantCollectionFileContent, filenameWithoutExtension));
然后就可以加载这个 ShaderVariantCollection, 并使用其中接口.