Search Unity

  1. Unity 2019.1 is now released.
    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,761
    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:
    5,214
    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...