You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling Entity.Set to set a component that doesn't exist on a said entity, causes directly memory corruption.
A suggestion would be to make it safe, but add a non safe version for performance.
As the vast majority of ecs code normally would not be affected by such change in performance just a small part of it, that is called very often, hence I would suggest making the default behavior safe.
The text was updated successfully, but these errors were encountered:
In our game we have a method called Ensure(Entity) where it checks Has first which might be useful, so anyone that knows for sure the component exists can use Set or otherwise use the other method.
I think it would be particularly good to add more documentation on the unsafe methods on their assumptions. If trying to Set a component to an entity that lacks it will break it that should be documented. The worst ones are the ones that don't immediately crash, like Add for a component on an entity that already has it.
Calling Entity.Set to set a component that doesn't exist on a said entity, causes directly memory corruption.
A suggestion would be to make it safe, but add a non safe version for performance.
As the vast majority of ecs code normally would not be affected by such change in performance just a small part of it, that is called very often, hence I would suggest making the default behavior safe.
The text was updated successfully, but these errors were encountered: