Пример #1
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(GetSerializedVersion(container.ExportVersion));
            node.Add(TypeName, (int)Type);
            node.Add(ColorName, Color.ExportYAML(container));
            node.Add(IntensityName, Intensity);
            node.Add(RangeName, Range);
            node.Add(SpotAngleName, SpotAngle);
            node.Add(CookieSizeName, CookieSize);
            node.Add(ShadowsName, Shadows.ExportYAML(container));
            node.Add(CookieName, Cookie.ExportYAML(container));
            node.Add(DrawHaloName, DrawHalo);
            node.Add(FlareName, Flare.ExportYAML(container));
            node.Add(RenderModeName, (int)RenderMode);
            node.Add(CullingMaskName, CullingMask.ExportYAML(container));
            node.Add(LightmappingName, (int)Lightmapping);
            node.Add(AreaSizeName, AreaSize.ExportYAML(container));
            node.Add(BounceIntensityName, BounceIntensity);
            node.Add(ColorTemperatureName, ColorTemperature);
            node.Add(UseColorTemperatureName, UseColorTemperature);
            node.Add(ShadowRadiusName, 0);
            node.Add(ShadowAngleName, 0);
            return(node);
        }
Пример #2
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
#warning TODO: serialized version acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = base.ExportYAMLRoot(container);
            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("m_Type", (int)Type);
            node.Add("m_Color", Color.ExportYAML(container));
            node.Add("m_Intensity", Intensity);
            node.Add("m_Range", Range);
            node.Add("m_SpotAngle", SpotAngle);
            node.Add("m_CookieSize", CookieSize);
            node.Add("m_Shadows", Shadows.ExportYAML(container));
            node.Add("m_Cookie", Cookie.ExportYAML(container));
            node.Add("m_DrawHalo", DrawHalo);
            node.Add("m_Flare", Flare.ExportYAML(container));
            node.Add("m_RenderMode", (int)RenderMode);
            node.Add("m_CullingMask", CullingMask.ExportYAML(container));
            node.Add("m_Lightmapping", (int)Lightmapping);
            node.Add("m_AreaSize", AreaSize.ExportYAML(container));
            node.Add("m_BounceIntensity", BounceIntensity);
            node.Add("m_ColorTemperature", ColorTemperature);
            node.Add("m_UseColorTemperature", UseColorTemperature);
#warning ???
            node.Add("m_ShadowRadius", 0);
            node.Add("m_ShadowAngle", 0);
            return(node);
        }
Пример #3
0
        public override IEnumerable <Object> FetchDependencies(ISerializedFile file, bool isLog = false)
        {
            foreach (Object asset in base.FetchDependencies(file, isLog))
            {
                yield return(asset);
            }

            yield return(Cookie.FetchDependency(file, isLog, ToLogString, CookieName));

            yield return(Flare.FetchDependency(file, isLog, ToLogString, FlareName));
        }
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            node.Add(TypeName, (int)Type);
            if (HasShape(container.ExportVersion))
            {
                node.Add(ShapeName, (int)Shape);
            }
            node.Add(ColorName, Color.ExportYAML(container));
            node.Add(IntensityName, Intensity);
            node.Add(RangeName, Range);
            node.Add(SpotAngleName, SpotAngle);
            if (HasInnerSpotAngle(container.ExportVersion))
            {
                node.Add(InnerSpotAngleName, InnerSpotAngle);
            }
            node.Add(CookieSizeName, CookieSize);
            node.Add(ShadowsName, Shadows.ExportYAML(container));
            node.Add(CookieName, Cookie.ExportYAML(container));
            node.Add(DrawHaloName, DrawHalo);
            if (HasBakingOutput(container.ExportVersion, container.ExportFlags))
            {
                node.Add(BakingOutputName, BakingOutput.ExportYAML(container));
            }
            node.Add(FlareName, Flare.ExportYAML(container));
            node.Add(RenderModeName, (int)RenderMode);
            node.Add(CullingMaskName, CullingMask.ExportYAML(container));
            if (HasRenderingLayerMask(container.ExportVersion))
            {
                node.Add(RenderingLayerMaskName, RenderingLayerMask);
            }
            node.Add(LightmappingName, (int)Lightmapping);
            node.Add(AreaSizeName, AreaSize.ExportYAML(container));
            node.Add(BounceIntensityName, BounceIntensity);
            node.Add(ColorTemperatureName, ColorTemperature);
            node.Add(UseColorTemperatureName, UseColorTemperature);
            if (HasBoundingSphereOverride(container.ExportVersion))
            {
                node.Add(BoundingSphereOverrideName, BoundingSphereOverride.ExportYAML(container));
                node.Add(UseBoundingSphereOverrideName, UseBoundingSphereOverride);
            }
            node.Add(ShadowRadiusName, GetShadowRadius(container.Version, container.Flags));
            node.Add(ShadowAngleName, GetShadowAngle(container.Version, container.Flags));
            return(node);
        }
Пример #5
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();
            }
            if (IsReadUseColorTemperature(reader.Version))
            {
                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
        }