-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Complete guide to configuring the Atomic plugin and .atomic files.
Access via: File β Settings β Tools β Atomic Plugin
| Setting | Default | Description |
|---|---|---|
| Auto-generate enabled | true |
Automatically regenerate on file save |
| Show notifications | true |
Display success/error notifications |
| Delete old files on directory change | true |
Remove old generated files when output directory changes |
| Debounce delay (ms) | 500 |
Delay before auto-generation triggers |
When you open an .atomic file, a notification panel appears at the top with:
- Generate API Button: For first-time generation
- Regenerate API Button: For existing generated files
- Open Generated File: Quick navigation to generated code
- Delete Generated File: Safe deletion with confirmation
- Status Information: Shows auto-generation state
- Error State: Red panel when validation errors exist
- Info State: Blue panel showing generation options
- Clear Messages: Explains current state and available actions
- When enabled: Code regenerates automatically on save
- When disabled: Use Ctrl+Shift+G for manual generation
- Recommendation: Enable for active development, disable for large projects
- When enabled: See popup notifications for generation results
- When disabled: Check Event Log for results
- Recommendation: Enable to catch errors quickly
-
When enabled: Old generated files are deleted when you change
directoryorclassName - When disabled: Manual cleanup required
- Recommendation: Enable to avoid orphaned files
- Range: 100-5000ms
- Lower values: Faster feedback but more CPU usage
- Higher values: Less CPU usage but slower feedback
- Recommendation: 500ms for most projects, 1000ms+ for large files
These must be present in every .atomic file:
entityType: Entity # The base type for entities
namespace: Game.Components # Target namespace
className: EntityExtensions # Generated class name
# Output location
directory: "Generated"
solution: "MyGame.sln"
# Performance options
aggressiveInlining: true
unsafe: false
Note: The header property was removed in v0.1.4. Generated files now include a standard auto-generated header automatically.
/YourProject
/Components
- Player.atomic
- Enemy.atomic
/Generated # Generated files go here
- Player.cs
- Enemy.cs
/Assets
/Scripts
/Components
- Player.atomic
/Generated
- Player.cs
/Plugins
# Third-party code
/Solution
/Shared
/Components # Shared .atomic files
/GameClient
/Generated # Client-specific generation
/GameServer
/Generated # Server-specific generation
Optimize for iteration speed:
aggressiveInlining: false # Faster compilation
unsafe: false # Safer debugging
Plugin settings:
- Auto-generate: Enabled
- Debounce: 300-500ms
Optimize for runtime performance:
aggressiveInlining: true # Maximum performance
unsafe: true # If needed for hot paths
Plugin settings:
- Auto-generate: Disabled (manual control)
- Debounce: Not relevant
Control type resolution with imports:
imports:
System # Basic types
System.Collections.Generic # Collections
UnityEngine # Unity types
MyGame.Core # Custom types
Types are resolved in this order:
- Fully qualified names in values
- Imported namespaces (top to bottom)
- System namespace (implicit)
- Project global usings
# Same as source file (default)
# directory: not specified
# Relative to project root
directory: "Generated"
directory: "Scripts/Generated"
# Parent directory
directory: "../Shared/Generated"
# Absolute path (not recommended)
directory: "C:/Projects/Game/Generated"
Generated file name = {className}.cs
className: PlayerComponents
# Generates: PlayerComponents.cs
className: EntityExt
# Generates: EntityExt.cs
Create Debug.atomic:
entityType: Entity
namespace: Game.Debug
className: DebugComponents
directory: "Generated/Debug"
values:
DebugInfo: string
ProfileData: float[]
Create Release.atomic:
namespace: Game
className: Components
entityType: IEntity
directory: Generated/Release
aggressiveInlining: true
unsafe: true
# Same components without debug data
namespace: Game
className: Components
entityType: IEntity
values:
- Health: int
namespace: MyGame.Components
className: GameComponents
entityType: GameObject
directory: Generated
aggressiveInlining: true
imports:
- System
- UnityEngine
- System.Collections.Generic
- Atomic.Entities
tags:
- Player
- Enemy
- Interactable
values:
- Health: int
- Position: Vector3
- Name: string
namespace: Game.Components
className: FastComponents
entityType: IEntity
aggressiveInlining: true
unsafe: true
imports:
- Atomic.Entities
- UnityEngine
values:
- Position: Vector3
- Velocity: Vector3
# Use ref returns for hot paths
Enable all checks:
- Type validation
- Duplicate detection
- Import validation
- Namespace verification
For prototyping:
- Disable auto-generation
- Use manual generation
- Fix errors as needed
Customize colors: Settings β Editor β Color Scheme β Atomic
Create template: Settings β Editor β File and Code Templates
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")namespace ${PACKAGE_NAME}#end
entityType: ${EntityType}
namespace: ${Namespace}
className: ${ClassName}
tags:
${Tag1}
values:
${Value1}: ${Type1}
Create snippets for common patterns:
# Abbreviation: "val"
# Template:
$NAME$: $TYPE$
Exclude generated files from analysis:
<ItemGroup>
<Compile Remove="**\*.generated.cs" />
<None Include="**\*.generated.cs" />
</ItemGroup>Generate during build:
# Pre-build step
rider generate-atomic **/*.atomic
# Build
dotnet build- Start Simple: Begin with minimal configuration
- Profile First: Measure before enabling unsafe/aggressive
- Organize by Feature: Group related components
- Document Choices: Comment why certain options are enabled
- Version Control: Track .atomic files, not generated code
If configuration isn't working:
- Check syntax errors
- Verify required fields
- Test with minimal config
- Check plugin settings
- Review logs for details
See Troubleshooting for more help.