diff --git a/CHANGELOG.md b/CHANGELOG.md index 375f6bf..6721f9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 1.0.3 +* Fix bug when no keyframe in t = 0 +* Fix bug when keyframe has no object_refs + ### 1.0.2 * Fix changing pivots when blending animations diff --git a/SpriterDotNet.Unity/Assets/SpriterDotNet/Lib/SpriterDotNet.dll b/SpriterDotNet.Unity/Assets/SpriterDotNet/Lib/SpriterDotNet.dll index 3b2dc42..eab6b9d 100644 Binary files a/SpriterDotNet.Unity/Assets/SpriterDotNet/Lib/SpriterDotNet.dll and b/SpriterDotNet.Unity/Assets/SpriterDotNet/Lib/SpriterDotNet.dll differ diff --git a/SpriterDotNet/SpriterProcessor.cs b/SpriterDotNet/SpriterProcessor.cs index a738e46..4c2c350 100644 --- a/SpriterDotNet/SpriterProcessor.cs +++ b/SpriterDotNet/SpriterProcessor.cs @@ -101,6 +101,8 @@ public static FrameData GetFrameData(SpriterAnimation animation, float targetTim FrameData frameData = new FrameData(); + if (keyA.ObjectRefs == null) return frameData; + foreach (SpriterObjectRef objectRef in keyA.ObjectRefs) { SpriterObject interpolated = GetObjectInfo(objectRef, animation, adjustedTime); @@ -297,6 +299,7 @@ private static float AdjustTime(SpriterKey keyA, SpriterKey keyB, float animatio private static void GetMainlineKeys(SpriterMainlineKey[] keys, float targetTime, out SpriterMainlineKey keyA, out SpriterMainlineKey keyB) { keyA = LastKeyForTime(keys, targetTime); + keyA = keyA ?? keys[keys.Length - 1]; int nextKey = keyA.Id + 1; if (nextKey >= keys.Length) nextKey = 0; keyB = keys[nextKey];