Btd6ModHelper.SourceGenerators 1.0.1

dotnet add package Btd6ModHelper.SourceGenerators --version 1.0.1
                    
NuGet\Install-Package Btd6ModHelper.SourceGenerators -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Btd6ModHelper.SourceGenerators" Version="1.0.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Btd6ModHelper.SourceGenerators" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Btd6ModHelper.SourceGenerators">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Btd6ModHelper.SourceGenerators --version 1.0.1
                    
#r "nuget: Btd6ModHelper.SourceGenerators, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Btd6ModHelper.SourceGenerators@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Btd6ModHelper.SourceGenerators&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Btd6ModHelper.SourceGenerators&version=1.0.1
                    
Install as a Cake Tool

Btd6ModHelper.SourceGenerators

Source generators for BTD6 Mod Helper mods.

Auto-generates a strongly-typed ModResources class so you can reference your embedded resources by name without typos and without writing string literals.

What it generates

For every EmbeddedResource in your mod project with a known extension, a static readonly field is emitted on the ModResources class:

Extension Type
.png, .jpg SpriteResource<TMod>
.wav, .mp3, .ogg, .flac, .aac, .wma, .m4a AudioClipResource<TMod>
.bundle BundleResource<TMod>
.json JsonResource<TMod>

TMod is auto-detected as the concrete class in your project that inherits from BloonsMod.

If you have a series of numbered audio clips (pop1.wav, pop2.wav, pop3.wav, ...), a RandomizedAudioClipResource<TMod> named after the shared base (pop) is also generated — unless an audio clip with that exact base name already exists.

Install


<PackageReference Include="Btd6ModHelper.SourceGenerators" Version="1.0.0" PrivateAssets="all"/>

PrivateAssets="all" keeps the generator out of your mod's runtime dependencies.

This package only does anything in projects that already import btd6.targets from BTD6 Mod Helper — the targets file is what exposes your EmbeddedResource items to the generator.

Opt out

Set <ModHelperSourceGenerators>false</ModHelperSourceGenerators> in your csproj to skip the generator entirely.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 172 5/29/2026
1.0.0 110 5/29/2026