From 99651a5d7761f9c0ef6d0abb8b7626499690fb8e Mon Sep 17 00:00:00 2001 From: Perfare Date: Wed, 19 Sep 2018 21:10:47 +0800 Subject: [PATCH] Fixed #266 --- AssetStudio/Classes/AnimationClip.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/AssetStudio/Classes/AnimationClip.cs b/AssetStudio/Classes/AnimationClip.cs index a5e38c2..bbd9bfc 100644 --- a/AssetStudio/Classes/AnimationClip.cs +++ b/AssetStudio/Classes/AnimationClip.cs @@ -598,7 +598,10 @@ namespace AssetStudio { m_StreamedClip = new StreamedClip(reader); m_DenseClip = new DenseClip(reader); - m_ConstantClip = new ConstantClip(reader); + if ((version[0] > 4) || (version[0] == 4 && version[1] > 1) || (version[0] == 4 && version[1] == 1 && version[2] >= 5)) //4.1.5f1 and up + { + m_ConstantClip = new ConstantClip(reader); + } m_Binding = new ValueArrayConstant(reader, version); } } @@ -673,7 +676,15 @@ namespace AssetStudio int numIndices = reader.ReadInt32(); m_IndexArray = reader.ReadInt32Array(numIndices); - + if ((version[0] < 4) || (version[0] == 4 && version[1] < 1) || (version[0] == 4 && version[1] == 1 && version[2] < 5)) //4.1.5f1 down + { + int numAdditionalCurveIndexs = reader.ReadInt32(); + var m_AdditionalCurveIndexArray = new List(numAdditionalCurveIndexs); + for (int i = 0; i < numAdditionalCurveIndexs; i++) + { + m_AdditionalCurveIndexArray.Add(reader.ReadInt32()); + } + } int numDeltas = reader.ReadInt32(); m_ValueArrayDelta = new List(numDeltas); for (int i = 0; i < numDeltas; i++)