decline-cookies / anvil-unity-dots

Unity DOTS and ECS specific additions and extensions to Anvil
MIT License
4 stars 1 forks source link

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

Open jkeon opened 8 months ago

jkeon commented 8 months ago

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.

mbaker3 commented 8 months ago

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