public void Read(AssetReader reader) { if (HasSkyLightColor(reader.Version)) { SkyLightColor.Read(reader); SkyLightIntensity = reader.ReadSingle(); } BounceScale = reader.ReadSingle(); IndirectOutputScale = reader.ReadSingle(); AlbedoBoost = reader.ReadSingle(); if (HasTemporalCoherenceThreshold(reader.Version)) { TemporalCoherenceThreshold = reader.ReadSingle(); } if (HasDynamicEnv(reader.Version)) { DynamicEnv = reader.ReadBoolean(); } else { EnvironmentLightingMode = (EnvironmentAmbeintMode)reader.ReadUInt32(); EnableBakedLightmaps = reader.ReadBoolean(); EnableRealtimeLightmaps = reader.ReadBoolean(); } reader.AlignStream(); }
public void Write(AssetWriter writer) { if (HasSkyLightColor(writer.Version)) { SkyLightColor.Write(writer); writer.Write(SkyLightIntensity); } writer.Write(BounceScale); writer.Write(IndirectOutputScale); writer.Write(AlbedoBoost); if (HasTemporalCoherenceThreshold(writer.Version)) { writer.Write(TemporalCoherenceThreshold); } if (HasDynamicEnv(writer.Version)) { writer.Write(DynamicEnv); } else { writer.Write((int)EnvironmentLightingMode); writer.Write(EnableBakedLightmaps); writer.Write(EnableRealtimeLightmaps); } writer.AlignStream(); }
public YAMLNode ExportYAML(IExportContainer container) { YAMLMappingNode node = new YAMLMappingNode(); node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion)); if (HasSkyLightColor(container.ExportVersion)) { node.Add(SkyLightColorName, SkyLightColor.ExportYAML(container)); node.Add(SkyLightIntensityName, SkyLightIntensity); } node.Add(BounceScaleName, BounceScale); node.Add(IndirectOutputScaleName, IndirectOutputScale); node.Add(AlbedoBoostName, AlbedoBoost); if (HasTemporalCoherenceThreshold(container.ExportVersion)) { node.Add(TemporalCoherenceThresholdName, TemporalCoherenceThreshold); } if (HasDynamicEnv(container.ExportVersion)) { node.Add(DynamicEnvName, DynamicEnv); } else { node.Add(EnvironmentLightingModeName, (int)EnvironmentLightingMode); node.Add(EnableBakedLightmapsName, EnableBakedLightmaps); node.Add(EnableRealtimeLightmapsName, EnableRealtimeLightmaps); } return(node); }