This site uses strictly necessary cookies. More Information
X- Home /
Getting a script from .unity3d file
Hey guys! How can I get a JavaScript script from the webplayer? I know the exact name (MazeGeneration.js) and I have the unity3d file locally but I accidentally lost the script and I haven't got it backed up :/. I really need your help guys.
David
Answer by luizgpa · Dec 07, 2011 at 02:44 PM
First you will have extract the DLL with your code. I did it once playing the .unity3d file in the Webplayer and examining the browser's memory with OllyDbg. This DLL contains the code from all your scripts (in Javascript) compiled in the same step (see Unity Docs).
With the DLL in hands, you can use a .NET disassembler, if you can understand CIL, or a decompiler like .NET Reflactor, that will generate code in a supported high level language (usually C#. UnityScript is very unlikely)
Beware that the code will lose all the comments and local variables names. Besides, coroutines will pollute a lot the code, so if you used them it may be hard to understand what's happening.
Your answer
Welcome to Unity Answers
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.