Пример #1
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("m_Fog", Fog);
            node.Add("m_FogColor", FogColor.ExportYAML(container));
            node.Add("m_FogMode", (int)GetExportFogMode(container.Version));
            node.Add("m_FogDensity", FogDensity);
            node.Add("m_LinearFogStart", LinearFogStart);
            node.Add("m_LinearFogEnd", GetExportLinearFogEnd(container.Version));
            node.Add("m_AmbientSkyColor", AmbientSkyColor.ExportYAML(container));
            node.Add("m_AmbientEquatorColor", GetExportAmbientEquatorColor(container.Version).ExportYAML(container));
            node.Add("m_AmbientGroundColor", GetExportAmbientGroundColor(container.Version).ExportYAML(container));
            node.Add("m_AmbientIntensity", GetExportAmbientIntensity(container.Version));
            node.Add("m_AmbientMode", (int)AmbientMode);
            node.Add("m_SubtractiveShadowColor", GetExportSubtractiveShadowColor(container.Version).ExportYAML(container));
            node.Add("m_SkyboxMaterial", SkyboxMaterial.ExportYAML(container));
            node.Add("m_HaloStrength", HaloStrength);
            node.Add("m_FlareStrength", FlareStrength);
            node.Add("m_FlareFadeSpeed", GetExportFlareFadeSpeed(container.Version));
            node.Add("m_HaloTexture", HaloTexture.ExportYAML(container));
            node.Add("m_SpotCookie", SpotCookie.ExportYAML(container));
            node.Add("m_DefaultReflectionMode", DefaultReflectionMode);
            node.Add("m_DefaultReflectionResolution", GetExportDefaultReflectionResolution(container.Version));
            node.Add("m_ReflectionBounces", GetExportReflectionBounces(container.Version));
            node.Add("m_ReflectionIntensity", GetExportReflectionIntensity(container.Version));
            node.Add("m_CustomReflection", CustomReflection.ExportYAML(container));
            node.Add("m_Sun", Sun.ExportYAML(container));
            node.Add("m_IndirectSpecularColor", GetExportIndirectSpecularColor(container.Version).ExportYAML(container));
            return(node);
        }
Пример #2
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add(FogName, Fog);
            node.Add(FogColorName, FogColor.ExportYAML(container));
            node.Add(FogModeName, (int)GetExportFogMode(container.Version));
            node.Add(FogDensityName, FogDensity);
            node.Add(LinearFogStartName, LinearFogStart);
            node.Add(LinearFogEndName, GetExportLinearFogEnd(container.Version));
            node.Add(AmbientSkyColorName, AmbientSkyColor.ExportYAML(container));
            node.Add(AmbientEquatorColorName, GetExportAmbientEquatorColor(container.Version).ExportYAML(container));
            node.Add(AmbientGroundColorName, GetExportAmbientGroundColor(container.Version).ExportYAML(container));
            node.Add(AmbientIntensityName, GetExportAmbientIntensity(container.Version));
            node.Add(AmbientModeName, (int)AmbientMode);
            node.Add(SubtractiveShadowColorName, GetExportSubtractiveShadowColor(container.Version).ExportYAML(container));
            node.Add(SkyboxMaterialName, SkyboxMaterial.ExportYAML(container));
            node.Add(HaloStrengthName, HaloStrength);
            node.Add(FlareStrengthName, FlareStrength);
            node.Add(FlareFadeSpeedName, GetExportFlareFadeSpeed(container.Version));
            node.Add(HaloTextureName, HaloTexture.ExportYAML(container));
            node.Add(SpotCookieName, SpotCookie.ExportYAML(container));
            node.Add(DefaultReflectionModeName, DefaultReflectionMode);
            node.Add(DefaultReflectionResolutionName, GetExportDefaultReflectionResolution(container.Version));
            node.Add(ReflectionBouncesName, GetExportReflectionBounces(container.Version));
            node.Add(ReflectionIntensityName, GetExportReflectionIntensity(container.Version));
            node.Add(CustomReflectionName, CustomReflection.ExportYAML(container));
            node.Add(SunName, Sun.ExportYAML(container));
            node.Add(IndirectSpecularColorName, GetExportIndirectSpecularColor(container.Version).ExportYAML(container));
            return(node);
        }
Пример #3
0
        protected override YAMLMappingNode ExportYAMLRoot(IAssetsExporter exporter)
        {
#warning TODO: values acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = base.ExportYAMLRoot(exporter);
            node.AddSerializedVersion(GetSerializedVersion(exporter.Version));
            node.Add("m_Fog", Fog);
            node.Add("m_FogColor", FogColor.ExportYAML(exporter));
            node.Add("m_FogMode", FogMode);
            node.Add("m_FogDensity", FogDensity);
            node.Add("m_LinearFogStart", LinearFogStart);
            node.Add("m_LinearFogEnd", LinearFogEnd);
            node.Add("m_AmbientSkyColor", AmbientSkyColor.ExportYAML(exporter));
            node.Add("m_AmbientEquatorColor", AmbientEquatorColor.ExportYAML(exporter));
            node.Add("m_AmbientGroundColor", AmbientGroundColor.ExportYAML(exporter));
            node.Add("m_AmbientIntensity", AmbientIntensity);
            node.Add("m_AmbientMode", AmbientMode);
            node.Add("m_SubtractiveShadowColor", SubtractiveShadowColor.ExportYAML(exporter));
            node.Add("m_SkyboxMaterial", SkyboxMaterial.ExportYAML(exporter));
            node.Add("m_HaloStrength", HaloStrength);
            node.Add("m_FlareStrength", FlareStrength);
            node.Add("m_FlareFadeSpeed", FlareFadeSpeed);
            node.Add("m_HaloTexture", HaloTexture.ExportYAML(exporter));
            node.Add("m_SpotCookie", SpotCookie.ExportYAML(exporter));
            node.Add("m_DefaultReflectionMode", DefaultReflectionMode);
            node.Add("m_DefaultReflectionResolution", DefaultReflectionResolution);
            node.Add("m_ReflectionBounces", ReflectionBounces);
            node.Add("m_ReflectionIntensity", ReflectionIntensity);
            node.Add("m_CustomReflection", CustomReflection.ExportYAML(exporter));
            node.Add("m_AmbientProbe", AmbientProbe.ExportYAML(exporter));
            node.Add("m_GeneratedSkyboxReflection", GeneratedSkyboxReflection.ExportYAML(exporter));
            node.Add("m_Sun", Sun.ExportYAML(exporter));
            node.Add("m_IndirectSpecularColor", IndirectSpecularColor.ExportYAML(exporter));
            return(node);
        }
Пример #4
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            Fog = reader.ReadBoolean();
            if (IsAlign(reader.Version))
            {
                reader.AlignStream(AlignType.Align4);
            }

            FogColor.Read(reader);
            if (IsReadFogMode(reader.Version))
            {
                FogMode = (FogMode)reader.ReadInt32();
            }
            FogDensity = reader.ReadSingle();
            if (IsReadLinearFogStart(reader.Version))
            {
                LinearFogStart = reader.ReadSingle();
                LinearFogEnd   = reader.ReadSingle();
            }
            AmbientSkyColor.Read(reader);
            if (IsReadAmbientEquatorColor(reader.Version))
            {
                AmbientEquatorColor.Read(reader);
                AmbientGroundColor.Read(reader);
                AmbientIntensity = reader.ReadSingle();
            }
            if (IsReadAmbientProbe(reader.Version, reader.Flags))
            {
                if (IsReadAmbientProbeFirst(reader.Version))
                {
                    AmbientProbe.Read(reader);
                }
            }
            if (IsReadAmbientSkyboxLight(reader.Version))
            {
                AmbientSkyboxLight.Read(reader);
            }
            if (IsReadAmbientMode(reader.Version))
            {
                AmbientMode = (AmbientMode)reader.ReadInt32();
                if (IsReadCreateAmbientLight(reader.Version))
                {
                    CreateAmbientLight = reader.ReadBoolean();
                }
                reader.AlignStream(AlignType.Align4);
            }
            if (IsReadSubtractiveShadowColor(reader.Version))
            {
                SubtractiveShadowColor.Read(reader);
            }

            SkyboxMaterial.Read(reader);
            HaloStrength  = reader.ReadSingle();
            FlareStrength = reader.ReadSingle();
            if (IsReadFlareFadeSpeed(reader.Version))
            {
                FlareFadeSpeed = reader.ReadSingle();
            }
            if (IsReadPixelLightCount(reader.Version))
            {
                PixelLightCount = reader.ReadInt32();
            }
            HaloTexture.Read(reader);
            if (IsReadAmbientLightScale(reader.Version))
            {
                AmbientLightScale = reader.ReadSingle();
            }
            if (IsReadSpecularTex(reader.Version))
            {
                SpecularTexture.Read(reader);
            }
            SpotCookie.Read(reader);
            if (IsReadDefaultReflectionMode(reader.Version))
            {
                DefaultReflectionMode = reader.ReadInt32();
            }
            if (IsReadDefaultReflectionResolution(reader.Version))
            {
                DefaultReflectionResolution = reader.ReadInt32();
                ReflectionBounces           = reader.ReadInt32();
                ReflectionIntensity         = reader.ReadSingle();
            }
            if (IsReadCustomReflection(reader.Version))
            {
                CustomReflection.Read(reader);
            }
            if (IsReadAmbientProbe(reader.Version, reader.Flags))
            {
                if (!IsReadAmbientProbeFirst(reader.Version))
                {
                    AmbientProbe.Read(reader);
                }
            }
            if (IsReadAmbientProbeInGamma(reader.Version, reader.Flags))
            {
                AmbientProbeInGamma.Read(reader);
            }
            if (IsReadGeneratedSkyboxReflection(reader.Version, reader.Flags))
            {
                GeneratedSkyboxReflection.Read(reader);
            }
            if (IsReadSun(reader.Version))
            {
                Sun.Read(reader);
            }
            if (IsReadIndirectSpecularColor(reader.Version))
            {
                IndirectSpecularColor.Read(reader);
            }
            if (IsReadUseRadianceAmbientProbe(reader.Version))
            {
                UseRadianceAmbientProbe = reader.ReadBoolean();
            }
        }