From dc2324af953951c771a56c823d92e6e5d1ff1324 Mon Sep 17 00:00:00 2001 From: EliyaFishman <45822259+EliyaFishman@users.noreply.github.com> Date: Mon, 5 Dec 2022 22:03:22 +0200 Subject: [PATCH] Fix a bug that made first part enabled curve wrong, --- .../bread2unity/AssetGenerators/AnimationCreator.cs | 9 +++++---- Assets/Editor/bread2unity/README.md | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Assets/Editor/bread2unity/AssetGenerators/AnimationCreator.cs b/Assets/Editor/bread2unity/AssetGenerators/AnimationCreator.cs index 31c356cad..d0df39ec8 100644 --- a/Assets/Editor/bread2unity/AssetGenerators/AnimationCreator.cs +++ b/Assets/Editor/bread2unity/AssetGenerators/AnimationCreator.cs @@ -28,7 +28,8 @@ namespace Bread2Unity { Keyframe lastKey = keys.LastOrDefault(); - base.AddKey(time, keys.Length > 0 ? lastKey.value : 1); + base.AddKey(new Keyframe(time, keys.Length > 0 ? lastKey.value : 1, float.PositiveInfinity, + float.PositiveInfinity)); } } @@ -185,7 +186,7 @@ namespace Bread2Unity animationClip.SetCurve(child.name, typeof(SpriteRenderer), "m_FlipY", flipYCurve); if ((from part in partsOfGameObject select part.RegionIndex.Index).Distinct().Count() > 1) AnimationUtility.SetObjectReferenceCurve(animationClip, spriteBinding, spriteFrames.ToArray()); - + //Check if there is any need for z animation var setOfZIndexes = new HashSet(); foreach (var sprite in spritesAssociatedWithPrefab) @@ -193,12 +194,12 @@ namespace Bread2Unity for (int i = 0; i < sprite.parts.Count && setOfZIndexes.Count < 2; i++) { var part = sprite.parts[i]; - if(bccadPrefab.RegionToChild[part.RegionIndex] != child) + if (bccadPrefab.RegionToChild[part.RegionIndex] != child) continue; setOfZIndexes.Add(i); } } - + if ((from part in partsOfGameObject select part.PosX).Distinct().Count() > 1 || (from part in partsOfGameObject select part.PosY).Distinct().Count() > 1 || setOfZIndexes.Count > 1 || diff --git a/Assets/Editor/bread2unity/README.md b/Assets/Editor/bread2unity/README.md index 03b017c73..5380b7b51 100644 --- a/Assets/Editor/bread2unity/README.md +++ b/Assets/Editor/bread2unity/README.md @@ -24,5 +24,5 @@ Rhythm Heaven animation to Unity animation converter - [ ] write a normal readme ### Bugs -- [ ] fix camera taking pictures -- [ ] mices are on top of frame (photo 16) \ No newline at end of file +- [X] fix camera taking pictures +- [X] mices are on top of frame (photo 16) \ No newline at end of file