[Resource] Unity Decompiled

Thought I'd share this. Helps me a lot with editor scripting.

https://github.com/MattRix/UnityDecompiled

Comments

  • Having decompiled Unity source is great. I typically use ILSpy for it, the same tool the creator of that repo used, and it's useful for any other dlls you may be using (plugins etc).

    http://ilspy.net/
    Thanked by 2Elyaradine SUGBOERIE
  • I'm a noob. :P What sorts of things do you use this for in the editor that you can't normally get to?
  • @Elyaradine, The other day we were trying to make an editor script to automate some lighting stuff - but the normal lighting API didn't expose all of the properties that were in the lighting window (no idea why). So the easiest way to see how to set those was to find the code for the lighting window and set it the same way.
    (We ended up just parsing the .scene file manually and doing it there, but you get the point)
    Thanked by 1Elyaradine
  • @Elyaradine

    There is no mention of SceneView in the docs.

    I found out about it in some obscure tutorial and I needed to know more.

    SceneView.onSceneGUIDelegate += YourMethod;

    You can attach a method to it that is called every time the scene is refreshed by Unity. OnSceneGUI() is only run if that object is selected. So, what I wanted to do was snap objects while I moved them in the scene thus the method to snap objects needed to keep being called without me having to select the gameobject with the method.
    Thanked by 2Elyaradine mattbenic
  • edited
    @Elyaradine one of the most useful use cases for me was determining how Unity implemented some of their Mathf and Vector3 functions. It's a bit hit and miss, as sometimes these are just a wrapper to C++ code, which you can't see - but a surprising amount is written in vanilla C#.
    Thanked by 2mattbenic Elyaradine
  • @Elyaradine I've used it in the past to determine exactly why something is causing a performance hit when I don't expect it to.
    Thanked by 1Elyaradine
Sign In or Register to comment.