-
I want to batch process objects with the same material and grid. How should I do it? public struct ECSMesh : IComponent
{
public Mesh mesh;
}
public struct ECSMaterial : IComponent
{
public Material material;
}
public class RenderSystem : QuerySystem<ECSMesh, ECSMaterial, Position>
{
protected override void OnUpdate()
{
// batch process same mesh and same material
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
friflo
Nov 1, 2024
Replies: 1 comment 2 replies
-
The ECS has currently not functionality for sorting. See Example |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
vkensou
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The ECS has currently not functionality for sorting.
You can use
query.ToEntityList().ToArray()
to get the entities of a query as anEntity[]
.This array can than be sorted with
Array.Sort<>()
.See Example