Replies: 2 comments 1 reply
-
Hi, in case you only want to delete entities the most efficient way currently is: var store = new EntityStore(PidType.UsePidAsId);
for (int n = 0; n < 1000_000; n++) {
store.CreateEntity();
}
var entities = new List<Entity>(store.Entities.Count);
foreach (var entity in store.Entities) {
entities.Add(entity);
}
foreach (var entity in entities) {
entity.DeleteEntity();
} I guess will add an |
Beta Was this translation helpful? Give feedback.
0 replies
-
The intention of the remarks "Property is mainly used for debugging" for foreach (var entity in store.Entities) {
ref var position = ref entity.GetComponent<Position>();
ref var rotation = ref entity.GetComponent<Rotation>();
...
} instead of the much more performant way like. var query = store.Query<Position, Rotation>();
query.ForEachEntity((ref Position position, ref Rotation rotation, Entity entity) => {
...
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. I have a question about deleting entities functionality. In my game, I must delete all entities from storage to fill it again after relogin. I use this pseudocode:
What bothers me is the description of Entities in storage. It says that "Property is mainly used for debugging". What kind of improvement can I apply in this case? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions