Icons & Sounds¶
Two finishing touches that make a mod feel like part of the game: a proper inventory icon and sounds that come from the same palette the base game uses. Both are Inspector work — the only C# on this page is optional, at the very bottom.
Generating Inventory Icons¶
The inventory shows each item using the Icon sprite on its definition. The Mod Tools can render one for you straight from the prefab, on a transparent background.
The menu is called Generate Preview, and it comes in two families: the Assets entries work on a prefab asset selected in the Project window, and the single GameObject entry works on a prefab instance selected in the Hierarchy.
From the Project window (prefab assets)¶
| Menu item | What it renders |
|---|---|
| Assets → Fireworks Mania → Generate Preview → Orthographic → Front View | Orthographic three-quarter view, looking down on the front — the usual choice for fireworks |
| Assets → Fireworks Mania → Generate Preview → Orthographic → Back View | The same angle, mirrored to look down on the back |
| Assets → Fireworks Mania → Generate Preview → Perspective → Front View | Perspective version of the front three-quarter view |
| Assets → Fireworks Mania → Generate Preview → Perspective → Back View | Perspective version of the back three-quarter view |
| Assets → Fireworks Mania → Generate Preview → Front View Character | Near head-on perspective framing, meant for character prefabs |
The four Orthographic/Perspective entries are not dead-on views — they look down on the object from one side, the way the base-game inventory icons do. Whichever entry you pick, the object is auto-framed from its bounds so it fills the image. Front View Character is the same machinery aimed almost straight at the front of the object.
These five instantiate the shipped PreviewLightingPrefab light rig into your currently open scene, render, and destroy it again. There is no throwaway preview scene — the render happens in whatever scene you have open, so your scene's own lighting and ambient settings still contribute. Generate your icons from a neutral scene if you want them to match each other.
You can select several prefabs at once and get an image for each.
From the Hierarchy (scene instances)¶
| Menu item | What it renders |
|---|---|
| GameObject → Fireworks Mania → Generate Preview → Perspective → Current Veiw In Scene | Takes your Scene view camera's direction relative to the object, then re-frames the object so it fills the image |
The misspelling of "View" is how the menu item ships — you are looking in the right place.
This is the "compose it by eye" option: line the Scene view up the way you want the item to look, then generate. It does not instantiate the lighting rig, so you get your current scene's lighting exactly as it is.
The scene object must be a prefab instance
This entry works out where to save the PNG from the prefab asset behind the nearest instance root. If the selected object is not a prefab instance there is no asset path to save next to, so make it a prefab first.
What you get¶
| Property | Value |
|---|---|
| Size | 512 × 512 (rendered at 2× supersampling) |
| Background | Fully transparent |
| Filename | <GameObject name> AutoGeneratedImage.png |
| Location | The folder containing the prefab asset |
| Texture Type | Sprite, Sprite Mode Single |
| Pixels Per Unit | 100 |
| Mip Maps | Off |
| Compression | CompressedHQ, Max Size 512 |
The generated sprite is pinged in the Project window when it is done, and the path is logged to the Console as Saved generated preview '<name> AutoGeneratedImage' at path: <path>. Drag it onto the Icon field of your FireworkEntityDefinition or PropEntityDefinition — generating the image does not assign it for you.
Rules and gotchas¶
Re-running overwrites the previous image
The file is always written as <GameObject name> AutoGeneratedImage.png next to the prefab. Generating again — or generating a Back View after a Front View for the same prefab — silently replaces the existing file. If you want to keep a variant, rename it before you generate the next one.
A few more things worth knowing:
- Objects that are not prefabs, and imported Model assets (the
.fbxitself, rather than a prefab built from it), stop the run dead. Everything selected before the offending object gets an image; everything after it is skipped silently — and so is the cleanup step, so aPreviewLightingPrefabobject is left behind in your scene for you to delete. Select only real prefab assets. - Icons are for the inventory. Nothing in the Mod Tools scales them down for you, so keep an eye on how many 512 × 512 sprites your mod ships — see Optimization.
Sounds¶
Fireworks Mania behaviours never reference an AudioClip directly. They store a sound name as a plain string, and the game resolves that name to a GameSoundDefinition at runtime. That indirection is what lets your firework use the game's own explosion recordings without shipping them in your mod.
The one place you do assign clips directly is MapDefinition's ambient day/night clips — see Custom Maps.
How a [GameSound] field really works¶
Any field that holds a sound name — Sound, Explosion Sound, Start Sound and friends on the shipped behaviours — looks like a drop-down, but it is not one. Under the hood these are plain string fields decorated with the [GameSound] attribute, and that attribute has its own Inspector drawer.
It is a button, not a drop-down
The Inspector draws a button showing the current value. Clicking it opens Unity's searchable Search Window, titled Game Sounds, where you can type to filter. It has two top-level groups:
| Group | What is in it |
|---|---|
| Fireworks Mania/ | The built-in sound names, read out of the SoundCollection assets in the project. The Mod Tools ship one, GameSoundCollection, with 121 entries |
| Others/ | Every GameSoundDefinition asset in your project, listed by asset name |
Whichever entry you pick, only the leaf name is stored in the field. Picking Fireworks Mania/IgnitedFuse_Low writes the string IgnitedFuse_Low; the group prefix is only there to organise the picker.
Because the stored value is just a string:
- Give your own
GameSoundDefinitionassets unique names — prefix them with your nick, the same way you prefix definition ids. A name that clashes with a built-in sound name is ambiguous, and you do not control which one the game picks. - Renaming a
GameSoundDefinitionbreaks every field that referenced it. The field keeps the old string and simply finds nothing. [None]is a real, valid value meaning "play nothing".[Type In]is also in the built-in list, but the drawer gives it no special meaning — picking it just stores the literal string[Type In]. Leave it alone.
Your new sound isn't in the list?
The picker builds its list once, when the property drawer is first created. A GameSoundDefinition you created a moment ago may not appear until the Inspector rebuilds that drawer — click away to another object and back, or let a script recompile happen.
Creating your own sound¶
Your own sounds are GameSoundDefinition assets, and there is one way to make them:
- Right-click in your mod's folder → Create → Fireworks Mania → Definitions → Game Sound Definition. The asset is created as
New Game Sound. - Rename it, then drag your clips into Audio Variation Clips yourself.
The asset's filename is what appears under Others/ in every [GameSound] picker in the project.
Tuning the sound¶
Volume, looping, the clip list, distance falloff, fade times and random pitch all live on the GameSoundDefinition asset. The field-by-field table is on Definitions; two of them are worth knowing before you get there.
Use more than one clip
Record — or export — the same explosion two or three times and drop all of them into Audio Variation Clips. Combined with the default ±0.1 random pitch, a rack of twelve shots stops sounding like the same sample twelve times.
Default is 3 and Ambient is 0 — check the Sound Bus on old assets
The SoundBusGroups enum is not numbered from zero, and Ambient occupies 0. Anything that ends up with a zeroed or unserialized Sound Bus field — an asset saved before the field existed, or one built by hand — reads back as Ambient, not Default. An Ambient sound is forced to 2D, which means it plays at full volume everywhere with no positioning.
If a sound in your mod is audible from across the map and does not pan, open its GameSoundDefinition and make sure Sound Bus actually says Default.
Using [GameSound] in Your Own Script¶
If you are writing a custom component, you get the exact same picker by putting [GameSound] on a string field:
using FireworksMania.Core.Attributes;
using UnityEngine;
public class MyModSoundHolder : MonoBehaviour
{
// Draws the searchable "Game Sounds" picker in the Inspector
[SerializeField]
[GameSound]
private string _explosionSound = "[None]";
public string ExplosionSound => _explosionSound;
}
The attribute only handles the Inspector side — it stores a string. Actually turning that string into audible sound is done by the game's audio system at runtime, so you cannot hear it inside the Mod Tools project.
Before you add scripts to a mod at all, read Setting Up Scripts in a Mod — there are rules about where mod scripts may live.
Where to Go Next¶
| You want to… | Page |
|---|---|
| Build a firework fast from a ready-made starting point | Templates & Sample Assets |
| Find every Mod Tools menu item in one table | Editor Menu Reference |
| Understand the definition fields your icon plugs into | Definitions |
| Keep your mod's download size sane | Optimization |
| Work out why the build failed | Troubleshooting & Build Errors |