Microsoft.Unity.Analyzers
Microsoft.Unity.Analyzers copied to clipboard
Roslyn analyzers for Unity game developers
#### Bug description UNT0008 (null propagation) also triggers when (explicit) nullable types are used for Unity types. - Version of analyzers assembly: 1.13.0 - Analyzer rule: [UNT0008](https://github.com/microsoft/Microsoft.Unity.Analyzers/blob/main/doc/UNT0008.md) - Error (exception...
#### Problem statement When read in the editor, including during playmode, the `isStatic`property of a `GameObject` instance may be true or false depending on how the object is configured in...
Static Fields and Static Event Handlers analyzers for disabling domain reload on entering playmode
#### Problem statement This feature https://docs.unity3d.com/Manual/ConfigurableEnterPlayMode.html can save users lots of time but comes with hard to identify restrictions especially if you use packages or asset store code https://docs.unity3d.com/Manual/DomainReloading.html ####...
#### Bug description A clear and concise description of what the bug is. - Version of analyzers assembly: 1.12 - Analyzer rule: USP0016 - Error (exception message, type, and callstack...
# Problem statement The need for magic strings is unfortunately widespread throughout Unity's APIs. For example: ``` animator.Play("Attack"); ``` This is inefficient because Unity has to call `Animator.StringToHash` every time,...
#### Problem statement With the new Entity Component System (ECS), users can write code that is not compatible with the Burst compiler and it causes a runtime error. The user...
`mesh.vertices` returns a copy of all vertices. If you have code like `mesh.vertices.Length`, this will be quite inefficient. It's much better to use `mesh.vertexCount` or cache `mesh.vertices` if you plan...
#### Problem statement Using `GetComponent` doesn't give any indication of what your script actually needs in the Unity Editor. That's one of the reasons I prefer serialized fields, but `GetComponent`...
It's generally recommended to cache the result of expensive calls like `Camera.main` and `GetComponent` inside the `Start` message and avoid calling them in `Update`/`FixedUpdate`. #### Proposed solution We should detect...
#### Bug description I am trying this package with Unity 2020.3.29, but it doesn't seem to work during Unity compilation. - Version of analyzers assembly: 1.14.0 - Analyzer rule: ALL...