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

This commit is contained in:
Harald Csaszar 2025-02-11 15:29:38 +01:00
parent 2f7b431821
commit 1cdbf9be1a
2 changed files with 4 additions and 1 deletions

View File

@ -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) {
string animationName = animations.Name; // Review for unsafe names. Requires runtime implementation too.
spineAnimationTable.Add(animationName, animations);
@ -144,6 +146,7 @@ namespace Spine.Unity.Editor {
}
AnimationClip clip = unityAnimationClipTable[animationName];
clip.frameRate = fps;
clip.SetCurve("", typeof(GameObject), "dummy", AnimationCurve.Linear(0, 0, animations.Duration, 0));
AnimationClipSettings settings = AnimationUtility.GetAnimationClipSettings(clip);
settings.stopTime = animations.Duration;

View File

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