Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Debugging into Unity DLL

Discussion in 'Editor & General Support' started by amiga4K, Oct 13, 2018.

  1. amiga4K

    amiga4K

    Joined:
    Jan 30, 2018
    Posts:
    19
    Hello, I'm making a little game in Unity and I want to use
    Visual Studio debugger to step into Unity DLL (i.e. UnityEngine.dll)
    to learn how some things are implemented.
    However when I use in debugging F11 the code "jump over" and doesn't go
    into Unity inner statement...
    Is there a way to make that?
    Thanks.

    For example if I write Debug.Log("X"); and I want to have a look inside Log method
    when the debugging step reaches this statement...
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    13,026
    Unity's source code is a combination of C++ and C#. Code written in C++ can't be viewed without a source license but you can view the C# code at the following official repository. Just don't be too surprised when you open the source with the method you want to examine only to discover the method is one line calling C++. It's a common occurrence.

    https://github.com/Unity-Technologies/UnityCsReference
     
    Last edited: Oct 13, 2018
    Kiwasi likes this.
  3. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    4,529
    What are your end goals here? As Ryiah stated, there's a lot of C++ calls that you can't get access to without source access, so maybe there's another way to accomplish your specific goal?
     
  4. amiga4K

    amiga4K

    Joined:
    Jan 30, 2018
    Posts:
    19
    Yes I know! My goal is only to debug programs easier..
    Take a look a this post for a more complete example. It's good but not very comfortable.
    JetBrains Rider make the stuff I want but I have Visual Studio, that's free, and I don't want spend money...