From 9950b890bd68e4595b95ad4d4fcb908912feed91 Mon Sep 17 00:00:00 2001 From: Leopotam Date: Tue, 7 Sep 2021 22:14:55 +0300 Subject: [PATCH 1/2] * EcsFilter: Reorder() - sparse index fixed. --- package.json | 2 +- src/filters.cs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dd39488..8103b73 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "displayName": "LeoECS Lite Extended filters", "description": "Extended filters for LeoECS Lite.", "unity": "2020.3", - "version": "2021.7.22", + "version": "2021.9.22-preview", "keywords": [ "leoecslite", "leoecs", diff --git a/src/filters.cs b/src/filters.cs index 5ac933e..4ea9422 100644 --- a/src/filters.cs +++ b/src/filters.cs @@ -753,6 +753,10 @@ public static EcsFilter Reorder (this EcsFilter filter, EcsFilterReorderHandler _filterSortPool[i] = cb (entities[i]); } Array.Sort (_filterSortPool, entities, 0, count); + var sparseIndex = filter.GetSparseIndex (); + for (int i = 0, iMax = count; i < iMax; i++) { + sparseIndex[entities[i]] = i + 1; + } } return filter; } @@ -894,7 +898,7 @@ public struct Exc [MethodImpl (MethodImplOptions.AggressiveInlining)] public EcsPool Inc1 () => _inc1; - + [MethodImpl (MethodImplOptions.AggressiveInlining)] public EcsPool Inc2 () => _inc2; From 4bf383629a8c1f227ccb0aaf704a9150eb9c62ae Mon Sep 17 00:00:00 2001 From: Leopotam Date: Wed, 22 Sep 2021 20:45:53 +0300 Subject: [PATCH 2/2] * UnityPackage version bump. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8103b73..d23950e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "displayName": "LeoECS Lite Extended filters", "description": "Extended filters for LeoECS Lite.", "unity": "2020.3", - "version": "2021.9.22-preview", + "version": "2021.9.22", "keywords": [ "leoecslite", "leoecs",