Quick answer: Apply [GlobalClass] to register at compile time. Don’t rely on static constructors for registration — the editor scans before they run. Build the project after adding the attribute.
You add a custom Resource class. Inspector’s New Resource menu doesn’t show it. You added a static constructor that calls some registration helper; it doesn’t run at editor cold-start.
The Symptom
C# class compiles fine but isn’t available in the Inspector dropdown for creating new instances. Or only available after running the project once.
The Fix
using Godot;
[GlobalClass]
[Tool] // optional, for editor-active behavior
public partial class EnemyDef : Resource
{
[Export] public int Health { get; set; } = 100;
[Export] public string DisplayName { get; set; }
}
Build (Ctrl+B). Inspector’s “New EnemyDef” appears in the resource picker.
Custom Editor Categories
You can specify a category and icon:
[GlobalClass, Icon("res://icons/enemy.svg")]
public partial class EnemyDef : Resource { ... }
The icon shows in the Asset Browser, making custom resources visually distinct.
Verifying
After Build, right-click in FileSystem → New Resource. Search for your class name. It should appear. Confirms registration.
“[GlobalClass]. Build. Class is registered.”
Related Issues
For C# Resource references after rebuild, see references after rebuild. For C# Export Array, see Export Array.
Attribute. Build. Type registers.