Skip to content

UNT0021 falsely flags StateMachineBehaviour messages #187

@Faulo

Description

@Faulo

Bug description

UNT0021 (Unity message should be protected) claims the various StateMachineBehaviour messages should be protected, but those methods are declared public by the Unity source code itself and therefor cannot be made protected upon extension.

  • Version of analyzers assembly: 4.11.4.0
  • Analyzer rule: UNT0021
  • Error: CS0507 cannot change access modifiers when overriding inherited member

To Reproduce

Steps or code to reproduce the behavior:

  1. Create a script that extends UnityEngine.StateMachineBehaviour.
  2. Override the public OnStateEnter message.
  3. See the (impossible) suggestion to turn it protected.

Expected behavior

UNT0021 should never flag messages that are declared public in the Unity source code.

Screenshots

At least these messages are affected:
grafik

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions