public static void ExportShader(UnityParser parser, string name, string path) { for (int i = 0; i < parser.Cabinet.Components.Count; i++) { Component asset = parser.Cabinet.Components[i]; if (asset.classID1 == UnityClassID.Shader) { Shader sic = parser.Cabinet.LoadComponent(asset.pathID); if (name == "*" || sic.m_Name == name) { sic.Export(path); } } } }
public void ExportShader(Component asset, string path) { Shader shader = LoadWhenNeeded(asset); shader.Export(path); }