How do i use partial for acessing the EntityManager ?

I would like to use some internal methods of the EntityManager… mostly methods like SetComponentDataRaw(); and some other internal methods. Its possible via reflection, but probably not that fast.

I saw that the EntityManager struct is partial. How do we create another Partial struct EntityManager to acess its internal methods ? Any guides/tutorials ? Any examples ? Or tipps ? ^^

Glad for any help, thanks !

It has nothing to do with “partial” and has everything to do with asmref files. Here’s what I do:

1 Like

Thanks a lot, im gonna try that, but i dont understand it yet ^^ why doesnt it have to do anything with partial classes ? I thought i would need them to acess the internal methods. Or am i wrong ?

Partial just means the definition of the data type is split up into multiple files in the assembly. But anything that is internal is exposed to anything in the assembly, not just the type in question.

1 Like

Thanks ! Well… i just tried the asmref stuff… but it doesnt work.
I created a folder called “Test”, in there i created the reference file pointing towards Entities. Besides that file i created another .cs file. But the problem is… i can acess ANY internal method. They just dont show up. Any ideas what might cause that issue ? I also tried to change the namespace like you did… that didnt worked either.

6964523--820532--Screenshot_2.png

Do the errors also show up in the Unity Editor? Sometimes IDEs get confused by asmrefs.

+1 for SetComponentDataRaw. Would like to set a component’s value using ComponentType or TypeIndex.