Exemple #1
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            Type = (LightType)reader.ReadInt32();
            Color.Read(reader);
            if (IsReadAttenuate(reader.Version))
            {
                Attenuate = reader.ReadBoolean();
                if (IsAlign(reader.Version))
                {
                    reader.AlignStream(AlignType.Align4);
                }
            }
            if (IsReadIntensity(reader.Version))
            {
                Intensity = reader.ReadSingle();
            }
            Range     = reader.ReadSingle();
            SpotAngle = reader.ReadSingle();
            if (IsReadCookieSize(reader.Version))
            {
                CookieSize = reader.ReadSingle();
            }
            if (IsReadShadows(reader.Version))
            {
                Shadows.Read(reader);
            }
            Cookie.Read(reader);
            DrawHalo = reader.ReadBoolean();
            if (IsReadActuallyLightmapped(reader.Version))
            {
                ActuallyLightmapped = reader.ReadBoolean();
            }
            if (IsAlign(reader.Version))
            {
                reader.AlignStream(AlignType.Align4);
            }

            if (IsReadBakedIndex(reader.Version))
            {
                BakedIndex = reader.ReadInt32();
            }
            if (IsReadBakingOutput(reader.Version))
            {
                BakingOutput.Read(reader);
            }
            Flare.Read(reader);
            RenderMode = (LightRenderMode)reader.ReadInt32();
            if (IsReadCullingMask(reader.Version))
            {
                CullingMask.Read(reader);
            }
            if (IsReadLightmapping(reader.Version))
            {
                Lightmapping = (LightmappingMode)reader.ReadInt32();
            }
            if (IsReadLightShadowCasterMode(reader.Version))
            {
                LightShadowCasterMode = (LightShadowCasterMode)reader.ReadInt32();
            }
            if (IsReadAreaSize(reader.Version))
            {
                AreaSize.Read(reader);
            }
            if (IsReadBounceIntensity(reader.Version))
            {
                BounceIntensity = reader.ReadSingle();
            }
            if (IsReadFalloffTable(reader.Version))
            {
                FalloffTable.Read(reader);
            }
            if (IsReadColorTemperature(reader.Version))
            {
                ColorTemperature    = reader.ReadSingle();
                UseColorTemperature = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }
        }
Exemple #2
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            Type = (LightType)stream.ReadInt32();
            Color.Read(stream);
            if (IsReadAttenuate(stream.Version))
            {
                Attenuate = stream.ReadBoolean();
                if (IsAlign(stream.Version))
                {
                    stream.AlignStream(AlignType.Align4);
                }
            }
            if (IsReadIntensity(stream.Version))
            {
                Intensity = stream.ReadSingle();
            }
            Range     = stream.ReadSingle();
            SpotAngle = stream.ReadSingle();
            if (IsReadCookieSize(stream.Version))
            {
                CookieSize = stream.ReadSingle();
            }
            if (IsReadShadows(stream.Version))
            {
                Shadows.Read(stream);
            }
            Cookie.Read(stream);
            DrawHalo = stream.ReadBoolean();
            if (IsReadActuallyLightmapped(stream.Version))
            {
                ActuallyLightmapped = stream.ReadBoolean();
            }
            if (IsAlign(stream.Version))
            {
                stream.AlignStream(AlignType.Align4);
            }

            if (IsReadBakedIndex(stream.Version))
            {
                BakedIndex = stream.ReadInt32();
            }
            if (IsReadBakingOutput(stream.Version))
            {
                BakingOutput.Read(stream);
            }
            Flare.Read(stream);
            RenderMode = (LightRenderMode)stream.ReadInt32();
            if (IsReadCullingMask(stream.Version))
            {
                CullingMask.Read(stream);
            }
            if (IsReadLightmapping(stream.Version))
            {
                Lightmapping = (LightmappingMode)stream.ReadInt32();
            }
            if (IsReadAreaSize(stream.Version))
            {
                AreaSize.Read(stream);
            }
            if (IsReadBounceIntensity(stream.Version))
            {
                BounceIntensity = stream.ReadSingle();
            }
            if (IsReadColorTemperature(stream.Version))
            {
                ColorTemperature    = stream.ReadSingle();
                UseColorTemperature = stream.ReadBoolean();
                stream.AlignStream(AlignType.Align4);
            }
        }