#Access Visual Effect (Managed Components) from IJobEntity
1 messages · Page 1 of 1 (latest)
There's no such construct as ManagedComponentDataFromEntity - That said, it's valid to make your own. Key rule of jobs. Static values can access managed data! - Keep in mind it sways away all Burstability and .Schedule/.ScheduleParallel + it didn't check how safe the static call is 😅
You could e.g. make a ManagedStore.GetData<TType>(Entity); Which is a m_MyStaticEntityManager.GetComponentObject<TType>(entity).
Just make sure the user set up the container correctly before running e.g. ManagedStore.Init(ref state) could be m_MyStaticEntityManager = state.EntityManager.
For more detail on Managed IJobEntity: https://forum.unity.com/threads/new-version-of-entities-1-0-pre-release-now-available-march-2023.1415658/#post-8898567