EvaisaDev / UnityNetcodePatcher

An assembly patcher which replicates the ILPostProcessing step unity does in order to make NetworkBehaviours work
MIT License
51 stars 6 forks source link

Don't run NetcodePatchTask in non-Core MSBuild. #41

Closed wherget closed 5 months ago

wherget commented 5 months ago

This PR changes the SDK settings to instead issue a warning, and adds documentation on how to use both CLI and MSBuild Task to support either environment.

This guards VisualStudio against erroring out not being able to load the MSBuild Task. The net472 variant referenced in Sdk.tasks still isn't present in the build (that'd be another, if unnecessary PR), but also isn't loaded if the Task doesn't get called.

That makes the hybrid scenario outlined in the new docs possible.

One more improvement I could think of might be introducing a Property that abstracts away from the '$(MSBuildRuntimeType)' == 'Core' condition and hides it from the user. Maybe $(NetcodePatcherMSBuildUnavailable)?