What problem does it solve?
This Skill addresses common pitfalls and best practices in Unity C# development, helping you write more performant, maintainable, and bug-free code.
Core Features & Use Cases
- Naming Conventions: Enforces consistent PascalCase and camelCase for improved readability.
- MonoBehaviour Lifecycle: Explains the execution order and correct usage of lifecycle methods like Awake, Start, Update, etc.
- Coroutines vs. Async/Await: Guides on choosing the right asynchronous pattern for your needs.
- LINQ and GC: Provides strategies to avoid garbage collection spikes in performance-critical code.
- Serialization Attributes: Details how to use attributes like
[SerializeField], [Header], and [Range] for better Inspector integration.
- Null Checks: Highlights the nuances of null checks with Unity Objects and provides safe alternatives.
- Events and Delegates: Demonstrates patterns for event handling using C# events and UnityEvents.
readonly vs. const: Clarifies the differences and best use cases.
- Common Anti-Patterns: Identifies and offers solutions for frequent mistakes like
Find in Update or inefficient instantiation.
- String Handling: Offers GC-safe methods for string manipulation in hot paths.
Quick Start
Explain the correct way to cache components in Unity using the Awake method.