I 've using this amazing script for weeks and it helps me a lot.
Then found that some segment will not be deleted when switching curve space to non-curve space.
I think it come from the following scripts.
SplineMeshTiling.cs
// we destroy the unused objects. This is classic pooling to recycle game objects.
foreach (var go in generated.transform
.Cast<Transform>()
.Select(child => child.gameObject).Except(used)) {
UOUtility.Destroy(go);
}
Casue the children changes after the during the 'foreach' iteration.
One segment needed to be destroyed will be skiped in every two iteration.
Using backward iteration from the original IEnumerable list.
Or simply add ".ToList()" ,
making it a saved list may solve this problem.
SplineMeshTiling.cs
// we destroy the unused objects. This is classic pooling to recycle game objects.
foreach (var go in generated.transform
.Cast<Transform>()
.Select(child => child.gameObject).Except(used).ToList()) {
UOUtility.Destroy(go);
}
SplineMeshTiling misses deleting some segments.
Hi,
I 've using this amazing script for weeks and it helps me a lot. Then found that some segment will not be deleted when switching curve space to non-curve space.
I think it come from the following scripts.
SplineMeshTiling.cs
Casue the children changes after the during the 'foreach' iteration. One segment needed to be destroyed will be skiped in every two iteration.
Using backward iteration from the original IEnumerable list. Or simply add ".ToList()" , making it a saved list may solve this problem.
SplineMeshTiling.cs
Thanks.