Przeglądaj źródła

[unity] Set fps at generated SkeletonMecanim animation clip assets. Closes #2395.

Harald Csaszar 7 miesięcy temu
rodzic
commit
1cdbf9be1a

+ 3 - 0
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs

@@ -130,6 +130,8 @@ namespace Spine.Unity.Editor {
 				}
 				}
 			}
 			}
 
 
+			SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(true);
+			float fps = skeletonData != null ? skeletonData.Fps : 0.0f;
 			foreach (Animation animations in data.Animations) {
 			foreach (Animation animations in data.Animations) {
 				string animationName = animations.Name; // Review for unsafe names. Requires runtime implementation too.
 				string animationName = animations.Name; // Review for unsafe names. Requires runtime implementation too.
 				spineAnimationTable.Add(animationName, animations);
 				spineAnimationTable.Add(animationName, animations);
@@ -144,6 +146,7 @@ namespace Spine.Unity.Editor {
 				}
 				}
 
 
 				AnimationClip clip = unityAnimationClipTable[animationName];
 				AnimationClip clip = unityAnimationClipTable[animationName];
+				clip.frameRate = fps;
 				clip.SetCurve("", typeof(GameObject), "dummy", AnimationCurve.Linear(0, 0, animations.Duration, 0));
 				clip.SetCurve("", typeof(GameObject), "dummy", AnimationCurve.Linear(0, 0, animations.Duration, 0));
 				AnimationClipSettings settings = AnimationUtility.GetAnimationClipSettings(clip);
 				AnimationClipSettings settings = AnimationUtility.GetAnimationClipSettings(clip);
 				settings.stopTime = animations.Duration;
 				settings.stopTime = animations.Duration;

+ 1 - 1
spine-unity/Assets/Spine/package.json

@@ -2,7 +2,7 @@
 	"name": "com.esotericsoftware.spine.spine-unity",
 	"name": "com.esotericsoftware.spine.spine-unity",
 	"displayName": "spine-unity Runtime",
 	"displayName": "spine-unity Runtime",
 	"description": "This plugin provides the spine-unity runtime core.",
 	"description": "This plugin provides the spine-unity runtime core.",
-	"version": "4.2.97",
+	"version": "4.2.98",
 	"unity": "2018.3",
 	"unity": "2018.3",
 	"author": {
 	"author": {
 		"name": "Esoteric Software",
 		"name": "Esoteric Software",