Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }