예제 #1
0
        private YAMLNode ExportAlwaysIncludedShaders(IExportContainer container)
        {
            if (ToSerializedVersion(container.Version) >= 3)
            {
                return(AlwaysIncludedShaders.ExportYAML(container));
            }

            YAMLSequenceNode node        = new YAMLSequenceNode(SequenceStyle.Block);
            HashSet <string> shaderNames = new HashSet <string>();

            if (IsReadAlwaysIncludedShaders(container.Version))
            {
                foreach (PPtr <Shader> shaderPtr in AlwaysIncludedShaders)
                {
                    node.Add(shaderPtr.ExportYAML(container));
                    Shader shader = shaderPtr.FindAsset(container);
                    if (shader != null)
                    {
                        shaderNames.Add(shader.ValidName);
                    }
                }
            }

            ExportShaderPointer(container, node, shaderNames, "Legacy Shaders/Diffuse");
            ExportShaderPointer(container, node, shaderNames, "Hidden/CubeBlur");
            ExportShaderPointer(container, node, shaderNames, "Hidden/CubeCopy");
            ExportShaderPointer(container, node, shaderNames, "Hidden/CubeBlend");
            ExportShaderPointer(container, node, shaderNames, "Sprites/Default");
            ExportShaderPointer(container, node, shaderNames, "UI/Default");
            return(node);
        }
예제 #2
0
        private YAMLNode ExportAlwaysIncludedShaders(IExportContainer container)
        {
            if (ToSerializedVersion(container.Version) >= 3)
            {
                return(AlwaysIncludedShaders.ExportYAML(container));
            }

            YAMLSequenceNode node        = new YAMLSequenceNode(SequenceStyle.Block);
            HashSet <string> shaderNames = new HashSet <string>();

            if (HasAlwaysIncludedShaders(container.Version))
            {
                foreach (PPtr <Shader> shaderPtr in AlwaysIncludedShaders)
                {
                    node.Add(shaderPtr.ExportYAML(container));
                    Shader shader = shaderPtr.FindAsset(container);
                    if (shader != null)
                    {
                        shaderNames.Add(shader.ValidName);
                    }
                }
            }

            ExportShaderPointer(container, node, shaderNames, EngineBuiltInAssets.LegacyDiffuse);
            ExportShaderPointer(container, node, shaderNames, EngineBuiltInAssets.CubeBlur);
            ExportShaderPointer(container, node, shaderNames, EngineBuiltInAssets.CubeCopy);
            ExportShaderPointer(container, node, shaderNames, EngineBuiltInAssets.CubeBlend);
            ExportShaderPointer(container, node, shaderNames, EngineBuiltInAssets.SpriteDefault);
            ExportShaderPointer(container, node, shaderNames, EngineBuiltInAssets.UIDefault);
            return(node);
        }