Btd6ModHelper.SourceGenerators
1.0.1
dotnet add package Btd6ModHelper.SourceGenerators --version 1.0.1
NuGet\Install-Package Btd6ModHelper.SourceGenerators -Version 1.0.1
<PackageReference Include="Btd6ModHelper.SourceGenerators" Version="1.0.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Btd6ModHelper.SourceGenerators" Version="1.0.1" />
<PackageReference Include="Btd6ModHelper.SourceGenerators"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Btd6ModHelper.SourceGenerators --version 1.0.1
#r "nuget: Btd6ModHelper.SourceGenerators, 1.0.1"
#:package Btd6ModHelper.SourceGenerators@1.0.1
#addin nuget:?package=Btd6ModHelper.SourceGenerators&version=1.0.1
#tool nuget:?package=Btd6ModHelper.SourceGenerators&version=1.0.1
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.
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.