#Suggestion: EntityQueryBuilder.BuildAndDispose
1 messages · Page 1 of 1 (latest)
using var query = ...
is a more c# way of handling this
My point is that Build(...) returns a query, so if you want to dispose your builder, you will need a builder variable.
using var builder = new EntityQueryBuilder(Allocator.Temp) .WithAll<ComponentA, ComponentB>(); var query = builder.Build(ref state);
oh sure, but do you ever actually need to dispose your builder?
when do you not use temp
True, it's just not overly obvious whether Dispose is optional or not, particularly seeing as CollectionHelper.ShouldDeallocate(Allocator.Temp) returns true 🙂
(legit question, i have never seen someone do it but there might be actual use cases)