https://github.com/raicuparta/unity-libs-nuget
Template for generating stripped Unity game libs nugets
https://github.com/raicuparta/unity-libs-nuget
unity unity3d
Last synced: about 1 year ago
JSON representation
Template for generating stripped Unity game libs nugets
- Host: GitHub
- URL: https://github.com/raicuparta/unity-libs-nuget
- Owner: Raicuparta
- Created: 2021-11-17T13:41:00.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-07T11:43:10.000Z (almost 3 years ago)
- Last Synced: 2025-04-12T05:38:27.891Z (about 1 year ago)
- Topics: unity, unity3d
- Language: Batchfile
- Homepage:
- Size: 3.89 MB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unity Game Libs Nuget Creator
Creates nugets with stripped and publicized libraries for Unity game modding.
If the game gets updated, this package needs to get updated too.
`strip-assembiles.bat` does two things:
- Strips game assembiles using [NStrip](https://github.com/BepInEx/NStrip). This removes game code and leaves only API definitions.
- Publicizes `Assembly.CSharp.dll` and `AAssembly-CSharp-firstpass.dll`. This makes all types, methods, properties and fields public, to make modding easier.
## Usage
### Nuget account
- Go to [nuget.org](https://nuget.org/).
- Either log in, or create a new account.
- [Create a new API key](https://www.nuget.org/account/apikeys) with permissions to push new packages.
### Prepare your repository
- [Create a new repository based on this template](https://github.com/Raicuparta/unity-libs-nuget/generate).
- Add a secret called `NUGET_KEY` to this repository. Give it the value of the API key you created earlier.
- Update the repository's name. This will be used as your Nuget ID, so it can't clash with another nuget package on [nuget.org](https://nuget.org/).
- Update the repository's description. This will be used as the nuget's description too.
### Generate the stripped libraries
- Make sure you start off with a clean version of the game files, with no extra/modified dlls.
- Drag the game's exe and drop it on `strip-assembiles.bat`.
- Dlls are stripped, publicized, and placed in `package\lib`.
### Updating the Nuget
- Edit the `.nuspec` file, make `` match the game version where these assemblies come from.
- Push to the default branch.
- Updating the default branch will trigger a workflow that will pack the dlls and update the NuGet package.
### Publicized assemblies
By default, only `Assembly-CSharp.dll` and `Assembly-CSharp-firstpass.dll` are publicized. All other dlls are stripped only. To publicize other dlls, edit `strip-assemblies.bat` and add the dll names to the `toPublicize` variable.
### Untouched assemblies
By default, every game assembly gets stripped. If there's any assembly you wish to keep in the package in their original state, add the dll names to the `dontTouch` variable.