This Unity Editor tool automatically generates an enum based on your project's layers.
It updates the enum whenever layers are modified and ensures the file is regenerated if missing or empty.
- Auto-generates enum for all layers with their index values.
- Customizable settings: Adjust output path, namespace, and enum name.
- Automatic updates: Regenerates the enum when layers are changed.
- Open Settings:
Tools > Layer Auto Generator Settings
to customize output path, namespace, and enum name. - Generate Enum:
Tools > Generate Layers Enum
to create or update the enum. - Auto-regeneration: The enum is automatically regenerated when the layer configuration changes.
- Download or clone the script into your Unity project's
Editor
folder. - Access it from the
Tools
menu in Unity.
This tool is open-source under the MIT License.