|
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
}
} |
Answered by
friflo
Nov 1, 2024
Replies: 1 comment 2 replies
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