Friflo.Engine.ECS
Friflo.Engine.ECS copied to clipboard
How to sort relationship?
To build a list-based inventory system, I need to sort items in a specific order. How to set a particular order when using GetIncomingLinks<ParentOf>()?
Of course, I can do this by creating a component with a List<Entity> field, but I guess this is something the Relationships is trying to avoid.
Sorting relations is currently not supported. In general it is possible. It would require a
public static class RelationExtensions
{
public static void SortRelations<TRelation>(this Entity entity) where TRelation : struct, IRelation
{ ... }
}