public override void Read(AssetReader reader) { base.Read(reader); RenderMode = IsModeShort(reader.Version) ? (ParticleSystemRenderMode)reader.ReadUInt16() : (ParticleSystemRenderMode)reader.ReadInt32(); if (IsSortModeFirst(reader.Version)) { SortMode = (ParticleSystemSortMode)reader.ReadUInt16(); } if (HasMinParticleSize(reader.Version)) { MinParticleSize = reader.ReadSingle(); } MaxParticleSize = reader.ReadSingle(); CameraVelocityScale = reader.ReadSingle(); VelocityScale = reader.ReadSingle(); LengthScale = reader.ReadSingle(); SortingFudge = reader.ReadSingle(); if (HasNormalDirection(reader.Version)) { NormalDirection = reader.ReadSingle(); } if (HasShadowBias(reader.Version)) { ShadowBias = reader.ReadSingle(); } if (!IsSortModeFirst(reader.Version)) { SortMode = (ParticleSystemSortMode)reader.ReadInt32(); } if (HasRenderAlignment(reader.Version)) { RenderAlignment = (ParticleSystemRenderSpace)reader.ReadInt32(); Pivot.Read(reader); } else { RenderAlignment = RenderMode == ParticleSystemRenderMode.Mesh ? ParticleSystemRenderSpace.Local : ParticleSystemRenderSpace.View; } if (HasFlip(reader.Version)) { Flip.Read(reader); } if (HasUseCustomVertexStreams(reader.Version)) { UseCustomVertexStreams = reader.ReadBoolean(); if (HasEnableGPUInstancing(reader.Version)) { EnableGPUInstancing = reader.ReadBoolean(); } if (HasApplyActiveColorSpace(reader.Version)) { ApplyActiveColorSpace = reader.ReadBoolean(); } if (HasAllowRoll(reader.Version)) { AllowRoll = reader.ReadBoolean(); } reader.AlignStream(); } if (HasVertexStreamMask(reader.Version)) { int vertexStreamMask = reader.ReadInt32(); List <byte> vertexStreams = new List <byte>(8); for (byte i = 0; i < 8; i++) { if ((vertexStreamMask & (1 << i)) != 0) { vertexStreams.Add(i); } } VertexStreams = vertexStreams.ToArray(); } if (HasVertexStreams(reader.Version)) { VertexStreams = reader.ReadByteArray(); reader.AlignStream(); } Mesh.Read(reader); if (HasMeshes(reader.Version)) { Mesh1.Read(reader); Mesh2.Read(reader); Mesh3.Read(reader); } if (HasMaskInteraction(reader.Version)) { MaskInteraction = (SpriteMaskInteraction)reader.ReadInt32(); } }
public override void Read(AssetReader reader) { base.Read(reader); Enabled = reader.ReadBoolean(); if (IsAlign1(reader.Version)) { reader.AlignStream(AlignType.Align4); } CastShadows = (ShadowCastingMode)reader.ReadByte(); ReceiveShadows = reader.ReadByte(); if (IsReadDynamicOccludee(reader.Version)) { DynamicOccludee = reader.ReadByte(); } if (IsReadMotionVector(reader.Version)) { MotionVectors = (MotionVectorGenerationMode)reader.ReadByte(); LightProbeUsage = (LightProbeUsage)reader.ReadByte(); } if (IsReadReflectUsage(reader.Version)) { if (IsReadReflectUsageFirst(reader.Version)) { ReflectionProbeUsage = (ReflectionProbeUsage)reader.ReadByte(); } } if (IsAlign2(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadRenderingLayerMask(reader.Version)) { RenderingLayerMask = reader.ReadUInt32(); } if (IsReadRendererPriority(reader.Version)) { RendererPriority = reader.ReadInt32(); } if (IsReadLightmapIndex(reader.Version, reader.Flags)) { LightmapIndex = IsLightmapIndexShort(reader.Version) ? reader.ReadUInt16() : reader.ReadByte(); } if (IsReadLightmapIndexDynamic(reader.Version, reader.Flags)) { LightmapIndexDynamic = reader.ReadUInt16(); } if (IsReadMaterialFirst(reader.Version)) { m_materials = reader.ReadAssetArray <PPtr <Material> >(); } if (IsReadLightmapTilingOffset(reader.Version, reader.Flags)) { if (IsLightmapTilingOffsetV4(reader.Version)) { LightmapTilingOffset.Read(reader); } else { LightmapTilingOffset.Read3(reader); } } if (IsReadLightmapTilingOffsetDynamic(reader.Version, reader.Flags)) { LightmapTilingOffsetDynamic.Read(reader); } if (!IsReadMaterialFirst(reader.Version)) { m_materials = reader.ReadAssetArray <PPtr <Material> >(); } if (IsReadStaticBatchInfo(reader.Version)) { StaticBatchInfo.Read(reader); } else if (IsReadSubsetIndices(reader.Version)) { m_subsetIndices = reader.ReadUInt32Array(); } if (IsReadStaticBatchRoot(reader.Version)) { StaticBatchRoot.Read(reader); } if (IsReadUseLight(reader.Version)) { bool UseLightProbes = reader.ReadBoolean(); LightProbeUsage = UseLightProbes ? LightProbeUsage.BlendProbes : LightProbeUsage.Off; } if (IsReadUseReflectionProbes(reader.Version)) { bool UseReflectionProbes = reader.ReadBoolean(); ReflectionProbeUsage = UseReflectionProbes ? ReflectionProbeUsage.Simple : ReflectionProbeUsage.Off; } if (IsReadUseLight(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadReflectUsage(reader.Version)) { if (!IsReadReflectUsageFirst(reader.Version)) { ReflectionProbeUsage = (ReflectionProbeUsage)reader.ReadInt32(); } } if (IsReadProbeAnchor(reader.Version)) { ProbeAnchor.Read(reader); } if (IsReadLightOverride(reader.Version)) { LightProbeVolumeOverride.Read(reader); } #if UNIVERSAL if (IsReadScaleInLightmap(reader.Version, reader.Flags)) { ScaleInLightmap = reader.ReadSingle(); } if (IsReadReceiveGI(reader.Version, reader.Flags)) { ReceiveGI = (ReceiveGI)reader.ReadInt32(); } if (IsReadPreserveUVs(reader.Version, reader.Flags)) { PreserveUVs = reader.ReadBoolean(); } if (IsReadIgnoreNormalsForChartDetection(reader.Version, reader.Flags)) { IgnoreNormalsForChartDetection = reader.ReadBoolean(); } if (IsReadImportantGI(reader.Version, reader.Flags)) { ImportantGI = reader.ReadBoolean(); } if (IsReadSelectedWireframeHidden(reader.Version, reader.Flags)) { SelectedWireframeHidden = reader.ReadBoolean(); } if (IsReadStitchLightmapSeams(reader.Version, reader.Flags)) { StitchLightmapSeams = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); } if (IsReadSelectedEditorRenderState(reader.Version, reader.Flags)) { SelectedEditorRenderState = (EditorSelectedRenderState)reader.ReadInt32(); } if (IsReadMinimumChartSize(reader.Version, reader.Flags)) { MinimumChartSize = reader.ReadInt32(); } if (IsReadAutoUVMaxDistance(reader.Version, reader.Flags)) { AutoUVMaxDistance = reader.ReadSingle(); AutoUVMaxAngle = reader.ReadSingle(); LightmapParameters.Read(reader); } if (IsReadGIBackfaceCull(reader.Version, reader.Flags)) { GIBackfaceCull = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); } #endif if (IsAlign3(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadSortingLayerID(reader.Version)) { SortingLayerID = reader.ReadInt32(); } if (IsReadSortingLayer(reader.Version)) { SortingLayer = reader.ReadInt16(); } if (IsReadSortingOrder(reader.Version)) { SortingOrder = reader.ReadInt16(); } if (IsAlign4(reader.Version)) { reader.AlignStream(AlignType.Align4); } }
public override void Read(AssetReader reader) { base.Read(reader); ClearFlags = reader.ReadUInt32(); BackGroundColor.Read(reader); if (IsReadProjectionMatrixMode(reader.Version)) { ProjectionMatrixMode = (ProjectionMatrixMode)reader.ReadInt32(); SensorSize.Read(reader); LensShift.Read(reader); FocalLength = reader.ReadSingle(); } NormalizedViewPortRect.Read(reader); NearClipPlane = reader.ReadSingle(); FarClipPlane = reader.ReadSingle(); FieldOfView = reader.ReadSingle(); Orthographic = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); OrthographicSize = reader.ReadSingle(); Depth = reader.ReadSingle(); CullingMask.Read(reader); if (IsReadRenderingPath(reader.Version)) { RenderingPath = (RenderingPath)reader.ReadInt32(); } TargetTexture.Read(reader); if (IsReadTargetDisplay(reader.Version)) { TargetDisplay = reader.ReadInt32(); } if (IsReadTargetEye(reader.Version)) { TargetEye = (StereoTargetEyeMask)reader.ReadInt32(); } if (IsReadHDR(reader.Version)) { HDR = reader.ReadBoolean(); } if (IsReadAllowMSAA(reader.Version)) { AllowMSAA = reader.ReadBoolean(); } if (IsReadAllowDynamicResolution(reader.Version)) { AllowDynamicResolution = reader.ReadBoolean(); } if (IsReadForceIntoRT(reader.Version)) { ForceIntoRT = reader.ReadBoolean(); } if (IsReadOcclusionCulling(reader.Version)) { OcclusionCulling = reader.ReadBoolean(); } if (IsAlign(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadStereoConvergence(reader.Version)) { StereoConvergence = reader.ReadSingle(); StereoSeparation = reader.ReadSingle(); } if (IsReadStereoMirrorMode(reader.Version)) { StereoMirrorMode = reader.ReadBoolean(); } }
public override void Read(AssetReader reader) { base.Read(reader); if (HasLightProbesLegacy(reader.Version)) { LightProbesLegacy.Read(reader); } if (HasEnlightenSceneMapping(reader.Version, reader.Flags)) { EnlightenSceneMapping.Read(reader); } if (HasGIWorkflowMode(reader.Version, reader.Flags)) { GIWorkflowMode = (GIWorkflowMode)reader.ReadInt32(); } if (HasLightProbes(reader.Version, reader.Flags)) { LightProbes.Read(reader); } if (HasLightmaps(reader.Version, reader.Flags)) { Lightmaps = reader.ReadAssetArray <LightmapData>(); } if (IsAlign1(reader.Version, reader.Flags)) { reader.AlignStream(); } if (HasLightmapsModeLegacy(reader.Version)) { LightmapsModeLegacy = (LightmapsMode)reader.ReadInt32(); } if (HasLightmapsMode(reader.Version, reader.Flags)) { LightmapsMode = (LightmapsMode)reader.ReadInt32(); } if (HasBakedColorSpace(reader.Version)) { BakedColorSpace = (ColorSpace)reader.ReadInt32(); } if (HasUseDualLightmapsInForward(reader.Version)) { UseDualLightmapsInForward = reader.ReadBoolean(); } if (IsAlign2(reader.Version)) { reader.AlignStream(); } if (HasGISettings(reader.Version)) { GISettings.Read(reader); } #if UNIVERSAL if (HasLightmapEditorSettings(reader.Version, reader.Flags)) { LightmapEditorSettings.Read(reader); } if (HasLightingDataAsset(reader.Version, reader.Flags)) { LightingDataAsset.Read(reader); } #endif if (HasRuntimeCPUUsage(reader.Version)) { RuntimeCPUUsage = reader.ReadInt32(); } if (HasUseShadowmask(reader.Version)) { if (IsBoolShadowmask(reader.Version)) { UseShadowmask = reader.ReadBoolean(); } else { ShadowMaskMode = reader.ReadInt32(); } } }
public override void Read(AssetReader reader) { base.Read(reader); if (IsReadMode(reader.Version)) { Mode = (ParticleSystemAnimationMode)reader.ReadInt32(); } if (IsReadTimeMode(reader.Version)) { TimeMode = (ParticleSystemAnimationTimeMode)reader.ReadInt32(); FPS = reader.ReadSingle(); } FrameOverTime.Read(reader); if (IsReadStartFrame(reader.Version)) { StartFrame.Read(reader); } if (IsReadSpeedRange(reader.Version)) { SpeedRange.Read(reader); } TilesX = reader.ReadInt32(); TilesY = reader.ReadInt32(); AnimationType = (ParticleSystemAnimationType)reader.ReadInt32(); RowIndex = reader.ReadInt32(); Cycles = reader.ReadSingle(); if (IsReadUvChannelMask(reader.Version)) { UvChannelMask = reader.ReadInt32(); } if (IsReadFlipU(reader.Version)) { if (IsReadFlipUFirst(reader.Version)) { FlipU = reader.ReadSingle(); FlipV = reader.ReadSingle(); } } if (IsReadRowMode(reader.Version)) { RowMode = (ParticleSystemAnimationRowMode)reader.ReadInt32(); } else { bool RandomRow = reader.ReadBoolean(); RowMode = RandomRow ? ParticleSystemAnimationRowMode.Random : ParticleSystemAnimationRowMode.Custom; reader.AlignStream(AlignType.Align4); } if (IsReadSprites(reader.Version)) { m_sprites = reader.ReadAssetArray <SpriteData>(); } if (IsReadFlipU(reader.Version)) { if (!IsReadFlipUFirst(reader.Version)) { FlipU = reader.ReadSingle(); FlipV = reader.ReadSingle(); } } }
public void Read(AssetReader reader) { DeltaPose.Read(reader); StartX.Read(reader); if (IsReadStopX(reader.Version)) { StopX.Read(reader); } LeftFootStartX.Read(reader); RightFootStartX.Read(reader); if (IsReadMotion(reader.Version)) { MotionStartX.Read(reader); MotionStopX.Read(reader); } if (IsVector3(reader.Version)) { AverageSpeed.Read3(reader); } else { AverageSpeed.Read(reader); } Clip.Read(reader); StartTime = reader.ReadSingle(); StopTime = reader.ReadSingle(); OrientationOffsetY = reader.ReadSingle(); Level = reader.ReadSingle(); CycleOffset = reader.ReadSingle(); AverageAngularSpeed = reader.ReadSingle(); m_indexArray = reader.ReadInt32Array(); if (IsReadAdditionalCurveIndexArray(reader.Version)) { m_additionalCurveIndexArray = reader.ReadInt32Array(); } m_valueArrayDelta = reader.ReadAssetArray <ValueDelta>(); if (IsReadValueArrayReferencePose(reader.Version)) { m_valueArrayReferencePose = reader.ReadSingleArray(); } Mirror = reader.ReadBoolean(); if (IsReadLoopTime(reader.Version)) { LoopTime = reader.ReadBoolean(); } LoopBlend = reader.ReadBoolean(); LoopBlendOrientation = reader.ReadBoolean(); LoopBlendPositionY = reader.ReadBoolean(); LoopBlendPositionXZ = reader.ReadBoolean(); if (IsReadStartAtOrigin(reader.Version)) { StartAtOrigin = reader.ReadBoolean(); } KeepOriginalOrientation = reader.ReadBoolean(); KeepOriginalPositionY = reader.ReadBoolean(); KeepOriginalPositionXZ = reader.ReadBoolean(); HeightFromFeet = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); }
public override void Read(AssetReader reader) { if (IsSerialized(reader.Version)) { ReadNamedObject(reader); ParsedForm.Read(reader); Platforms = reader.ReadArray((t) => (GPUPlatform)t); uint[] offsets = reader.ReadUInt32Array(); uint[] compressedLengths = reader.ReadUInt32Array(); uint[] decompressedLengths = reader.ReadUInt32Array(); byte[] compressedBlob = reader.ReadByteArray(); reader.AlignStream(); SubProgramBlobs = new ShaderSubProgramBlob[Platforms.Length]; using (MemoryStream memStream = new MemoryStream(compressedBlob)) { for (int i = 0; i < Platforms.Length; i++) { uint offset = offsets[i]; uint compressedLength = compressedLengths[i]; uint decompressedLength = decompressedLengths[i]; memStream.Position = offset; byte[] decompressedBuffer = new byte[decompressedLength]; using (Lz4DecodeStream lz4Stream = new Lz4DecodeStream(memStream, (int)compressedLength)) { lz4Stream.ReadBuffer(decompressedBuffer, 0, decompressedBuffer.Length); } using (MemoryStream blobMem = new MemoryStream(decompressedBuffer)) { using (AssetReader blobReader = new AssetReader(blobMem, EndianType.LittleEndian, reader.Version, reader.Platform, reader.Flags)) { ShaderSubProgramBlob blob = new ShaderSubProgramBlob(); blob.Read(blobReader); SubProgramBlobs[i] = blob; } } } } } else { base.Read(reader); if (IsEncoded(reader.Version)) { uint decompressedSize = reader.ReadUInt32(); int comressedSize = reader.ReadInt32(); if (comressedSize > 0 && decompressedSize > 0) { byte[] subProgramBlob = new byte[comressedSize]; reader.ReadBuffer(subProgramBlob, 0, comressedSize); byte[] decompressedBuffer = new byte[decompressedSize]; using (MemoryStream memStream = new MemoryStream(subProgramBlob)) { using (Lz4DecodeStream lz4Stream = new Lz4DecodeStream(memStream)) { lz4Stream.ReadBuffer(decompressedBuffer, 0, decompressedBuffer.Length); } } using (MemoryStream memStream = new MemoryStream(decompressedBuffer)) { using (AssetReader blobReader = new AssetReader(memStream, EndianType.LittleEndian, reader.Version, reader.Platform, reader.Flags)) { SubProgramBlob.Read(blobReader); } } } reader.AlignStream(); } if (HasFallback(reader.Version)) { Fallback.Read(reader); } if (HasDefaultProperties(reader.Version)) { DefaultProperties.Read(reader); } if (HasStaticProperties(reader.Version)) { StaticProperties.Read(reader); } } if (HasDependencies(reader.Version)) { Dependencies = reader.ReadAssetArray <PPtr <Shader> >(); } if (HasNonModifiableTextures(reader.Version)) { NonModifiableTextures = new Dictionary <string, PPtr <Texture> >(); NonModifiableTextures.Read(reader); } if (HasShaderIsBaked(reader.Version)) { ShaderIsBaked = reader.ReadBoolean(); reader.AlignStream(); } #if UNIVERSAL if (HasErrors(reader.Version, reader.Flags)) { Errors = reader.ReadAssetArray <ShaderError>(); } if (HasDefaultTextures(reader.Version, reader.Flags)) { DefaultTextures = new Dictionary <string, PPtr <Texture> >(); DefaultTextures.Read(reader); } if (HasCompileInfo(reader.Version, reader.Flags)) { CompileInfo.Read(reader); } #endif }
public override void Read(AssetReader reader) { base.Read(reader); RenderMode = IsModeShort(reader.Version) ? (ParticleSystemRenderMode)reader.ReadUInt16() : (ParticleSystemRenderMode)reader.ReadInt32(); if (IsSortModeFirst(reader.Version)) { SortMode = (ParticleSystemSortMode)reader.ReadUInt16(); } if (IsReadMinParticleSize(reader.Version)) { MinParticleSize = reader.ReadSingle(); } MaxParticleSize = reader.ReadSingle(); CameraVelocityScale = reader.ReadSingle(); VelocityScale = reader.ReadSingle(); LengthScale = reader.ReadSingle(); SortingFudge = reader.ReadSingle(); if (IsReadNormalDirection(reader.Version)) { NormalDirection = reader.ReadSingle(); } if (!IsSortModeFirst(reader.Version)) { SortMode = (ParticleSystemSortMode)reader.ReadInt32(); } if (IsReadRenderAlignment(reader.Version)) { RenderAlignment = (ParticleSystemRenderSpace)reader.ReadInt32(); Pivot.Read(reader); } else { RenderAlignment = RenderMode == ParticleSystemRenderMode.Mesh ? ParticleSystemRenderSpace.Local : ParticleSystemRenderSpace.View; } if (IsReadUseCustomVertexStreams(reader.Version)) { UseCustomVertexStreams = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); if (IsReadVertexStreamMask(reader.Version)) { int vertexStreamMask = reader.ReadInt32(); List <byte> vertexStreams = new List <byte>(8); for (byte i = 0; i < 8; i++) { if ((vertexStreamMask & (1 << i)) != 0) { vertexStreams.Add(i); } } m_vertexStreams = vertexStreams.ToArray(); } else { m_vertexStreams = reader.ReadByteArray(); reader.AlignStream(AlignType.Align4); } } Mesh.Read(reader); if (IsReadMeshes(reader.Version)) { Mesh1.Read(reader); Mesh2.Read(reader); Mesh3.Read(reader); } if (IsReadMaskInteraction(reader.Version)) { MaskInteraction = (SpriteMaskInteraction)reader.ReadInt32(); } }
public override void Read(AssetReader reader) { base.Read(reader); Volume = reader.ReadSingle(); if (IsReadRolloffScale(reader.Version)) { if (IsReadRolloffScaleFirst(reader.Version)) { RolloffScale = reader.ReadSingle(); } } if (IsReadSpeedOfSound(reader.Version)) { SpeedOfSound = reader.ReadSingle(); } DopplerFactor = reader.ReadSingle(); if (IsReadDefaultSpeakerMode(reader.Version)) { DefaultSpeakerMode = (AudioSpeakerMode)reader.ReadInt32(); } if (IsReadSampleRate(reader.Version)) { SampleRate = reader.ReadInt32(); } if (IsReadRolloffScale(reader.Version)) { if (!IsReadRolloffScaleFirst(reader.Version)) { RolloffScale = reader.ReadSingle(); } } if (IsReadDSPBufferSize(reader.Version)) { DSPBufferSize = reader.ReadInt32(); } if (IsReadVirtualVoiceCount(reader.Version)) { VirtualVoiceCount = reader.ReadInt32(); RealVoiceCount = reader.ReadInt32(); } if (IsReadSpatializerPlugin(reader.Version)) { SpatializerPlugin = reader.ReadString(); } if (IsReadAmbisonicDecoderPlugin(reader.Version)) { AmbisonicDecoderPlugin = reader.ReadString(); } if (IsReadDisableAudio(reader.Version)) { DisableAudio = reader.ReadBoolean(); } if (IsReadVirtualizeEffects(reader.Version)) { VirtualizeEffects = reader.ReadBoolean(); } if (IsAlign(reader.Version)) { reader.AlignStream(AlignType.Align4); } }
public override void Read(AssetReader reader) { base.Read(reader); if (HasLoadType(reader.Version)) { LoadType = (AudioClipLoadType)reader.ReadInt32(); Channels = reader.ReadInt32(); Frequency = reader.ReadInt32(); BitsPerSample = reader.ReadInt32(); Length = reader.ReadSingle(); if (HasIsTrackerFormat(reader.Version)) { IsTrackerFormat = reader.ReadBoolean(); } if (HasAmbisonic(reader.Version)) { Ambisonic = reader.ReadBoolean(); } if (IsAlignTrackerFormat(reader.Version)) { reader.AlignStream(); } if (HasAudioClipFlags(reader.Version)) { AudioClipFlags = reader.ReadInt32(); } if (IsFSBResourceFirst(reader.Version)) { FSBResource.Read(reader); } SubsoundIndex = reader.ReadInt32(); PreloadAudioData = reader.ReadBoolean(); if (HasLoadInBackground(reader.Version)) { LoadInBackground = reader.ReadBoolean(); } Legacy3D = reader.ReadBoolean(); reader.AlignStream(); if (!IsFSBResourceFirst(reader.Version)) { FSBResource.Read(reader); } if (HasType(reader.Version)) { Type = (FMODSoundType)reader.ReadInt32(); } if (HasCompressionFormat(reader.Version)) { CompressionFormat = (AudioCompressionFormat)reader.ReadInt32(); } reader.AlignStream(); #if UNIVERSAL if (HasEditorResource(reader.Flags)) { EditorResource.Read(reader); if (HasCompressionFormat(reader.Version)) { EditorCompressionFormat = (AudioCompressionFormat)reader.ReadInt32(); } } #endif } else { int decompressionOrder = GetDecompressOnLoadOrder(reader.Version); if (decompressionOrder == 1) { DecompressOnLoad = reader.ReadBoolean(); } Format = (FMODSoundFormat)reader.ReadInt32(); if (HasType(reader.Version)) { Type = (FMODSoundType)reader.ReadInt32(); } if (HasLength(reader.Version)) { Length = reader.ReadSingle(); Frequency = reader.ReadInt32(); Size = reader.ReadInt32(); } if (decompressionOrder == 2) { DecompressOnLoad = reader.ReadBoolean(); } if (Has3D(reader.Version)) { Legacy3D = reader.ReadBoolean(); } if (HasUseHardware(reader.Version)) { UseHardware = reader.ReadBoolean(); } if (IsAlignBools(reader.Version)) { reader.AlignStream(); } if (IsStreamInt32(reader.Version)) { LoadType = (AudioClipLoadType)reader.ReadInt32(); } if (HasStreamingInfo(reader.Version)) { bool isInnerData = LoadType == AudioClipLoadType.Streaming ? File.Collection.FindResourceFile(StreamingFileName) == null : true; if (isInnerData) { AudioData = reader.ReadByteArray(); reader.AlignStream(); } else { StreamingInfo.Read(reader, StreamingFileName); } } else { AudioData = reader.ReadByteArray(); if (IsAlignAudioData(reader.Version)) { reader.AlignStream(); } } if (decompressionOrder == 3) { DecompressOnLoad = reader.ReadBoolean(); } if (HasStream(reader.Version)) { if (!IsStreamInt32(reader.Version)) { LoadType = reader.ReadBoolean() ? AudioClipLoadType.CompressedInMemory : AudioClipLoadType.DecompressOnLoad; } } } }
public void Read(AssetReader reader) { Name = reader.ReadString(); Normal.Read(reader); Hover.Read(reader); Active.Read(reader); Focused.Read(reader); OnNormal.Read(reader); OnHover.Read(reader); OnActive.Read(reader); OnFocused.Read(reader); Border.Read(reader); if (IsBuiltIn(reader.Version)) { Margin.Read(reader); Padding.Read(reader); } else { Padding.Read(reader); Margin.Read(reader); } Overflow.Read(reader); Font.Read(reader); if (IsBuiltIn(reader.Version)) { FontSize = reader.ReadInt32(); FontStyle = (FontStyle)reader.ReadInt32(); Alignment = (TextAnchor)reader.ReadInt32(); WordWrap = reader.ReadBoolean(); RichText = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); TextClipping = (TextClipping)reader.ReadInt32(); ImagePosition = (ImagePosition)reader.ReadInt32(); ContentOffset.Read(reader); FixedWidth = reader.ReadSingle(); FixedHeight = reader.ReadSingle(); StretchWidth = reader.ReadBoolean(); StretchHeight = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); } else { ImagePosition = (ImagePosition)reader.ReadInt32(); Alignment = (TextAnchor)reader.ReadInt32(); WordWrap = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); TextClipping = (TextClipping)reader.ReadInt32(); ContentOffset.Read(reader); ClipOffset.Read(reader); FixedWidth = reader.ReadSingle(); FixedHeight = reader.ReadSingle(); if (IsReadFontSize(reader.Version)) { FontSize = reader.ReadInt32(); FontStyle = (FontStyle)reader.ReadInt32(); } StretchWidth = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); StretchHeight = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); } }
public virtual void Read(AssetReader reader) { Enabled = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); }
public override void Read(AssetReader reader) { ReadBase(reader); #if UNIVERSAL if (IsReadScript(reader.Version, reader.Flags)) { Script = reader.ReadByteArray(); reader.AlignStream(AlignType.Align4); } if (IsReadDefaultProperties(reader.Version, reader.Flags)) { DefaultProperties.Read(reader); } if (IsReadDefaultReferences(reader.Version, reader.Flags)) { m_defaultReferences = new Dictionary <string, PPtr <Object> >(); m_defaultReferences.Read(reader); } if (IsReadIcon(reader.Version, reader.Flags)) { Icon.Read(reader); } if (IsReadEditorGraphData(reader.Version, reader.Flags)) { EditorGraphData.Read(reader); } #endif if (IsReadExecutionOrder(reader.Version)) { ExecutionOrder = reader.ReadInt32(); } if (IsReadPropertiesHash(reader.Version, reader.Flags)) { if (IsUInt32Hash(reader.Version)) { uint hash = reader.ReadUInt32(); PropertiesHash = new Hash128(hash); } else { PropertiesHash.Read(reader); } } if (IsReadPathName(reader.Version)) { PathName = reader.ReadString(); } ClassName = reader.ReadString(); if (IsReadNamespace(reader.Version)) { Namespace = reader.ReadString(); } if (IsReadAssemblyName(reader.Version, reader.Flags)) { AssemblyNameOrigin = reader.ReadString(); AssemblyName = FilenameUtils.FixAssemblyName(AssemblyNameOrigin); } if (IsReadIsEditorScript(reader.Version)) { IsEditorScript = reader.ReadBoolean(); } }
public override void Read(AssetReader reader) { base.Read(reader); if (IsReadClassIDToTrack(reader.Version)) { m_classIDToTrack = new Dictionary <int, PPtr <BaseAnimationTrack> >(); m_classIDToTrack.Read(reader); m_childTracks = reader.ReadArray <ChildTrack>(); } if (IsReadAnimationType(reader.Version)) { AnimationType = (AnimationType)reader.ReadInt32(); } if (IsReadLegacy(reader.Version)) { Legacy = reader.ReadBoolean(); } if (IsReadCompressed(reader.Version)) { Compressed = reader.ReadBoolean(); } if (IsReadUseHightQualityCurve(reader.Version)) { UseHightQualityCurve = reader.ReadBoolean(); } if (IsAlignCompressed(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadCurves(reader.Version)) { m_rotationCurves = reader.ReadArray <QuaternionCurve>(); } if (IsReadCompressedRotationCurves(reader.Version)) { m_compressedRotationCurves = reader.ReadArray <CompressedAnimationCurve>(); } if (IsReadEulerCurves(reader.Version)) { m_eulerCurves = reader.ReadArray <Vector3Curve>(); } if (IsReadCurves(reader.Version)) { m_positionCurves = reader.ReadArray <Vector3Curve>(); m_scaleCurves = reader.ReadArray <Vector3Curve>(); m_floatCurves = reader.ReadArray <FloatCurve>(); } if (IsReadPPtrCurves(reader.Version)) { m_PPtrCurves = reader.ReadArray <PPtrCurve>(); } if (IsReadSampleRate(reader.Version)) { SampleRate = reader.ReadSingle(); } if (IsReadWrapMode(reader.Version)) { WrapMode = (WrapMode)reader.ReadInt32(); } if (IsReadBounds(reader.Version)) { Bounds.Read(reader); } if (IsReadMuscleClipSize(reader.Version)) { MuscleClipSize = reader.ReadUInt32(); MuscleClip.Read(reader); } if (IsReadClipBindingConstant(reader.Version)) { ClipBindingConstant.Read(reader); } if (IsReadEvents(reader.Version)) { m_events = reader.ReadArray <AnimationEvent>(); } if (IsAlign(reader.Version)) { reader.AlignStream(AlignType.Align4); } }
public override void Read(AssetReader reader) { base.Read(reader); if (IsReadLoadType(reader.Version)) { LoadType = (AudioClipLoadType)reader.ReadInt32(); Channels = reader.ReadInt32(); Frequency = reader.ReadInt32(); BitsPerSample = reader.ReadInt32(); Length = reader.ReadSingle(); if (IsReadIsTrackerFormat(reader.Version)) { IsTrackerFormat = reader.ReadBoolean(); } if (IsReadAmbisonic(reader.Version)) { Ambisonic = reader.ReadBoolean(); } if (IsAlignTrackerFormat(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadAudioClipFlags(reader.Version)) { AudioClipFlags = reader.ReadInt32(); } if (IsReadFSBResourceFirst(reader.Version)) { FSBResource.Read(reader); } SubsoundIndex = reader.ReadInt32(); PreloadAudioData = reader.ReadBoolean(); LoadInBackground = reader.ReadBoolean(); Legacy3D = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); if (!IsReadFSBResourceFirst(reader.Version)) { FSBResource.Read(reader); } if (IsReadType(reader.Version)) { Type = (FMODSoundType)reader.ReadInt32(); } if (IsReadCompressionFormat(reader.Version)) { CompressionFormat = (AudioCompressionFormat)reader.ReadInt32(); } reader.AlignStream(AlignType.Align4); #if UNIVERSAL if (IsReadEditorResource(reader.Flags)) { EditorResource.Read(reader); if (IsReadCompressionFormat(reader.Version)) { EditorCompressionFormat = (AudioCompressionFormat)reader.ReadInt32(); } } #endif } else { if (IsReadDecompressOnLoadFirst(reader.Version)) { DecompressOnLoad = reader.ReadBoolean(); } Format = (FMODSoundFormat)reader.ReadInt32(); if (IsReadType(reader.Version)) { Type = (FMODSoundType)reader.ReadInt32(); } if (IsReadLength(reader.Version)) { Length = reader.ReadSingle(); Frequency = reader.ReadInt32(); Size = reader.ReadInt32(); } if (IsReadDecompressOnLoadSecond(reader.Version)) { DecompressOnLoad = reader.ReadBoolean(); } if (IsRead3D(reader.Version)) { Legacy3D = reader.ReadBoolean(); } if (IsReadUseHardware(reader.Version)) { UseHardware = reader.ReadBoolean(); } if (IsAlignBools(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsStreamInt32(reader.Version)) { LoadType = (AudioClipLoadType)reader.ReadInt32(); } if (IsReadStreamingInfo(reader.Version)) { bool isInnerData = true; if (LoadType == AudioClipLoadType.Streaming) { using (ResourcesFile res = File.Collection.FindResourcesFile(File, StreamingFileName)) { isInnerData = res == null; } } if (isInnerData) { m_audioData = reader.ReadByteArray(); reader.AlignStream(AlignType.Align4); } else { StreamingInfo.Read(reader, StreamingFileName); } } else { m_audioData = reader.ReadByteArray(); if (IsAlignAudioData(reader.Version)) { reader.AlignStream(AlignType.Align4); } } if (IsReadDecompressOnLoadThird(reader.Version)) { DecompressOnLoad = reader.ReadBoolean(); } if (IsReadStream(reader.Version)) { if (!IsStreamInt32(reader.Version)) { LoadType = reader.ReadBoolean() ? AudioClipLoadType.CompressedInMemory : AudioClipLoadType.DecompressOnLoad; } } } }
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 (IsReadInnerSpotAngle(reader.Version)) { InnerSpotAngle = 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, reader.Flags)) { BakingOutput.Read(reader); } Flare.Read(reader); RenderMode = (LightRenderMode)reader.ReadInt32(); if (IsReadCullingMask(reader.Version)) { CullingMask.Read(reader); } if (IsReadRenderingLayerMask(reader.Version)) { RenderingLayerMask = reader.ReadInt32(); } 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); } if (IsReadBoundingSphereOverride(reader.Version)) { BoundingSphereOverride.Read(reader); UseBoundingSphereOverride = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); } #if UNIVERSAL if (IsReadShadowRadius(reader.Version, reader.Flags)) { ShadowRadius = reader.ReadSingle(); ShadowAngle = reader.ReadSingle(); } #endif }
public override void Read(AssetReader reader) { base.Read(reader); TerrainData.Read(reader); TreeDistance = reader.ReadSingle(); TreeBillboardDistance = reader.ReadSingle(); TreeCrossFadeLength = reader.ReadSingle(); TreeMaximumFullLODCount = reader.ReadInt32(); DetailObjectDistance = reader.ReadSingle(); DetailObjectDensity = reader.ReadSingle(); HeightmapPixelError = reader.ReadSingle(); SplatMapDistance = reader.ReadSingle(); HeightmapMaximumLOD = reader.ReadInt32(); if (IsReadShadowCastingMode(reader.Version)) { ShadowCastingMode = (ShadowCastingMode)reader.ReadInt32(); } else { bool CastShadows = reader.ReadBoolean(); ShadowCastingMode = CastShadows ? ShadowCastingMode.TwoSided : ShadowCastingMode.Off; } if (IsReadDrawHeightmap(reader.Version)) { DrawHeightmap = reader.ReadBoolean(); } if (IsReadDrawInstanced(reader.Version)) { DrawInstanced = reader.ReadBoolean(); } DrawTreesAndFoliage = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); if (IsReadReflectionProbeUsage(reader.Version)) { ReflectionProbeUsage = (ReflectionProbeUsage)reader.ReadInt32(); } if (IsReadMaterialType(reader.Version)) { MaterialType = (MaterialType)reader.ReadInt32(); LegacySpecular.Read(reader); LegacyShininess = reader.ReadSingle(); } if (IsReadDefaultSmoothness(reader.Version)) { UseDefaultSmoothness = reader.ReadBoolean(); DefaultSmoothness = reader.ReadSingle(); } MaterialTemplate.Read(reader); if (IsReadLightmapIndex(reader.Flags)) { LightmapIndex = reader.ReadUInt16(); LightmapIndexDynamic = reader.ReadUInt16(); LightmapTilingOffset.Read(reader); LightmapTilingOffsetDynamic.Read(reader); } if (IsReadExplicitProbeSetHash(reader.Version, reader.Flags)) { ExplicitProbeSetHash.Read(reader); } if (IsReadBakeLightProbesForTrees(reader.Version)) { BakeLightProbesForTrees = reader.ReadBoolean(); } if (IsReadPreserveTreePrototypeLayers(reader.Version)) { PreserveTreePrototypeLayers = reader.ReadBoolean(); } if (IsReadDeringLightProbesForTrees(reader.Version, reader.Flags)) { DeringLightProbesForTrees = reader.ReadBoolean(); } if (IsAlign(reader.Version)) { reader.AlignStream(AlignType.Align4); } #if UNIVERSAL if (IsReadScaleInLightmap(reader.Flags)) { ScaleInLightmap = reader.ReadSingle(); LightmapParameters.Read(reader); } #endif if (IsReadDynamicUVST(reader.Version, reader.Flags)) { DynamicUVST.Read(reader); ChunkDynamicUVST.Read(reader); reader.AlignStream(AlignType.Align4); } if (IsReadGroupingID(reader.Version)) { GroupingID = reader.ReadInt32(); AllowAutoConnect = reader.ReadBoolean(); } }
public override void Read(AssetReader reader) { base.Read(reader); LengthInSec = reader.ReadSingle(); if (IsStartDelayFirst(reader.Version)) { if (IsReadStartDelaySingle(reader.Version)) { StartDelaySingle = reader.ReadSingle(); } else { StartDelay.Read(reader); } } SimulationSpeed = reader.ReadSingle(); if (IsReadStopAction(reader.Version)) { StopAction = reader.ReadInt32(); } if (IsRandomSeedFirst(reader.Version)) { RandomSeed = unchecked ((int)reader.ReadUInt32()); } Looping = reader.ReadBoolean(); Prewarm = reader.ReadBoolean(); PlayOnAwake = reader.ReadBoolean(); if (IsReadUseUnscaledTime(reader.Version)) { UseUnscaledTime = reader.ReadBoolean(); } if (IsMoveWithTransformBool(reader.Version)) { MoveWithTransform = reader.ReadBoolean() ? ParticleSystemSimulationSpace.Local : ParticleSystemSimulationSpace.World; } if (IsReadAutoRandomSeed(reader.Version)) { AutoRandomSeed = reader.ReadBoolean(); } if (IsReadUseRigidbodyForVelocity(reader.Version)) { UseRigidbodyForVelocity = reader.ReadBoolean(); } if (IsAlign(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (!IsStartDelayFirst(reader.Version)) { StartDelay.Read(reader); reader.AlignStream(AlignType.Align4); } if (!IsMoveWithTransformBool(reader.Version)) { MoveWithTransform = (ParticleSystemSimulationSpace)reader.ReadInt32(); reader.AlignStream(AlignType.Align4); } if (IsReadMoveWithCustomTransform(reader.Version)) { MoveWithCustomTransform.Read(reader); } if (IsReadScalingMode(reader.Version)) { ScalingMode = (ParticleSystemScalingMode)reader.ReadInt32(); } if (!IsRandomSeedFirst(reader.Version)) { RandomSeed = reader.ReadInt32(); } InitialModule.Read(reader); ShapeModule.Read(reader); EmissionModule.Read(reader); SizeModule.Read(reader); RotationModule.Read(reader); ColorModule.Read(reader); UVModule.Read(reader); VelocityModule.Read(reader); if (IsReadInheritVelocityModule(reader.Version)) { InheritVelocityModule.Read(reader); } ForceModule.Read(reader); if (IsReadExternalForcesModule(reader.Version)) { ExternalForcesModule.Read(reader); } ClampVelocityModule.Read(reader); if (IsReadNoiseModule(reader.Version)) { NoiseModule.Read(reader); } SizeBySpeedModule.Read(reader); RotationBySpeedModule.Read(reader); ColorBySpeedModule.Read(reader); CollisionModule.Read(reader); if (IsReadTriggerModule(reader.Version)) { TriggerModule.Read(reader); } SubModule.Read(reader); if (IsReadLightsModule(reader.Version)) { LightsModule.Read(reader); TrailModule.Read(reader); } if (IsReadCustomDataModule(reader.Version)) { CustomDataModule.Read(reader); } }
public void Read(AssetReader reader) { InProgressEnabled = reader.ReadBoolean(); reader.AlignStream(); }
public override void Read(AssetReader reader) { base.Read(reader); if (IsReadExternalVersionControl(reader.Version)) { ExternalVersionControl support = (ExternalVersionControl)reader.ReadInt32(); switch (support) { case ExternalVersionControl.AutoDetect: ExternalVersionControlSupport = "Auto detect"; break; case ExternalVersionControl.Disabled: ExternalVersionControlSupport = HiddenMeta; break; case ExternalVersionControl.Generic: case ExternalVersionControl.AssetServer: ExternalVersionControlSupport = VisibleMeta; break; case ExternalVersionControl.Subversion: case ExternalVersionControl.Perforce: ExternalVersionControlSupport = support.ToString(); break; default: ExternalVersionControlSupport = HiddenMeta; break; } } else { ExternalVersionControlSupport = reader.ReadString(); switch (ExternalVersionControlSupport) { case "Disabled": ExternalVersionControlSupport = HiddenMeta; break; case "Meta Files": case "Asset Server": ExternalVersionControlSupport = VisibleMeta; break; } } SerializationMode = (SerializationMode)reader.ReadInt32(); if (IsReadWebSecurityEmulationEnabled(reader.Version)) { WebSecurityEmulationEnabled = reader.ReadInt32(); WebSecurityEmulationHostUrl = reader.ReadString(); } reader.AlignStream(AlignType.Align4); if (IsReadLineEndingsForNewScripts(reader.Version)) { LineEndingsForNewScripts = (LineEndingsMode)reader.ReadInt32(); } if (IsReadDefaultBehaviorMode(reader.Version)) { DefaultBehaviorMode = (EditorBehaviorMode)reader.ReadInt32(); SpritePackerMode = (SpritePackerMode)reader.ReadInt32(); } if (IsReadSpritePackerPaddingPower(reader.Version)) { SpritePackerPaddingPower = reader.ReadInt32(); } if (IsReadEtcTextureCompressorBehavior(reader.Version)) { EtcTextureCompressorBehavior = reader.ReadInt32(); EtcTextureFastCompressor = reader.ReadInt32(); EtcTextureNormalCompressor = reader.ReadInt32(); EtcTextureBestCompressor = reader.ReadInt32(); } if (IsReadProjectGenerationIncludedExtensions(reader.Version)) { ProjectGenerationIncludedExtensions = reader.ReadString(); ProjectGenerationRootNamespace = reader.ReadString(); } if (IsReadUserGeneratedProjectSuffix(reader.Version)) { UserGeneratedProjectSuffix = reader.ReadString(); } if (IsReadCollabEditorSettings(reader.Version)) { CollabEditorSettings.Read(reader); } if (IsReadEnableTextureStreamingInPlayMode(reader.Version)) { EnableTextureStreamingInPlayMode = reader.ReadBoolean(); } }
public override void Read(AssetReader reader) { base.Read(reader); if (IsReadColorSpace(reader.Version)) { if (IsReadColorSpaceFirst(reader.Version)) { ColorSpace = (ColorSpace)reader.ReadInt32(); } } if (IsReadFormatFirst(reader.Version)) { Format = (TextureFormat)reader.ReadInt32(); } Width = reader.ReadInt32(); Height = reader.ReadInt32(); if (IsReadDepth(reader.Version)) { Depth = reader.ReadInt32(); } if (IsReadDataSizeFirst(reader.Version)) { DataSize = reader.ReadInt32(); } if (!IsReadFormatFirst(reader.Version)) { Format = (TextureFormat)reader.ReadInt32(); } if (IsBoolMinMap(reader.Version)) { bool mipMap = reader.ReadBoolean(); if (mipMap) { int maxSide = Math.Max(Width, Height); MipCount = System.Convert.ToInt32(Math.Log(maxSide) / Math.Log(2)); } else { MipCount = 1; } } else { MipCount = reader.ReadInt32(); } if (!IsReadDataSizeFirst(reader.Version)) { DataSize = reader.ReadInt32(); } if (IsReadIsReadableFirst(reader.Version)) { IsReadable = reader.ReadBoolean(); } if (IsReadReadAllowed(reader.Version)) { ReadAllowed = reader.ReadBoolean(); } reader.AlignStream(AlignType.Align4); if (IsReadImageCount(reader.Version)) { ImageCount = reader.ReadInt32(); TextureDimension = (TextureDimension)reader.ReadInt32(); } TextureSettings.Read(reader); if (IsReadIsReadableSecond(reader.Version)) { IsReadable = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); } if (IsReadLightmapFormat(reader.Version)) { LightmapFormat = (TextureUsageMode)reader.ReadInt32(); } if (IsReadColorSpace(reader.Version)) { if (!IsReadColorSpaceFirst(reader.Version)) { ColorSpace = (ColorSpace)reader.ReadInt32(); } } m_imageData = reader.ReadByteArray(); reader.AlignStream(AlignType.Align4); if (IsReadStreamData(reader.Version)) { StreamData.Read(reader); } }
public override void Read(AssetReader reader) { base.Read(reader); Enabled = reader.ReadBoolean(); if (IsAlignEnabled(reader.Version)) { reader.AlignStream(AlignType.Align4); } CastShadows = (ShadowCastingMode)reader.ReadByte(); ReceiveShadows = reader.ReadByte(); if (IsReadDynamicOccludee(reader.Version)) { DynamicOccludee = reader.ReadByte(); } if (IsAlignEnabled(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadMotionVector(reader.Version)) { MotionVectors = (MotionVectorGenerationMode)reader.ReadByte(); LightProbeUsage = (LightProbeUsage)reader.ReadByte(); } if (IsReadReflectUsage(reader.Version)) { if (IsReadReflectUsageFirst(reader.Version)) { ReflectionProbeUsage = (ReflectionProbeUsage)reader.ReadByte(); reader.AlignStream(AlignType.Align4); } } if (IsReadRenderingLayerMask(reader.Version)) { RenderingLayerMask = reader.ReadUInt32(); } if (IsReadLightmapIndex(reader.Version, reader.Flags)) { LightmapIndex = IsByteLightIndex(reader.Version) ? reader.ReadByte() : reader.ReadUInt16(); } if (IsReadLightmapIndexDynamic(reader.Version, reader.Flags)) { LightmapIndexDynamic = reader.ReadUInt16(); } if (IsReadMaterialFirst(reader.Version)) { m_materials = reader.ReadArray <PPtr <Material> >(); } if (IsReadLightmapTilingOffset(reader.Version, reader.Flags)) { LightmapTilingOffset.Read(reader); } if (IsReadLightmapTilingOffsetDynamic(reader.Version, reader.Flags)) { LightmapTilingOffsetDynamic.Read(reader); } if (!IsReadMaterialFirst(reader.Version)) { m_materials = reader.ReadArray <PPtr <Material> >(); } if (IsReadSubsetIndices(reader.Version)) { m_subsetIndices = reader.ReadUInt32Array(); } if (IsReadStaticBatchInfo(reader.Version)) { StaticBatchInfo.Read(reader); } if (IsReadStaticBatchRoot(reader.Version)) { StaticBatchRoot.Read(reader); } if (IsReadUseLight(reader.Version)) { UseLightProbes = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); } if (IsReadReflectUsage(reader.Version)) { if (!IsReadReflectUsageFirst(reader.Version)) { ReflectionProbeUsage = (ReflectionProbeUsage)reader.ReadInt32(); } } if (IsReadProbeAnchor(reader.Version)) { ProbeAnchor.Read(reader); } if (IsReadLightOverride(reader.Version)) { LightProbeVolumeOverride.Read(reader); } #if UNIVERSAL if (IsReadScaleInLightmap(reader.Flags)) { #warning TODO: separate by version ScaleInLightmap = reader.ReadSingle(); PreserveUVs = reader.ReadBoolean(); IgnoreNormalsForChartDetection = reader.ReadBoolean(); ImportantGI = reader.ReadBoolean(); StitchLightmapSeams = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); SelectedEditorRenderState = (EditorSelectedRenderState)reader.ReadInt32(); MinimumChartSize = reader.ReadInt32(); AutoUVMaxDistance = reader.ReadSingle(); AutoUVMaxAngle = reader.ReadSingle(); LightmapParameters.Read(reader); } #endif if (IsAlignLightProbe(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadSortingLayerID(reader.Version)) { SortingLayerID = reader.ReadInt32(); } if (IsReadSortingLayer(reader.Version)) { SortingLayer = reader.ReadInt16(); } if (IsReadSortingOrder(reader.Version)) { SortingOrder = reader.ReadInt16(); } if (IsAlignSortingOrder(reader.Version)) { reader.AlignStream(AlignType.Align4); } }
public override void Read(AssetReader reader) { base.Read(reader); if (IsReadIsPowerOfTwo(reader.Version)) { if (IsReadIsPowerOfTwoFirst(reader.Version)) { IsPowerOfTwo = reader.ReadBoolean(); } } Width = reader.ReadInt32(); Height = reader.ReadInt32(); if (IsReadAntiAliasing(reader.Version)) { AntiAliasing = reader.ReadInt32(); } if (IsReadMipCount(reader.Version)) { MipCount = reader.ReadInt32(); } DepthFormat = reader.ReadInt32(); if (IsReadColorFormat(reader.Version)) { ColorFormat = (RenderTextureFormat)reader.ReadInt32(); } if (IsReadIsPowerOfTwo(reader.Version)) { if (!IsReadIsPowerOfTwoFirst(reader.Version)) { IsPowerOfTwo = reader.ReadBoolean(); } } if (IsReadIsCubemap(reader.Version)) { IsCubemap = reader.ReadBoolean(); } if (IsReadMipMap(reader.Version)) { MipMap = reader.ReadBoolean(); } if (IsReadGenerateMips(reader.Version)) { GenerateMips = reader.ReadBoolean(); } if (IsReadSRGB(reader.Version)) { SRGB = reader.ReadBoolean(); } if (IsReadUseDynamicScale(reader.Version)) { UseDynamicScale = reader.ReadBoolean(); BindMS = reader.ReadBoolean(); } if (IsReadEnableCompatibleFormat(reader.Version)) { EnableCompatibleFormat = reader.ReadBoolean(); } if (IsAlign(reader.Version)) { reader.AlignStream(AlignType.Align4); } TextureSettings.Read(reader); if (IsReadDimension(reader.Version)) { Dimension = reader.ReadInt32(); VolumeDepth = reader.ReadInt32(); } }
public override void Read(AssetReader reader) { if (HasRenderer(reader.Version)) { base.Read(reader); } else { ReadBase(reader); } if (HasUpdateWhenOffscreen(reader.Version)) { if (IsQualityFirst(reader.Version)) { Quality = reader.ReadInt32(); } UpdateWhenOffscreen = reader.ReadBoolean(); if (!IsQualityFirst(reader.Version)) { Quality = reader.ReadInt32(); } } if (HasSkinNormals(reader.Version)) { SkinNormals = reader.ReadBoolean(); } if (HasSkinMotionVector(reader.Version)) { SkinnedMotionVectors = reader.ReadBoolean(); } if (IsAlignBools(reader.Version)) { reader.AlignStream(); } if (HasOffscreen(reader.Version)) { DisableAnimationWhenOffscreen.Read(reader); } if (IsMeshFirst(reader.Version)) { Mesh.Read(reader); } if (HasAnimation(reader.Version)) { Animation.Read(reader); } Bones = reader.ReadAssetArray <PPtr <Transform> >(); if (IsAlignBones(reader.Version)) { reader.AlignStream(); } if (!IsMeshFirst(reader.Version)) { Mesh.Read(reader); } if (HasBindPose(reader.Version)) { BindPose = reader.ReadAssetArray <Matrix4x4f>(); } if (HasCurrentPose(reader.Version)) { CurrentPose.Read(reader); } if (HasWeights(reader.Version)) { BlendShapeWeights = reader.ReadSingleArray(); } if (HasRootBone(reader.Version)) { RootBone.Read(reader); } if (HasAABB(reader.Version)) { AABB.Read(reader); DirtyAABB = reader.ReadBoolean(); if (IsAlignDirty(reader.Version)) { reader.AlignStream(); } } }
public void Read(AssetReader reader) { ChildBlendEventIDArray = reader.ReadUInt32Array(); NormalizedBlendValues = reader.ReadBoolean(); reader.AlignStream(); }
public override void Read(AssetReader reader) { base.Read(reader); Type = (ParticleSystemShapeType)reader.ReadInt32(); if (IsReadRadiusSingle(reader.Version)) { float radius = reader.ReadSingle(); Radius = new MultiModeParameter(radius); } Angle = reader.ReadSingle(); if (IsReadLength(reader.Version)) { Length = reader.ReadSingle(); } if (IsReadBoxAxes(reader.Version)) { float boxX = reader.ReadSingle(); float boxY = reader.ReadSingle(); float boxZ = reader.ReadSingle(); Scale = Type.IsBoxAny() ? new Vector3f(boxX, boxY, boxZ) : Vector3f.One; } if (IsReadArcSingle(reader.Version)) { float arc = reader.ReadSingle(); Arc = new MultiModeParameter(arc); } if (IsReadRadius(reader.Version)) { if (IsReadRadiusFirst(reader.Version)) { Radius.Read(reader); Arc.Read(reader); } } if (IsReadBoxThickness(reader.Version)) { BoxThickness.Read(reader); RadiusThickness = reader.ReadSingle(); DonutRadius = reader.ReadSingle(); Position.Read(reader); Rotation.Read(reader); Scale.Read(reader); } PlacementMode = (PlacementMode)reader.ReadInt32(); if (IsReadMeshMaterialIndex(reader.Version)) { if (IsReadMeshMaterialIndexFirst(reader.Version)) { MeshMaterialIndex = reader.ReadInt32(); MeshNormalOffset = reader.ReadSingle(); } } if (IsReadMeshSpawn(reader.Version)) { MeshSpawn.Read(reader, false); } Mesh.Read(reader); if (IsReadMeshRenderer(reader.Version)) { MeshRenderer.Read(reader); SkinnedMeshRenderer.Read(reader); } if (IsReadSprite(reader.Version)) { Sprite.Read(reader); SpriteRenderer.Read(reader); } if (IsReadMeshMaterialIndex(reader.Version)) { if (!IsReadMeshMaterialIndexFirst(reader.Version)) { MeshMaterialIndex = reader.ReadInt32(); MeshNormalOffset = reader.ReadSingle(); } } if (IsReadMeshScale(reader.Version)) { float meshScale = reader.ReadSingle(); Scale = new Vector3f(meshScale, meshScale, meshScale); } if (IsReadUseMeshMaterialIndex(reader.Version)) { UseMeshMaterialIndex = reader.ReadBoolean(); UseMeshColors = reader.ReadBoolean(); } if (IsReadAlignToDirection(reader.Version)) { AlignToDirection = reader.ReadBoolean(); } if (IsReadRandomDirection(reader.Version)) { bool randomDirection = reader.ReadBoolean(); RandomDirectionAmount = randomDirection ? 1.0f : 0.0f; } reader.AlignStream(AlignType.Align4); if (IsReadTexture(reader.Version)) { Texture.Read(reader); TextureClipChannel = reader.ReadInt32(); TextureClipThreshold = reader.ReadSingle(); TextureUVChannel = reader.ReadInt32(); TextureColorAffectsParticles = reader.ReadBoolean(); TextureAlphaAffectsParticles = reader.ReadBoolean(); TextureBilinearFiltering = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); } if (IsReadRandomDirectionAmount(reader.Version)) { RandomDirectionAmount = reader.ReadSingle(); SphericalDirectionAmount = reader.ReadSingle(); } if (IsReadRandomPositionAmount(reader.Version)) { RandomPositionAmount = reader.ReadSingle(); } if (IsReadRadius(reader.Version)) { if (!IsReadRadiusFirst(reader.Version)) { Radius.Read(reader); Arc.Read(reader); } } }
public override void Read(AssetReader reader) { base.Read(reader); Width = reader.ReadInt32(); Height = reader.ReadInt32(); CompleteImageSize = reader.ReadInt32(); TextureFormat = (TextureFormat)reader.ReadInt32(); if (IsBoolMinMap(reader.Version)) { MipMap = reader.ReadBoolean(); if (MipMap) { int maxSide = Math.Max(Width, Height); MipCount = Convert.ToInt32(Math.Log(maxSide) / Math.Log(2)); } else { MipCount = 1; } } else { MipCount = reader.ReadInt32(); } if (IsReadIsReadable(reader.Version)) { IsReadable = reader.ReadBoolean(); } if (IsReadReadAllowed(reader.Version)) { ReadAllowed = reader.ReadBoolean(); } if (IsReadStreamingMipmaps(reader.Version)) { StreamingMipmaps = reader.ReadBoolean(); } reader.AlignStream(AlignType.Align4); if (IsReadStreamingMipmapsPriority(reader.Version)) { StreamingMipmapsPriority = reader.ReadInt32(); } ImageCount = reader.ReadInt32(); TextureDimension = (TextureDimension)reader.ReadInt32(); TextureSettings.Read(reader); if (IsReadLightmapFormat(reader.Version)) { LightmapFormat = (TextureUsageMode)reader.ReadInt32(); } if (IsReadColorSpace(reader.Version)) { ColorSpace = (ColorSpace)reader.ReadInt32(); } m_imageData = reader.ReadByteArray(); reader.AlignStream(AlignType.Align4); if (IsReadStreamData(reader.Version)) { StreamData.Read(reader); } }
public override void Read(AssetReader reader) { base.Read(reader); m_scenes = reader.ReadStringArray(); if (IsReadPreloadPlugin(reader.Version)) { m_preloadedPlugins = reader.ReadStringArray(); } if (IsReadEnabledVRDevices(reader.Version)) { m_enabledVRDevices = reader.ReadStringArray(); } if (IsReadBuildTags(reader.Version)) { m_buildTags = reader.ReadStringArray(); BuildGUID.Read(reader); } if (IsReadHasRenderTexture(reader.Version)) { HasRenderTexture = reader.ReadBoolean(); } HasPROVersion = reader.ReadBoolean(); if (IsReadIsNoWatermarkBuild(reader.Version)) { IsNoWatermarkBuild = reader.ReadBoolean(); IsPrototypingBuild = reader.ReadBoolean(); } if (IsReadIsEducationalBuild(reader.Version)) { IsEducationalBuild = reader.ReadBoolean(); } if (IsReadIsEmbedded(reader.Version)) { IsEmbedded = reader.ReadBoolean(); } HasPublishingRights = reader.ReadBoolean(); if (IsReadHasShadows(reader.Version)) { HasShadows = reader.ReadBoolean(); } if (IsReadHasSoftShadows(reader.Version)) { HasSoftShadows = reader.ReadBoolean(); HasLocalLightShadows = reader.ReadBoolean(); } if (IsReadHasAdvancedVersion(reader.Version)) { HasAdvancedVersion = reader.ReadBoolean(); EnableDynamicBatching = reader.ReadBoolean(); IsDebugBuild = reader.ReadBoolean(); } if (IsReadUsesOnMouseEvents(reader.Version)) { UsesOnMouseEvents = reader.ReadBoolean(); } if (IsReadEnableMultipleDisplays(reader.Version)) { EnableMultipleDisplays = reader.ReadBoolean(); } if (IsReadHasOculusPlugin(reader.Version)) { HasOculusPlugin = reader.ReadBoolean(); } if (IsReadHasClusterRendering(reader.Version)) { HasClusterRendering = reader.ReadBoolean(); } if (IsAlignBools(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadVersion(reader.Version)) { Version = reader.ReadString(); } if (IsReadAuthToken(reader.Version)) { AuthToken = reader.ReadString(); } if (IsReadRuntimeClassHashes(reader.Version)) { m_runtimeClassHashes = new Dictionary <int, Hash128>(); if (IsRuntimeClassHashesUInt32(reader.Version)) { Dictionary <int, uint> runtimeClassHashes = new Dictionary <int, uint>(); runtimeClassHashes.Read(reader); foreach (KeyValuePair <int, uint> kvp in runtimeClassHashes) { m_runtimeClassHashes.Add(kvp.Key, new Hash128(kvp.Value)); } } else { m_runtimeClassHashes.Read(reader); } } if (IsReadScriptHashes(reader.Version)) { m_scriptHashes = new Dictionary <Hash128, Hash128>(); m_scriptHashes.Read(reader); } if (IsReadGraphicsAPIs(reader.Version)) { m_graphicsAPIs = reader.ReadInt32Array(); } }
public override void Read(AssetReader reader) { base.Read(reader); Gravity.Read(reader); DefaultMaterial.Read(reader); BounceThreshold = reader.ReadSingle(); if (IsReadSleepThreshold(reader.Version)) { SleepThreshold = reader.ReadSingle(); } else { SleepVelocity = reader.ReadSingle(); SleepAngularVelocity = reader.ReadSingle(); } if (IsReadSleepAngularVelocity(reader.Version)) { MaxAngularVelocity = reader.ReadSingle(); } if (IsReadDefaultContactOffset(reader.Version)) { DefaultContactOffset = reader.ReadSingle(); } else { MinPenetrationForPenalty = reader.ReadSingle(); } DefaultSolverIterations = reader.ReadInt32(); if (IsReadDefaultSolverVelocityIterations(reader.Version)) { DefaultSolverVelocityIterations = reader.ReadInt32(); } if (IsReadQueriesHitBackfaces(reader.Version)) { QueriesHitBackfaces = reader.ReadBoolean(); } if (IsReadQueriesHitTriggers(reader.Version)) { QueriesHitTriggers = reader.ReadBoolean(); } if (IsReadEnableAdaptiveForce(reader.Version)) { EnableAdaptiveForce = reader.ReadBoolean(); } if (IsReadEnablePCM(reader.Version)) { EnablePCM = reader.ReadBoolean(); } if (IsAlign(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadClothInterCollisionDistance(reader.Version)) { ClothInterCollisionDistance = reader.ReadSingle(); ClothInterCollisionStiffness = reader.ReadSingle(); ContactsGeneration = (ContactsGeneration)reader.ReadInt32(); reader.AlignStream(AlignType.Align4); } if (IsReadLayerCollisionMatrix(reader.Version)) { m_layerCollisionMatrix = reader.ReadUInt32Array(); } if (IsReadAutoSimulation(reader.Version)) { AutoSimulation = reader.ReadBoolean(); } if (IsReadAutoSyncTransforms(reader.Version)) { AutoSyncTransforms = reader.ReadBoolean(); } if (IsReadClothInterCollisionSettingsToggle(reader.Version)) { ClothInterCollisionSettingsToggle = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); ContactPairsMode = (ContactPairsMode)reader.ReadInt32(); BroadphaseType = (BroadphaseType)reader.ReadInt32(); WorldBounds.Read(reader); WorldSubdivisions = reader.ReadInt32(); } if (IsReadFrictionType(reader.Version)) { FrictionType = (FrictionType)reader.ReadInt32(); EnableEnhancedDeterminism = reader.ReadBoolean(); EnableUnifiedHeightmaps = reader.ReadBoolean(); } }
public override void Read(AssetReader reader) { base.Read(reader); if (IsReadEnlightenSceneMapping(reader.Version, reader.Flags)) { EnlightenSceneMapping.Read(reader); } if (IsReadGIWorkflowMode(reader.Version, reader.Flags)) { GIWorkflowMode = reader.ReadInt32(); } if (IsReadLightProbes(reader.Version, reader.Flags)) { LightProbes.Read(reader); } if (IsReadLightmaps(reader.Flags)) { m_lightmaps = reader.ReadAssetArray <LightmapData>(); } if (IsAlign1(reader.Version, reader.Flags)) { reader.AlignStream(AlignType.Align4); } if (IsReadLightmapsMode(reader.Version, reader.Flags)) { LightmapsMode = (LightmapsMode)reader.ReadInt32(); } if (IsReadBakedColorSpace(reader.Version)) { BakedColorSpace = reader.ReadInt32(); } if (IsReadUseDualLightmapsInForward(reader.Version)) { UseDualLightmapsInForward = reader.ReadBoolean(); } if (IsAlign2(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadGISettings(reader.Version)) { GISettings.Read(reader); } if (IsReadLightmapEditorSettings(reader.Version, reader.Flags)) { LightmapEditorSettings.Read(reader); } if (IsReadLightingDataAsset(reader.Version, reader.Flags)) { LightingDataAsset.Read(reader); } if (IsReadRuntimeCPUUsage(reader.Version)) { RuntimeCPUUsage = reader.ReadInt32(); } if (IsReadUseShadowmask(reader.Version)) { if (IsBoolShadowmask(reader.Version)) { UseShadowmask = reader.ReadBoolean(); } else { UseShadowmask = reader.ReadInt32() == 0 ? false : true; } } }