예제 #1
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            if (IsReadClassIDToTrack(reader.Version, reader.Flags))
            {
                m_classIDToTrack = new Dictionary <int, PPtr <BaseAnimationTrack> >();
                m_classIDToTrack.Read(reader);
                m_childTracks = reader.ReadAssetArray <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.ReadAssetArray <QuaternionCurve>();
            }
            if (IsReadCompressedRotationCurves(reader.Version))
            {
                m_compressedRotationCurves = reader.ReadAssetArray <CompressedAnimationCurve>();
            }
            if (IsReadEulerCurves(reader.Version))
            {
                m_eulerCurves = reader.ReadAssetArray <Vector3Curve>();
            }
            if (IsReadCurves(reader.Version))
            {
                m_positionCurves = reader.ReadAssetArray <Vector3Curve>();
                m_scaleCurves    = reader.ReadAssetArray <Vector3Curve>();
                m_floatCurves    = reader.ReadAssetArray <FloatCurve>();
            }
            if (IsReadPPtrCurves(reader.Version))
            {
                m_PPtrCurves = reader.ReadAssetArray <PPtrCurve>();
            }

            if (IsReadSampleRate(reader.Version))
            {
                SampleRate = reader.ReadSingle();
            }

            if (IsReadWrapMode(reader.Version))
            {
                WrapMode = (WrapMode)reader.ReadInt32();
            }
            if (IsReadBounds(reader.Version))
            {
                Bounds.Read(reader);
            }
            if (IsReadMuscleClip(reader.Version, reader.Flags))
            {
                MuscleClipSize = reader.ReadUInt32();
                MuscleClip     = new ClipMuscleConstant();
                MuscleClip.Read(reader);
            }
            if (IsReadClipBindingConstant(reader.Version))
            {
                ClipBindingConstant.Read(reader);
            }
#if UNIVERSAL
            if (IsReadAnimationClipSettings(reader.Version, reader.Flags))
            {
                AnimationClipSettings = new AnimationClipSettings();
                AnimationClipSettings.Read(reader);
            }
            if (IsReadEditorCurves(reader.Version, reader.Flags))
            {
                m_editorCurves      = reader.ReadAssetArray <FloatCurve>();
                m_eulerEditorCurves = reader.ReadAssetArray <FloatCurve>();
            }
#endif

            if (IsReadHasGenericRootTransform(reader.Version, reader.Flags))
            {
                HasGenericRootTransform = reader.ReadBoolean();
            }
            if (IsReadHasMotionFloatCurves(reader.Version, reader.Flags))
            {
                HasMotionFloatCurves = reader.ReadBoolean();
            }
#if UNIVERSAL
            if (IsReadGenerateMotionCurves(reader.Version, reader.Flags))
            {
                GenerateMotionCurves = reader.ReadBoolean();
            }
#endif
            if (IsReadHasGenericRootTransform(reader.Version, reader.Flags))
            {
                reader.AlignStream(AlignType.Align4);
            }

            if (IsReadEvents(reader.Version))
            {
                m_events = reader.ReadAssetArray <AnimationEvent>();
            }
            if (IsAlign(reader.Version))
            {
                reader.AlignStream(AlignType.Align4);
            }

#if UNIVERSAL
            if (IsReadRuntimeEvents(reader.Version, reader.Flags))
            {
                m_runetimeEvents = reader.ReadAssetArray <AnimationEvent>();
            }
#endif
        }
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            if (HasClassIDToTrack(reader.Version, reader.Flags))
            {
                ClassIDToTrack = new Dictionary <int, PPtr <BaseAnimationTrack> >();
                ClassIDToTrack.Read(reader);
                ChildTracks = reader.ReadAssetArray <ChildTrack>();
            }

            if (HasAnimationType(reader.Version))
            {
                AnimationType = (AnimationType)reader.ReadInt32();
            }
            if (HasLegacy(reader.Version))
            {
                Legacy = reader.ReadBoolean();
            }

            if (HasCompressed(reader.Version))
            {
                Compressed = reader.ReadBoolean();
            }
            if (HasUseHightQualityCurve(reader.Version))
            {
                UseHightQualityCurve = reader.ReadBoolean();
            }
            if (IsAlignCompressed(reader.Version))
            {
                reader.AlignStream();
            }

            if (HasCurves(reader.Version))
            {
                RotationCurves = reader.ReadAssetArray <QuaternionCurve>();
            }
            if (HasCompressedRotationCurves(reader.Version))
            {
                CompressedRotationCurves = reader.ReadAssetArray <CompressedAnimationCurve>();
            }
            if (HasEulerCurves(reader.Version))
            {
                EulerCurves = reader.ReadAssetArray <Vector3Curve>();
            }
            if (HasCurves(reader.Version))
            {
                PositionCurves = reader.ReadAssetArray <Vector3Curve>();
                ScaleCurves    = reader.ReadAssetArray <Vector3Curve>();
                FloatCurves    = reader.ReadAssetArray <FloatCurve>();
            }
            if (HasPPtrCurves(reader.Version))
            {
                PPtrCurves = reader.ReadAssetArray <PPtrCurve>();
            }

            if (HasSampleRate(reader.Version))
            {
                SampleRate = reader.ReadSingle();
            }

            if (HasWrapMode(reader.Version))
            {
                WrapMode = (WrapMode)reader.ReadInt32();
            }
            if (HasBounds(reader.Version))
            {
                Bounds.Read(reader);
            }
            if (HasMuscleClip(reader.Version, reader.Flags))
            {
                MuscleClipSize = reader.ReadUInt32();
                MuscleClip     = new ClipMuscleConstant();
                MuscleClip.Read(reader);
            }
            if (HasClipBindingConstant(reader.Version))
            {
                ClipBindingConstant.Read(reader);
            }
#if UNIVERSAL
            if (HasAnimationClipSettings(reader.Version, reader.Flags))
            {
                AnimationClipSettings = new AnimationClipSettings();
                AnimationClipSettings.Read(reader);
            }
            if (HasEditorCurves(reader.Version, reader.Flags))
            {
                EditorCurves      = reader.ReadAssetArray <FloatCurve>();
                EulerEditorCurves = reader.ReadAssetArray <FloatCurve>();
            }
#endif

            if (HasHasGenericRootTransform(reader.Version, reader.Flags))
            {
                HasGenericRootTransform = reader.ReadBoolean();
            }
            if (HasHasMotionFloatCurves(reader.Version, reader.Flags))
            {
                HasMotionFloatCurves = reader.ReadBoolean();
            }
#if UNIVERSAL
            if (HasGenerateMotionCurves(reader.Version, reader.Flags))
            {
                GenerateMotionCurves = reader.ReadBoolean();
            }
            if (HasIsEmpty(reader.Version, reader.Flags))
            {
                IsEmpty = reader.ReadBoolean();
            }
#endif
            if (HasHasGenericRootTransform(reader.Version, reader.Flags))
            {
                reader.AlignStream();
            }

            if (HasEvents(reader.Version))
            {
                Events = reader.ReadAssetArray <AnimationEvent>();
            }
            if (IsAlign(reader.Version))
            {
                reader.AlignStream();
            }

#if UNIVERSAL
            if (HasRuntimeEvents(reader.Version, reader.Flags))
            {
                RunetimeEvents = reader.ReadAssetArray <AnimationEvent>();
            }
#endif
        }