Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How to check whether a method is binded to a Button.OnClick by Editor?

Discussion in 'UGUI & TextMesh Pro' started by Alobal17, Dec 11, 2023.

  1. Alobal17

    Alobal17

    Joined:
    Aug 2, 2019
    Posts:
    10
    Hello ~ As our project is large, I'm going to delete some useless methods.

    In the most of IDEs like Visual Studio, the CodeLens function is used to show how many times MyFunction() is referenced by others. However, the CodeLens can't detect the reference by UGUI in the Editor, which would make me mistakenly delete some callback functions.

    So, is there any way to detect whether a method is referenced by Buttons ?