Exemplo n.º 1
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            Scene.Read(stream);
            if (IsReadLightmaps(stream.Flags))
            {
                m_lightmaps = stream.ReadArray <LightmapData>();
                stream.AlignStream(AlignType.Align4);

                LightProbes.Read(stream);
                LightmapsMode = stream.ReadInt32();
                BakedAmbientProbeInLinear.Read(stream);
                m_lightmappedRendererData = stream.ReadArray <RendererData>();
                stream.AlignStream(AlignType.Align4);

                m_lightmappedRendererDataIDs = stream.ReadArray <SceneObjectIdentifier>();
                stream.AlignStream(AlignType.Align4);

                EnlightenSceneMapping.Read(stream);
                m_enlightenSceneMappingRendererIDs = stream.ReadArray <SceneObjectIdentifier>();
                stream.AlignStream(AlignType.Align4);

                m_lights = stream.ReadArray <SceneObjectIdentifier>();
                stream.AlignStream(AlignType.Align4);

                m_lightBakingOutputs = stream.ReadArray <LightBakingOutput>();
                stream.AlignStream(AlignType.Align4);

                m_bakedReflectionProbeCubemaps = stream.ReadArray <PPtr <Texture> >();
                m_bakedReflectionProbes        = stream.ReadArray <SceneObjectIdentifier>();
                stream.AlignStream(AlignType.Align4);

                if (IsReadEnlightenData(stream.Flags))
                {
                    m_enlightenData = stream.ReadByteArray();
                    stream.AlignStream(AlignType.Align4);
                }

                EnlightenDataVersion = stream.ReadInt32();
            }
        }
Exemplo n.º 2
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            if (IsReadEnlightenSceneMapping(reader.Version, reader.Flags))
            {
                EnlightenSceneMapping.Read(reader);
            }
            if (IsReadGIWorkflowMode(reader.Version, reader.Flags))
            {
                GIWorkflowMode = reader.ReadInt32();
            }

            if (IsReadLightProbes(reader.Version, reader.Flags))
            {
                LightProbes.Read(reader);
            }
            if (IsReadLightmaps(reader.Flags))
            {
                m_lightmaps = reader.ReadArray <LightmapData>();
            }
            if (IsAlign1(reader.Version, reader.Flags))
            {
                reader.AlignStream(AlignType.Align4);
            }

            if (IsReadLightmapsMode(reader.Version, reader.Flags))
            {
                LightmapsMode = (LightmapsMode)reader.ReadInt32();
            }
            if (IsReadBakedColorSpace(reader.Version))
            {
                BakedColorSpace = reader.ReadInt32();
            }
            if (IsReadUseDualLightmapsInForward(reader.Version))
            {
                UseDualLightmapsInForward = reader.ReadBoolean();
            }
            if (IsAlign2(reader.Version))
            {
                reader.AlignStream(AlignType.Align4);
            }

            if (IsReadGISettings(reader.Version))
            {
                GISettings.Read(reader);
            }

            if (IsReadLightmapEditorSettings(reader.Version, reader.Flags))
            {
                LightmapEditorSettings.Read(reader);
            }
            if (IsReadLightingDataAsset(reader.Version, reader.Flags))
            {
                LightingDataAsset.Read(reader);
            }
            if (IsReadRuntimeCPUUsage(reader.Version))
            {
                RuntimeCPUUsage = reader.ReadInt32();
            }
            if (IsReadUseShadowmask(reader.Version))
            {
                if (IsBoolShadowmask(reader.Version))
                {
                    UseShadowmask = reader.ReadBoolean();
                }
                else
                {
                    UseShadowmask = reader.ReadInt32() == 0 ? false : true;
                }
            }
        }