diff --git a/Editors/Shared/Editors.Shared.Core/Services/SkeletonAnimationLookUpHelper.cs b/Editors/Shared/Editors.Shared.Core/Services/SkeletonAnimationLookUpHelper.cs index e7b81f5c..196214a5 100644 --- a/Editors/Shared/Editors.Shared.Core/Services/SkeletonAnimationLookUpHelper.cs +++ b/Editors/Shared/Editors.Shared.Core/Services/SkeletonAnimationLookUpHelper.cs @@ -86,14 +86,15 @@ void LoadFromPackFileContainer(PackFileContainer packFileContainer) Parallel.For(0, groupedAnims.Count, index => { - + using var handle = File.OpenHandle(groupedAnims[index].Key); + + //https://www.jacksondunstan.com/articles/3568 var fileStream = File.OpenRead(groupedAnims[index].Key); var buffer = new byte[100]; foreach (var file in groupedAnims[index]) - { - fileStream.Seek(file.DataSource.Offset, SeekOrigin.Begin); - fileStream.ReadExactly(buffer); + { + RandomAccess.Read(handle, buffer, file.DataSource.Offset); FileDiscovered(buffer, packFileContainer, file.FullPath, ref skeletonFileNameList, ref animationList); } }); @@ -167,10 +168,10 @@ void AddAnimation(string skeletonName, string fullPath, PackFileContainer contai { lock (_threadLock) { - var newEntry = new ObservableCollection() { new AnimationReference(fullPath, container) }; - if (animationList.ContainsKey(skeletonName) == false) - animationList[skeletonName] = []; - animationList[skeletonName].Add(new AnimationReference(fullPath, container)); + var newEntry = new ObservableCollection() { new AnimationReference(fullPath, container) }; + if (animationList.ContainsKey(skeletonName) == false) + animationList[skeletonName] = []; + animationList[skeletonName].Add(new AnimationReference(fullPath, container)); if (fullPath.Contains("animations\\skeletons", StringComparison.InvariantCultureIgnoreCase)) skeletonFileNameList.Add(fullPath);