Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    12,555
    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,110
    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...