-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add USP0020 - The Unity runtime invokes Unity messages (#273)
- Loading branch information
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# USP0020 The Unity runtime invokes Unity messages | ||
|
||
Unity messages should not be flagged as unused because Unity invokes those messages. | ||
|
||
## Suppressed Diagnostic ID | ||
|
||
IDE0052 - Private method can be removed as it is never invoked. | ||
|
||
## Examples of code that produces a suppressed diagnostic | ||
```csharp | ||
using UnityEngine; | ||
|
||
class Camera : MonoBehaviour | ||
{ | ||
void Start() | ||
{ | ||
//Some code | ||
} | ||
|
||
/// <summary> | ||
/// This reference triggers IDE0052 <see cref=""Start"" /> | ||
/// </summary> | ||
public float speed = 0f; | ||
} | ||
``` | ||
|
||
## Why is the diagnostic reported? | ||
|
||
The IDE cannot find any references to the method `Start` and believes it to be unused. | ||
|
||
## Why do we suppress this diagnostic? | ||
|
||
Even though the IDE cannot find any references to `Start`, it will be called by Unity, and should not be removed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters