BeanCheeseBurrito / Flecs.NET

A C# wrapper for flecs
MIT License
145 stars 18 forks source link

Add Unity support, generate UPM package #17

Closed seep closed 11 months ago

seep commented 11 months ago

This is a WIP PR to get early feedback while I look into setting up the CI to publish the Unity package. The concept is pretty simple:

  1. adds a top-level upm directory which contains all of the static package files: meta files, package.json, System.Runtime.CompilerServices.Unsafe dependency, etc
  2. adds post-build steps to Flecs.NET, Flecs.NET.Bindings, Flecs.NET.Native, and the new Flecs.NET.Unity projects to copy the necessary build artifacts into the correct upm subfolder

The UPM package can be fully assembled by running dotnet build -c Debug and dotnet build -c Release, which we could put in a script if that's desired. All of the build artifacts in the upm folder are gitignored.

Flecs.NET.Unity is exported as source so that it can take advantage of Unity scripting defines to toggle behavior.

In contrast to MessagePack-CSharp and MemoryPack (which are both excellent examples of C# projects that generate UPM packages) I did not include an entire Unity project as it generates a lot of noise on the repo, but that is definitely an option.

seep commented 11 months ago

Removed draft status based on our Discord conversation.

BeanCheeseBurrito commented 11 months ago

Thanks for the PR! I'll look into setting up the unity-specific repo and CI scripts sometime this week.