Using Visual Studio to Find Whether a Method is Referenced in Inspector

For example, a UnityEvent is used to refer to a public method (e.g. the methodname is OnAlertTriggerChange) in the Inspector:

Is there a way to detect that Inspector reference with Visual Studio?

7873141--1000834--upload_2022-2-6_20-43-7.png

Nope. Visual Studio has no idea about this kind of reference, which is achieved via reflection.

1 Like

Honestly one of the biggest downsides of navigating a big project. The more stuff is serialized the harder it is to find where some functionality is. Is there any way this could be improved via some visual studio add-on or smth?

I do believe the Rider integration is aware of this kind of reference, and the newest VS integration might be too, it’s been a while since I used VS now.

Rider is not only capable of it but comes with it enabled by default. You can even see that it’s tracking the value of the field in my screenshot.

Screenshot

9102577--1261678--upload_2023-6-24_13-16-44.png

I’m less familiar with VS for the same reason but from what I’ve heard you can’t. Of course even if you could you wouldn’t be able to do it with the free VS Community. You’d have to pay for VS Professional or VS Enterprise as references shown via CodeLens aren’t available in the free tier.

https://discussions.unity.com/t/874756

1 Like