Пример #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(ModeName, (int)Mode);
            node.Add(RefreshModeName, (int)RefreshMode);
            node.Add(TimeSlicingModeName, (int)TimeSlicingMode);
            node.Add(ResolutionName, Resolution);
            node.Add(UpdateFrequencyName, UpdateFrequency);
            node.Add(BoxSizeName, BoxSize.ExportYAML(container));
            node.Add(BoxOffsetName, BoxOffset.ExportYAML(container));
            node.Add(NearClipName, NearClip);
            node.Add(FarClipName, FarClip);
            node.Add(ShadowDistanceName, ShadowDistance);
            node.Add(ClearFlagsName, (uint)ClearFlags);
            node.Add(BackGroundColorName, BackGroundColor.ExportYAML(container));
            node.Add(CullingMaskName, CullingMask.ExportYAML(container));
            node.Add(IntensityMultiplierName, IntensityMultiplier);
            node.Add(BlendDistanceName, BlendDistance);
            node.Add(HDRName, HDR);
            node.Add(BoxProjectionName, BoxProjection);
            node.Add(RenderDynamicObjectsName, RenderDynamicObjects);
            node.Add(UseOcclusionCullingName, UseOcclusionCulling);
            node.Add(ImportanceName, Importance);
            node.Add(CustomBakedTextureName, CustomBakedTexture.ExportYAML(container));
            if (IsReadBakedTexture(container.ExportVersion, container.ExportFlags))
            {
                node.Add(BakedTextureName, BakedTextureTexture.ExportYAML(container));
            }
            return(node);
        }
Пример #2
0
        public override IEnumerable <Object> FetchDependencies(ISerializedFile file, bool isLog = false)
        {
            foreach (Object asset in base.FetchDependencies(file, isLog))
            {
                yield return(asset);
            }

            yield return(CustomBakedTexture.FetchDependency(file, isLog, ToLogString, CustomBakedTextureName));
        }
Пример #3
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            Type = (ReflectionProbeType)reader.ReadInt32();
            Mode = (ReflectionProbeMode)reader.ReadInt32();
            if (IsReadRefreshMode(reader.Version))
            {
                RefreshMode     = (ReflectionProbeRefreshMode)reader.ReadInt32();
                TimeSlicingMode = (ReflectionProbeTimeSlicingMode)reader.ReadInt32();
            }
            Resolution      = reader.ReadInt32();
            UpdateFrequency = reader.ReadInt32();
            if (IsReadImportance(reader.Version))
            {
                if (IsReadImportanceFirst(reader.Version))
                {
                    Importance = reader.ReadInt16();
                }
            }
            BoxSize.Read(reader);
            BoxOffset.Read(reader);
            NearClip       = reader.ReadSingle();
            FarClip        = reader.ReadSingle();
            ShadowDistance = reader.ReadSingle();
            ClearFlags     = (ReflectionProbeClearFlags)reader.ReadUInt32();
            BackGroundColor.Read(reader);
            CullingMask.Read(reader);
            IntensityMultiplier = reader.ReadSingle();
            if (IsReadBlendDistance(reader.Version))
            {
                BlendDistance = reader.ReadSingle();
            }
            if (IsReadBakedRenderPassCount(reader.Version))
            {
                BakedRenderPassCount = reader.ReadUInt32();
                UseMipMap            = reader.ReadBoolean();
            }
            HDR = reader.ReadBoolean();
            if (IsReadBoxProjection(reader.Version))
            {
                BoxProjection        = reader.ReadBoolean();
                RenderDynamicObjects = reader.ReadBoolean();
                UseOcclusionCulling  = reader.ReadBoolean();
            }
            if (IsReadImportance(reader.Version))
            {
                if (!IsReadImportanceFirst(reader.Version))
                {
                    Importance = reader.ReadInt16();
                }
            }
            reader.AlignStream(AlignType.Align4);

            if (IsReadCustomBakedTexture(reader.Version))
            {
                CustomBakedTexture.Read(reader);
            }
            if (IsReadBakedTexture(reader.Version, reader.Flags))
            {
                BakedTextureTexture.Read(reader);
            }
        }