- Home /
Decompiling Unity
Hey,
is it legal to decompile Unity, for looking up things, the documentation doesn't cover?
Is there an official statement of Unity concerning this topic?
Thanks!
Answer by Bunny83 · Nov 26, 2015 at 01:24 PM
The ability to decompile / convert managed IL code into any other .NET language is a feature of the CIL itself. Even Visual studio does partially decompile referenced assemblies. MattRix even uploaded the code on a github repo with the permission of Aras. Keep in mind that the code is still copyrighted by UnityTechnologies. Decompiling is ok as long as you don't copy things and claim it's yours ^^. If you plan to extract code from there to use it in your own projects you really should contact the Unity support for getting permissions.
This might not be a good advice but as long as you keep things for yourself, nobody can blame you. However whenever you release something you should be clear about your sources and licenses.
I've also just found this question which still doesn't have an answer (so i'm going to write one ^^). I will tell him the same thing. If you want to use something from those assemblies you really should contact the support.
ps: I have ILSpy running almost all the time in the background (thinking about to adding it to the autostart :P).
Update for 2018, since that unitydecompiled is now closed, "The C# part of the Unity engine and editor source code. $$anonymous$$ay be used for reference purposes only." https://github.com/Unity-Technologies/UnityCsReference
Answer by btft · Nov 26, 2015 at 01:18 PM
Decompiling might be considered unethical, even if found legal. What I would suggest is to use reflector, such as ILSpy to look up assemblies and understand code not covered by docs.
i personally don't like ILSpy, i would use dotPeek by JetBrains
$$anonymous$$ost people seem to prefer ILSpy, but it's probably just a matter of choice. I'm not a fan of dotPeek due to it's closed source and strict license, even though dotPeek might has some features which are be missing in ILSpy. ILSpy is open source released under a $$anonymous$$IT license and only uses other $$anonymous$$IT or LGPL licensed libraries.
Haven't used it yet but as everyday user of R# I'd give it a try. :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612050433im_/https://answers.unity.com/themes/thub/images/avi.jpg)