Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Functions viewers and Packages

Discussion in 'Scripting' started by Sindaga, Oct 12, 2023.

  1. Sindaga

    Sindaga

    Joined:
    Feb 14, 2023
    Posts:
    15
    Ok so I'm working on a project and I have trouble with finding variables, the tutorial that I was watching held control and it showed all the possible variables but I was using a third party package because the unity package that they showed in the tutorial no longer exist and I asked ChatGPT and nothing, it just said IntelliSense (not like that but it said a lot of things related to IntelliSense) and IntelliSense was a C# suggestion extension that had nothing related to my problem of using a third party package and watching all the possible extension variables by just doing Control and click the class, I checked google, nothing (ok now this looks like a personal narrative lol) NOTHING WORKED TO ME. My only option is the forum now so please help me.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,317
    This isn't really a Unity thing and more down to what IDE you're using. Eg, in Visual Studio you can CRTL click on a class or struct declaration to see its definition. This may be the actual source, or a decompiled recreation if it's located in a .dll. It might be different in Visual Studio Code, though that's no longer supported by Unity, and different again in Rider.
     
    lordofduct, Bunny83 and Ryiah like this.
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,078
    Help with WHAT?

    You gave us this information:
    • you are working on a project (unspecified)
    • you need to find a variable (unspecified)
    • you are working off a tutorial (unspecified)
    • you are using a package (unspecified)
    You did not provide any specifics at all.
     
    Bunny83 likes this.
  4. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,494


    Part of me wants to hate on chatgpt right now, but I think chatgpt was not the loose link in this scenario. Run on sentences like that make it a bit difficult to even suss out what you're saying.

    From the sounds of it though, it sounds like @spiney199 has it figured out and it is an IDE thing. We'd need to know what IDE you're using though. The package and how the package was included would also be helpful.
     
    Bunny83 and Ryiah like this.
  5. Nad_B

    Nad_B

    Joined:
    Aug 1, 2021
    Posts:
    600
    Put the text cursor on the variable/method/type you want to see its definition and just press F12 ("Go to definition").
     
  6. Sindaga

    Sindaga

    Joined:
    Feb 14, 2023
    Posts:
    15
     
  7. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,317
  8. Sindaga

    Sindaga

    Joined:
    Feb 14, 2023
    Posts:
    15
    this is for everyone (part of the tutorial) so you guys know that is not me
     
  9. Nad_B

    Nad_B

    Joined:
    Aug 1, 2021
    Posts:
    600
    I already told you, put your text cursor on it and press F12. If it's your own class/method, it'll open your code file, if it's external (coming from a DLL file), it'll decompile it (using ILSpy in VS 2022).
     
  10. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,494
    I still want to know what editor/ide they're using.

    Highlighting with cursor and pressing F12 will effectively do the same as holding ctrl and clicking the text as well as right clicking and selecting 'Go To Definition'.

    That is... if you're in Visual Studio or Visual Code.

    What if they're in Notepad++??? lol
     
    Nad_B likes this.
  11. Nad_B

    Nad_B

    Joined:
    Aug 1, 2021
    Posts:
    600
    I'm afraid it'll remain one of the many unsolved mysteries of the 21st century...
     
    Last edited: Oct 17, 2023
    lordofduct likes this.