Hello I dont know how to replaces these calls : entityManager.GetComponentDataFromEntity and entityManager.GetBufferFromEntity I have these errors : Assets/Scripts/Grid/Bootstraps/GridBootstrap.cs(178,89): error CS1061: 'EntityManager' does not contain a definition for 'GetComponentDataFromEntity' and no accessible extension method 'GetComponentDataFromEntity' accepting a first argument of type 'EntityManager' could be found (are you missing a using directive or an assembly reference?) Assets/Scripts/Grid/Bootstraps/GridBootstrap.cs(195,88): error CS1061: 'EntityManager' does not contain a definition for 'GetBufferFromEntity' and no accessible extension method 'GetBufferFromEntity' accepting a first argument of type 'EntityManager' could be found (are you missing a using directive or an assembly reference?) Thanks
You have to let your system know when you want to use CDFE because system collects who read and write data. It is now have to be requested from inside ComponentSystem's code. (protected method) I don't know why GetBufferFromEntity is missing, but [Inject] BufferFromEntity inside the system code works. (as well as inject CDFE)
ComponentSystem only has this.GetComponentDataFromEntity JobComponentSystem additionally has this.GetBufferFromEntity Not sure if there's a reason for that or just a missing feature for now.
I just added [Inject] BufferFromEntity<T> in ComponentSystem and can confirm that it works. Maybe just a mistake?
I meant the public methods in the base classes, not using injection. JobComponentSystem inherits from ComponentSystemBase and adds: public BufferFromEntity<T> GetBufferFromEntity<T>(bool isReadOnly = false) where T : struct, IBufferElementData;
Thanks for your help but my problem is that I need to use EntityManager from a bootstrap script and I don't have any access to these two methods now
If you can get a hold of EntityManager in your bootstrap script then just create a manager right there and call into its public method/update to do things.