Hello. I am launching a humble foundation towards my space mmo today using DOTS/ECS, thank you all for the past year of help. I have one possibly final question. I’m adding this to an entity, but I am not sure how to check if it may already exist: DynamicBuffer dyn = em.AddBuffer(e);
By testing if it already exists, I can see if there is data I need to preserve, and not overwrite it.
Thanks again for a wonderful year of help. There’s a lot of hate on the internet lately, but the spirit of helping has never stopped as long as I’ve been on it since 1994. I was told it goes further back from the boss at the lab. He says he was there when some of the big guys weren’t big and silicon valley first started up. Everyone wanted to help and share info.
For a job, get a handle with GetBufferFromEntity outside and then test with HasComponent(Entity) on the handle.
I think on mainThread, EntityManager.HasComponent also works.
If that buffer is part of the prefab, check if the prefab has it instead. Otherwise you need to keep track of whether or not you added the buffer to the entity yourself. ECB doesn’t really keep track of archetype changes.
Yah, I think I just try and get too eloquent in my code. DOTS/ECS is more about functionality until the edge cases are sanded down… I can’t expect it to read the EntityComponents I attached to a GameObject until the devs have time putting that superfulous thing in… before the core mold is set, you never want to fix the outlier branches.