mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[unity] Fixed threaded system not handling null skeleton. Closes #2954.
This commit is contained in:
parent
59c90592c3
commit
2a73be09b7
@ -106,10 +106,18 @@ namespace Spine.Unity {
|
||||
}
|
||||
|
||||
public static int SkeletonSortComparer (ISkeletonRenderer first, ISkeletonRenderer second) {
|
||||
return first.Skeleton.Data.GetHashCode() - second.Skeleton.Data.GetHashCode();
|
||||
Skeleton firstSkeleton = first.Skeleton;
|
||||
Skeleton secondSkeleton = second.Skeleton;
|
||||
if (firstSkeleton == null) return secondSkeleton == null ? 0 : -1;
|
||||
else if (secondSkeleton == null) return 1;
|
||||
else return firstSkeleton.Data.GetHashCode() - secondSkeleton.Data.GetHashCode();
|
||||
}
|
||||
public static int SkeletonSortComparer (SkeletonAnimationBase first, SkeletonAnimationBase second) {
|
||||
return first.Skeleton.Data.GetHashCode() - second.Skeleton.Data.GetHashCode();
|
||||
Skeleton firstSkeleton = first.Skeleton;
|
||||
Skeleton secondSkeleton = second.Skeleton;
|
||||
if (firstSkeleton == null) return secondSkeleton == null ? 0 : -1;
|
||||
else if (secondSkeleton == null) return 1;
|
||||
else return firstSkeleton.Data.GetHashCode() - secondSkeleton.Data.GetHashCode();
|
||||
}
|
||||
public static readonly Comparison<ISkeletonRenderer> SkeletonRendererComparer = SkeletonSortComparer;
|
||||
public static readonly Comparison<SkeletonAnimationBase> SkeletonAnimationComparer = SkeletonSortComparer;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user