decline-cookies/anvil-unity-dots

Post Entities 1.0 - Handle calling `SystemAPI` outside of a system.

Opened this issue · 1 comments

Currently there are extension methods in ManagedReferenceExtension and ComponentSystemBaseExtension that will call functions on a ComponentSystemBase such as GetSingleton.

These functions will be going away as they are marked as Obsolete and the correct usage is to call SystemAPI.GetSingleton instead.

This is fine, however Unity's codegen detects that SystemAPI was called outside of the System and won't compile.

We may have to add these functions to our own AbstractAnvilSystemBase and call SystemAPI in there.

Depending on when they enforce maybe aggressively inlining the extension methods will circumvent the issue.