コード例 #1
0
        public override void ParseObject(AssetsReader 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();
        }
コード例 #2
0
 protected override void WriteObject(AssetsWriter 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.WritePtr(w));
     StaticBatchInfo.Write(writer);
     StaticBatchRoot.WritePtr(writer);
     ProbeAnchor.WritePtr(writer);
     LightProbeVolumeOverride.WritePtr(writer);
     writer.Write(SortingLayerID);
     writer.Write(SortingLayer);
     writer.Write(SortingOrder);
 }