Exemple #1
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            node.Add(PatchesName, Patches.ExportYAML(container));
            node.Add(DetailPrototypesName, DetailPrototypes.ExportYAML(container));
            node.Add(PatchCountName, PatchCount);
            node.Add(PatchSamplesName, PatchSamples);
            node.Add(RandomRotationsName, RandomRotations.ExportYAML(container));
            if (HasAtlasTexture(container.ExportVersion))
            {
                node.Add(AtlasTextureName, AtlasTexture.ExportYAML(container));
            }

            node.Add(WavingGrassTintName, WavingGrassTint.ExportYAML(container));
            node.Add(WavingGrassStrengthName, WavingGrassStrength);
            node.Add(WavingGrassAmountName, WavingGrassAmount);
            node.Add(WavingGrassSpeedName, WavingGrassSpeed);
            if (HasDetailBillboardShader(container.ExportVersion))
            {
                node.Add(DetailBillboardShaderName, DetailBillboardShader.ExportYAML(container));
                node.Add(DetailMeshLitShaderName, DetailMeshLitShader.ExportYAML(container));
                node.Add(DetailMeshGrassShaderName, DetailMeshGrassShader.ExportYAML(container));
            }
            TreeDatabase.ExportYAML(container, node);
            if (!HasAtlasTexture(container.ExportVersion))
            {
                node.Add(PreloadTextureAtlasDataName, PreloadTextureAtlasData.ExportYAML(container));
            }
            return(node);
        }
Exemple #2
0
        private YAMLNode ExportDetailMeshGrassShader(IExportContainer container)
        {
            if (IsReadDetailBillboardShader(container.Version))
            {
                return(DetailMeshGrassShader.ExportYAML(container));
            }

            EngineBuiltInAsset buildInAsset = EngineBuiltInAssets.GetShader(EngineBuiltInAssets.TerrainWavingDoublePass, container.ExportVersion);

            return(buildInAsset.ToExportPointer().ExportYAML(container));
        }
        private YAMLNode ExportDetailMeshGrassShader(IExportContainer container)
        {
            if (IsReadDetailBillboardShader(container.Version))
            {
                return(DetailMeshGrassShader.ExportYAML(container));
            }

            EngineBuiltInAsset buildInAsset = EngineBuiltInAssets.Shaders[EngineBuiltInAssets.TerrainWavingDoublePass];
            ExportPointer      pointer      = new ExportPointer(buildInAsset.ExportID, buildInAsset.GUID, AssetType.Internal);

            return(pointer.ExportYAML(container));
        }