How do i get the EntityManager in the current preview ??

Just as simple as that …

https://www.youtube.com/watch?v=QbnVELXf5RQ

He only uses it, and sth. has changed to before, so i don’t know, how to access it now.

public static EntityManager EM
{
    get { return World.Active.EntityManager; }
}
1 Like

Now i feel dumb, but thank you ^^

If you need it in a System, it’s part of the base class, so you can just write this.EntityManager to get it.

 public abstract class ComponentSystemBase
{
        protected internal EntityManager EntityManager { get; }
}
1 Like

This have changed slightly in the newer versions of the entities package. You can’t use World.Active.EntityManager anymore - now it is typically:

World.DefaultGameObjectInjectionWorld.EntityManager
4 Likes