Example #1
0
        public override void Parse(AssetsReader reader)
        {
            base.ParseBase(reader);
            IsEnabled            = reader.ReadBoolean();
            CastShadows          = reader.ReadByte();
            ReceiveShadows       = reader.ReadByte();
            DynamicOcclude       = reader.ReadByte();
            MotionVectors        = reader.ReadByte();
            LightProbeUsage      = reader.ReadByte();
            ReflectionProbeUsage = reader.ReadByte();
            reader.AlignTo(4);
            RenderingLayerMask = reader.ReadUInt32();
            if (ObjectInfo.ParentFile.Metadata.VersionGte("2018.3"))
            {
                RendererPriority = reader.ReadInt32();
            }
            LightmapIndex               = reader.ReadUInt16();
            LightmapIndexDynamic        = reader.ReadUInt16();
            LightmapTilingOffset        = new Vector4F(reader);
            LightmapTilingOffsetDynamic = new Vector4F(reader);
            Materials       = reader.ReadArrayOf(r => (ISmartPtr <MaterialObject>)SmartPtr <MaterialObject> .Read(ObjectInfo.ParentFile, this, r));
            StaticBatchInfo = new StaticBatchInfo(reader);
            StaticBatchRoot = SmartPtr <Transform> .Read(ObjectInfo.ParentFile, this, reader);

            ProbeAnchor = SmartPtr <Transform> .Read(ObjectInfo.ParentFile, this, reader);

            LightProbeVolumeOverride = SmartPtr <GameObject> .Read(ObjectInfo.ParentFile, this, reader);

            SortingLayerID          = reader.ReadInt32();
            SortingLayer            = reader.ReadInt16();
            SortingOrder            = reader.ReadInt16();
            AdditionalVertexStreams = SmartPtr <MeshObject> .Read(ObjectInfo.ParentFile, this, reader);
        }
Example #2
0
 protected override void WriteObject(AssetsWriter writer)
 {
     base.WriteBase(writer);
     writer.Write(IsEnabled);
     writer.Write(CastShadows);
     writer.Write(ReceiveShadows);
     writer.Write(DynamicOcclude);
     writer.Write(MotionVectors);
     writer.Write(LightProbeUsage);
     writer.Write(ReflectionProbeUsage);
     writer.AlignTo(4);
     writer.Write(RenderingLayerMask);
     if (ObjectInfo.ParentFile.Metadata.VersionGte("2018.3"))
     {
         writer.Write(RendererPriority);
     }
     writer.Write(LightmapIndex);
     writer.Write(LightmapIndexDynamic);
     LightmapTilingOffset.Write(writer);
     LightmapTilingOffsetDynamic.Write(writer);
     writer.WriteArrayOf(Materials, (o, w) => o.Write(w));
     StaticBatchInfo.Write(writer);
     StaticBatchRoot.Write(writer);
     ProbeAnchor.Write(writer);
     LightProbeVolumeOverride.Write(writer);
     writer.Write(SortingLayerID);
     writer.Write(SortingLayer);
     writer.Write(SortingOrder);
     AdditionalVertexStreams.Write(writer);
 }