我在使用spine4.2.20制作动画,导入到unity时发生了报错,我的unity版本为2022.3.0,报错日志如下
IndexOutOfRangeException: Index was outside the bounds of the array.
Spine.CurveTimeline..ctor (System.Int32 frameCount, System.Int32 bezierCount, System.String[] propertyIds) (at ./Library/PackageCache/com.esotericsoftware.spine.spine-csharp@86a320afc2/Animation.cs:297)
Spine.IkConstraintTimeline..ctor (System.Int32 frameCount, System.Int32 bezierCount, System.Int32 ikConstraintIndex) (at ./Library/PackageCache/com.esotericsoftware.spine.spine-csharp@86a320afc2/Animation.cs:2026)
Spine.SkeletonBinary.ReadAnimation (System.String name, Spine.SkeletonBinary+SkeletonInput input, Spine.SkeletonData skeletonData) (at ./Library/PackageCache/com.esotericsoftware.spine.spine-csharp@86a320afc2/SkeletonBinary.cs:886)
Spine.SkeletonBinary.ReadSkeletonData (System.IO.Stream file) (at ./Library/PackageCache/com.esotericsoftware.spine.spine-csharp@86a320afc2/SkeletonBinary.cs:390)
Spine.Unity.Editor.AssetUtility.AddRequiredAtlasRegionsFromBinary (System.String skeletonDataPath, System.Collections.Generic.List
1[T] requiredPaths) (at ./Library/PackageCache/com.esotericsoftware.spine.spine-unity@86a320afc2/Editor/spine-unity/Editor/Utility/AssetUtility.cs:223)
Spine.Unity.Editor.AssetUtility.GetRequiredAtlasRegions (System.String skeletonDataPath) (at ./Library/PackageCache/com.esotericsoftware.spine.spine-unity@86a320afc2/Editor/spine-unity/Editor/Utility/AssetUtility.cs:140)
Spine.Unity.Editor.AssetUtility.ImportSpineContent (System.String[] imported, System.Collections.Generic.List1[T] texturesWithoutMetaFile, System.Boolean reimport) (at ./Library/PackageCache/com.esotericsoftware.spine.spine-unity@86a320afc2/Editor/spine-unity/Editor/Utility/AssetUtility.cs:437)
Spine.Unity.Editor.AssetUtility.HandleOnPostprocessAllAssets (System.String[] imported, System.Collections.Generic.List
1[T] texturesWithoutMetaFile) (at ./Library/PackageCache/com.esotericsoftware.spine.spine-unity@86a320afc2/Editor/spine-unity/Editor/Utility/AssetUtility.cs:117)
Spine.Unity.Editor.SpineEditorUtilities.OnPostprocessAllAssets (System.String[] imported, System.String[] deleted, System.String[] moved, System.String[] movedFromAssetPaths) (at ./Library/PackageCache/com.esotericsoftware.spine.spine-unity@86a320afc2/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs:98)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <6aa56e57ab504395b555cf3ed50fa53d>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <6aa56e57ab504395b555cf3ed50fa53d>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <6aa56e57ab504395b555cf3ed50fa53d>:0)
UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) (at <505360e321ae48e3804e227a34262e1e>:0)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets, System.Boolean didDomainReload) (at <505360e321ae48e3804e227a34262e1e>:0)
UnityEditor.AssetPostprocessingInternal😛ostprocessAllAssets(String[], String[], String[], String[], String[], Boolean)
`
我不知道发生了什么,我只能提供我导出的设置如下:
当我将导出的文件放入unity工程中时,发生了报错。
我觉得值得一提的是,我之前4.2.20做出来的动画并没有发生过这种事情,同样的导出设置,同样的流程,这是第一次出错。