Unity Method Analyzer¶
Detect C# inheritance issues and Unity lifecycle errors across your entire codebase.
The Unity Method Analyzer scans your project's C# files and identifies common mistakes in method overrides, Unity lifecycle methods, and inheritance patterns—before they cause runtime bugs. Use it during development to catch silent failures, missing base calls, and signature mismatches.
Table of Contents¶
- Overview
- Getting Started
- What It Detects
- Using the Analyzer
- Filtering Results
- Exporting Reports
- Suppressing Warnings
- Best Practices
Overview¶

The Unity Method Analyzer provides:
- Static code analysis without needing Roslyn or external tools
- Parallel scanning of thousands of files in seconds
- Issue categorization by severity and type
- One-click navigation to problematic code
- Export capabilities for CI/CD integration or team review
- Flexible filtering to focus on what matters
Common issues detected:
| Issue Type | Example |
|---|---|
Missing override keyword | Hiding base method instead of overriding |
| Wrong method signature | OnCollisionEnter(Collider c) instead of OnCollisionEnter(Collision c) |
| Shadowed lifecycle methods | Both base and derived class have private void Start() |
| Return type mismatches | void Start() vs IEnumerator Start() in inheritance chain |
| Static lifecycle methods | static void Awake() won't be called by Unity |
Getting Started¶
Opening the Analyzer¶
Menu: Tools > Wallstop Studios > Unity Helpers > Unity Method Analyzer

Your First Scan¶
- Open the analyzer from the menu
- Add source directories — By default, scans from the project root
- Click "Analyze Code" — Wait for the progress bar to complete
- Review results — Issues appear grouped by file, severity, or category

What It Detects¶
Issue Categories¶
The analyzer groups issues into three categories:
Unity Lifecycle Issues¶
Problems with Unity's magic methods (Start, Update, OnCollisionEnter, etc.):
| C# | |
|---|---|
| C# | |
|---|---|
Unity Inheritance Issues¶
Problems when extending Unity base classes:
| C# | |
|---|---|
General Inheritance Issues¶
Problems in your own class hierarchies:
Severity Levels¶
| Severity | Description | Example |
|---|---|---|
| Critical | Will cause runtime failures or silent bugs | Missing override hiding virtual method |
| High | Likely unintended behavior | Wrong Unity lifecycle signature |
| Medium | Potential issues worth reviewing | Suspicious method hiding |
| Low | Style or minor concerns | Non-standard access modifiers |
| Info | Informational notes | Detected patterns for review |
Using the Analyzer¶
Managing Source Directories¶
Configure which directories to scan:

- Click "+" to add a new directory
- Click "..." to browse for a different path
- Click "-" to remove a directory
- Red paths indicate directories that don't exist
Tip: Add only relevant directories (e.g., Assets/Scripts) to speed up analysis.
Understanding the Results Tree¶
The results are displayed in a hierarchical tree view:

- Expand/collapse groups with the arrow
- Single-click an issue to see details in the panel below
- Double-click to open the file at the exact line number
- Right-click for context menu options
Issue Detail Panel¶
When you select an issue, the detail panel shows:

- File path and line number
- Class and method names
- Issue type and severity
- Detailed description of the problem
- Recommended fix with specific guidance
- Base class information when relevant
Filtering Results¶
Group By Options¶
Organize results by:
- File — Group issues by source file (default)
- Severity — Group by Critical/High/Medium/Low/Info
- Category — Group by Unity Lifecycle/Unity Inheritance/General

Severity Filter¶
Focus on specific severity levels:

Category Filter¶
Focus on specific issue categories:
- All — Show everything
- Unity Lifecycle — Only lifecycle method issues
- Unity Inheritance — Only Unity class inheritance issues
- General Inheritance — Only custom class inheritance issues
Search Filter¶
Free-text search across all issue fields:

Search matches against:
- File paths
- Class names
- Method names
- Issue descriptions
Exporting Reports¶
Export Menu¶
Click "Export ▾" to access export options:

Copy Options¶
- Copy Selected as JSON — Copy the selected issue
- Copy Selected as Markdown — Copy the selected issue as readable text
- Copy All as JSON — Copy all filtered issues
- Copy All as Markdown — Copy all filtered issues as readable text
Save Options¶
- Save as JSON... — Export to a JSON file for CI/CD integration
- Save as Markdown... — Export to a Markdown file for documentation or review
JSON Export Format¶
Markdown Export Format¶
| Markdown | |
|---|---|
Suppressing Warnings¶
For test code or intentional patterns, use [SuppressAnalyzer]:
Note: [SuppressAnalyzer] is only available in test assemblies. Production code should fix issues rather than suppress them.
Best Practices¶
When to Run¶
- Before committing — Catch issues early
- During code review — Export reports for team review
- In CI/CD — Use JSON export for automated checks
- After refactoring — Verify inheritance chains remain correct
Recommended Workflow¶
- Run full scan on your
Assets/Scriptsfolder - Filter by Critical/High severity first
- Fix issues starting with Critical
- Re-scan to verify fixes
- Export report for documentation
Performance Tips¶
- Scan specific directories rather than the entire project
- Use filters to focus on relevant issues
- Close other editor windows during large scans
- Exclude generated code directories
Integrating with CI/CD¶
Export JSON reports and parse them in your build pipeline:
| Bash | |
|---|---|
Summary¶
| Feature | Description |
|---|---|
| Menu Location | Tools > Wallstop Studios > Unity Helpers > Unity Method Analyzer |
| Issue Categories | Unity Lifecycle, Unity Inheritance, General Inheritance |
| Severity Levels | Critical, High, Medium, Low, Info |
| Export Formats | JSON, Markdown |
| Suppression | [SuppressAnalyzer] attribute (test assemblies only) |