protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container) { YAMLMappingNode node = base.ExportYAMLRoot(container); node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion)); node.Add(ExternalVersionControlSupportName, ExternalVersionControlSupport); node.Add(SerializationModeName, (int)SerializationMode); node.Add(LineEndingsForNewScriptsName, (int)LineEndingsForNewScripts); node.Add(DefaultBehaviorModeName, (int)DefaultBehaviorMode); if (HasPrefabRegularEnvironment(container.ExportVersion)) { node.Add(PrefabRegularEnvironmentName, PrefabRegularEnvironment.ExportYAML(container)); node.Add(PrefabUIEnvironmentName, PrefabUIEnvironment.ExportYAML(container)); } node.Add(SpritePackerModeName, (int)SpritePackerMode); node.Add(SpritePackerPaddingPowerName, GetSpritePackerPaddingPower(container.Version)); node.Add(EtcTextureCompressorBehaviorName, GetEtcTextureCompressorBehavior(container.Version)); node.Add(EtcTextureFastCompressorName, GetEtcTextureFastCompressor(container.Version)); node.Add(EtcTextureNormalCompressorName, GetEtcTextureNormalCompressor(container.Version)); node.Add(EtcTextureBestCompressorName, GetEtcTextureBestCompressor(container.Version)); node.Add(ProjectGenerationIncludedExtensionsName, GetProjectGenerationIncludedExtensions(container.Version)); node.Add(ProjectGenerationRootNamespaceName, GetProjectGenerationRootNamespace(container.Version)); if (HasUserGeneratedProjectSuffix(container.ExportVersion)) { node.Add(UserGeneratedProjectSuffixName, GetUserGeneratedProjectSuffix(container.Version)); } node.Add(CollabEditorSettingsName, GetCollabEditorSettings(container.Version).ExportYAML(container)); if (HasEnableTextureStreamingInEditMode(container.ExportVersion)) { node.Add(EnableTextureStreamingInEditModeName, GetEnableTextureStreamingInEditMode(container.Version)); } if (HasEnableTextureStreamingInPlayMode(container.ExportVersion)) { node.Add(EnableTextureStreamingInPlayModeName, GetEnableTextureStreamingInPlayMode(container.Version)); } if (HasAsyncShaderCompilation(container.ExportVersion)) { node.Add(AsyncShaderCompilationName, GetAsyncShaderCompilation(container.Version)); } if (HasShowLightmapResolutionOverlay(container.ExportVersion)) { node.Add(ShowLightmapResolutionOverlayName, GetShowLightmapResolutionOverlay(container.Version)); } return(node); }
public override void Read(AssetReader reader) { base.Read(reader); if (IsReadExternalVersionControl(reader.Version)) { ExternalVersionControl support = (ExternalVersionControl)reader.ReadInt32(); switch (support) { case ExternalVersionControl.AutoDetect: ExternalVersionControlSupport = "Auto detect"; break; case ExternalVersionControl.Disabled: ExternalVersionControlSupport = HiddenMeta; break; case ExternalVersionControl.Generic: case ExternalVersionControl.AssetServer: ExternalVersionControlSupport = VisibleMeta; break; case ExternalVersionControl.Subversion: case ExternalVersionControl.Perforce: ExternalVersionControlSupport = support.ToString(); break; default: ExternalVersionControlSupport = HiddenMeta; break; } } else { ExternalVersionControlSupport = reader.ReadString(); switch (ExternalVersionControlSupport) { case "Disabled": ExternalVersionControlSupport = HiddenMeta; break; case "Meta Files": case "Asset Server": ExternalVersionControlSupport = VisibleMeta; break; } } SerializationMode = (SerializationMode)reader.ReadInt32(); if (IsReadWebSecurityEmulationEnabled(reader.Version)) { WebSecurityEmulationEnabled = reader.ReadInt32(); WebSecurityEmulationHostUrl = reader.ReadString(); } reader.AlignStream(AlignType.Align4); if (IsReadLineEndingsForNewScripts(reader.Version)) { LineEndingsForNewScripts = (LineEndingsMode)reader.ReadInt32(); } if (IsReadDefaultBehaviorMode(reader.Version)) { DefaultBehaviorMode = (EditorBehaviorMode)reader.ReadInt32(); } if (IsReadPrefabRegularEnvironment(reader.Version)) { PrefabRegularEnvironment.Read(reader); PrefabUIEnvironment.Read(reader); } if (IsReadSpritePackerMode(reader.Version)) { SpritePackerMode = (SpritePackerMode)reader.ReadInt32(); } if (IsReadSpritePackerPaddingPower(reader.Version)) { SpritePackerPaddingPower = reader.ReadInt32(); } if (IsReadEtcTextureCompressorBehavior(reader.Version)) { EtcTextureCompressorBehavior = reader.ReadInt32(); EtcTextureFastCompressor = reader.ReadInt32(); EtcTextureNormalCompressor = reader.ReadInt32(); EtcTextureBestCompressor = reader.ReadInt32(); } if (IsReadProjectGenerationIncludedExtensions(reader.Version)) { ProjectGenerationIncludedExtensions = reader.ReadString(); ProjectGenerationRootNamespace = reader.ReadString(); } if (IsReadUserGeneratedProjectSuffix(reader.Version)) { UserGeneratedProjectSuffix = reader.ReadString(); } if (IsReadCollabEditorSettings(reader.Version)) { CollabEditorSettings.Read(reader); } if (IsReadEnableTextureStreamingInEditMode(reader.Version)) { EnableTextureStreamingInEditMode = reader.ReadBoolean(); } if (IsReadEnableTextureStreamingInPlayMode(reader.Version)) { EnableTextureStreamingInPlayMode = reader.ReadBoolean(); } if (IsReadAsyncShaderCompilation(reader.Version)) { AsyncShaderCompilation = reader.ReadBoolean(); } if (IsAlign(reader.Version)) { reader.AlignStream(AlignType.Align4); } }
public override void Read(AssetReader reader) { base.Read(reader); if (HasExternalVersionControl(reader.Version)) { ExternalVersionControl support = (ExternalVersionControl)reader.ReadInt32(); switch (support) { case ExternalVersionControl.AutoDetect: ExternalVersionControlSupport = "Auto detect"; break; case ExternalVersionControl.Disabled: ExternalVersionControlSupport = HiddenMeta; break; case ExternalVersionControl.Generic: case ExternalVersionControl.AssetServer: ExternalVersionControlSupport = VisibleMeta; break; case ExternalVersionControl.Subversion: case ExternalVersionControl.Perforce: ExternalVersionControlSupport = support.ToString(); break; default: ExternalVersionControlSupport = HiddenMeta; break; } } else { ExternalVersionControlSupport = reader.ReadString(); switch (ExternalVersionControlSupport) { case "Disabled": ExternalVersionControlSupport = HiddenMeta; break; case "Meta Files": case "Asset Server": ExternalVersionControlSupport = VisibleMeta; break; } } if (HasSerializationMode(reader.Version)) { SerializationMode = (SerializationMode)reader.ReadInt32(); } if (HasWebSecurityEmulationEnabled(reader.Version)) { WebSecurityEmulationEnabled = reader.ReadInt32(); WebSecurityEmulationHostUrl = reader.ReadString(); } reader.AlignStream(); if (HasLineEndingsForNewScripts(reader.Version)) { LineEndingsForNewScripts = (LineEndingsMode)reader.ReadInt32(); } if (HasDefaultBehaviorMode(reader.Version)) { DefaultBehaviorMode = (EditorBehaviorMode)reader.ReadInt32(); } if (HasPrefabRegularEnvironment(reader.Version)) { PrefabRegularEnvironment.Read(reader); PrefabUIEnvironment.Read(reader); } if (HasSpritePackerMode(reader.Version)) { SpritePackerMode = (SpritePackerMode)reader.ReadInt32(); } if (HasSpritePackerPaddingPower(reader.Version)) { SpritePackerPaddingPower = reader.ReadInt32(); } if (HasEtcTextureCompressorBehavior(reader.Version)) { EtcTextureCompressorBehavior = reader.ReadInt32(); EtcTextureFastCompressor = reader.ReadInt32(); EtcTextureNormalCompressor = reader.ReadInt32(); EtcTextureBestCompressor = reader.ReadInt32(); } if (HasProjectGenerationIncludedExtensions(reader.Version)) { ProjectGenerationIncludedExtensions = reader.ReadString(); ProjectGenerationRootNamespace = reader.ReadString(); } if (HasUserGeneratedProjectSuffix(reader.Version)) { UserGeneratedProjectSuffix = reader.ReadString(); } if (HasCollabEditorSettings(reader.Version)) { CollabEditorSettings.Read(reader); } if (HasEnableTextureStreamingInEditMode(reader.Version)) { EnableTextureStreamingInEditMode = reader.ReadBoolean(); } if (HasEnableTextureStreamingInPlayMode(reader.Version)) { EnableTextureStreamingInPlayMode = reader.ReadBoolean(); } if (HasAsyncShaderCompilation(reader.Version)) { AsyncShaderCompilation = reader.ReadBoolean(); } if (IsAlign1(reader.Version)) { reader.AlignStream(); } if (HasEnterPlayModeOptions(reader.Version)) { EnterPlayModeOptionsEnabled = reader.ReadBoolean(); reader.AlignStream(); EnterPlayModeOptions = (EnterPlayModeOptions)reader.ReadInt32(); } if (HasShowLightmapResolutionOverlay(reader.Version)) { ShowLightmapResolutionOverlay = reader.ReadBoolean(); } if (IsAlign2(reader.Version)) { reader.AlignStream(); } if (HasUseLegacyProbeSampleCount(reader.Version)) { UseLegacyProbeSampleCount = reader.ReadInt32(); reader.AlignStream(); } if (HasAssetPipelineMode(reader.Version)) { AssetPipelineMode = (AssetPipelineMode)reader.ReadInt32(); CacheServerMode = (CacheServerMode)reader.ReadInt32(); CacheServerEndpoint = reader.ReadString(); CacheServerNamespacePrefix = reader.ReadString(); CacheServerEnableDownload = reader.ReadBoolean(); CacheServerEnableUpload = reader.ReadBoolean(); reader.AlignStream(); } }