Back to Blog

ConstSafe Is Released: Type-Safe Unity Constants Without Runtime Dependencies

Unity ConstSafe Code Generation

ConstSafe is now released on the Unity Asset Store.

It is a Unity editor tool for generating type-safe C# references from project data that usually ends up copied around as strings: tags, layers, sorting layers, scene names, resource paths, animator parameters, shader properties, legacy input axes, and editor-defined strings.

For the first two weeks after release, ConstSafe has a 30% launch discount on the Asset Store.

View ConstSafe on the Unity Asset Store

Why This Tool Exists

Unity projects collect magic strings quickly.

A scene name gets typed into one loading script. A tag goes into a trigger check. A shader property name gets copied into rendering code. An animator parameter is duplicated across gameplay scripts. Everything looks fine until the project data changes and the compiler cannot help you.

ConstSafe is built for that specific gap between Unity editor data and code.

What ConstSafe Generates

ConstSafe scans the project and writes plain C# output for common Unity reference points. The generated files are readable, deterministic, source-control-friendly, and do not require ConstSafe at runtime.

The initial release focuses on:

  • tags, layers, and sorting layers
  • scenes and build indexes
  • Resources paths
  • animator parameters
  • shader property names and IDs
  • legacy input axes
  • editor-defined strings
  • optional Addressables helpers when Addressables is installed
  • optional New Input System helpers when the Input System package is installed

The optional generators stay out of the way unless the matching Unity packages are present.

The Workflow

The editor dashboard gives you a central place to regenerate output, preview generated files, inspect generator status, and clean up orphaned output.

That means you can keep generated constants close to the project data they represent without adding a runtime wrapper layer to the game.

If you want the deeper feature breakdown, screenshots, and FAQ, start with the ConstSafe tool page.

Launch Window

ConstSafe is available now on the Unity Asset Store. The 30% launch discount runs for the first two weeks after release, with final checkout pricing and taxes handled by Unity.

Get ConstSafe on the Unity Asset Store