예제 #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);
            }
        }
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            Type = (LightType)reader.ReadInt32();
            if (HasShape(reader.Version))
            {
                Shape = (LightShape)reader.ReadInt32();
            }
            Color.Read(reader);
            if (HasAttenuate(reader.Version))
            {
                Attenuate = reader.ReadBoolean();
                if (IsAlign(reader.Version))
                {
                    reader.AlignStream();
                }
            }
            if (HasIntensity(reader.Version))
            {
                Intensity = reader.ReadSingle();
            }
            Range     = reader.ReadSingle();
            SpotAngle = reader.ReadSingle();
            if (HasInnerSpotAngle(reader.Version))
            {
                InnerSpotAngle = reader.ReadSingle();
            }
            if (HasCookieSize(reader.Version))
            {
                CookieSize = reader.ReadSingle();
            }
            if (HasShadows(reader.Version))
            {
                Shadows.Read(reader);
            }
            Cookie.Read(reader);
            DrawHalo = reader.ReadBoolean();
            if (HasActuallyLightmapped(reader.Version))
            {
                ActuallyLightmapped = reader.ReadBoolean();
            }
            if (IsAlign(reader.Version))
            {
                reader.AlignStream();
            }

            if (HasBakedIndex(reader.Version))
            {
                BakedIndex = reader.ReadInt32();
            }
            if (HasBakingOutput(reader.Version, reader.Flags))
            {
                BakingOutput.Read(reader);
            }
            Flare.Read(reader);
            RenderMode = (LightRenderMode)reader.ReadInt32();
            if (HasCullingMask(reader.Version))
            {
                CullingMask.Read(reader);
            }
            if (HasRenderingLayerMask(reader.Version))
            {
                RenderingLayerMask = reader.ReadInt32();
            }
            if (HasLightmapping(reader.Version))
            {
                Lightmapping = (LightmappingMode)reader.ReadInt32();
            }
            if (HasLightShadowCasterMode(reader.Version))
            {
                LightShadowCasterMode = (LightShadowCasterMode)reader.ReadInt32();
            }
            if (HasAreaSize(reader.Version))
            {
                AreaSize.Read(reader);
            }
            if (HasBounceIntensity(reader.Version))
            {
                BounceIntensity = reader.ReadSingle();
            }
            if (HasFalloffTable(reader.Version))
            {
                FalloffTable.Read(reader);
            }
            if (HasColorTemperature(reader.Version))
            {
                ColorTemperature = reader.ReadSingle();
            }
            if (HasUseColorTemperature(reader.Version))
            {
                UseColorTemperature = reader.ReadBoolean();
                reader.AlignStream();
            }
            if (HasBoundingSphereOverride(reader.Version))
            {
                BoundingSphereOverride.Read(reader);
                UseBoundingSphereOverride = reader.ReadBoolean();
                reader.AlignStream();
            }
#if UNIVERSAL
            if (HasShadowRadius(reader.Version, reader.Flags))
            {
                ShadowRadius = reader.ReadSingle();
                ShadowAngle  = reader.ReadSingle();
            }
#endif
        }