USP0023 The Unity runtime invokes Unity messages
August 12, 2025 ยท View on GitHub
Don't flag incorrect naming styles for Unity messages.
Suppressed Diagnostic ID
IDE1006 - Naming rule violation.
Examples of code that produces a suppressed diagnostic
using the following .editorconfig file (forcing private methods to use camel-case):
dotnet_naming_style.camel_case.capitalization = camel_case
dotnet_naming_symbols.private_methods.applicable_kinds = method
dotnet_naming_symbols.private_methods.applicable_accessibilities = private
dotnet_naming_rule.private_methods.symbols = private_methods
dotnet_naming_rule.private_methods.style = camel_case
dotnet_naming_rule.private_methods.severity = warning
using UnityEngine;
class Camera : MonoBehaviour
{
private void OnCollisionEnter(Collision c)
{
// OnCollisionEnter should not be flagged for naming violation
}
}
Why is the diagnostic reported?
The Code Style analyzer detects a private method using Pascal-case instead of camel-case, and under normal circumstances, it would be reasonable to flag this usage given the .editorconfig instructions.
Why do we suppress this diagnostic?
The Code Style analyzer doesn't realize this is a Unity message, and therefore has no way of determining that it needs to have a specific case to function correctly.