- 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
Follow this Question
Related Questions
Load object at runtime using webplayer 0 Answers
Web service not working in Web Player build 0 Answers
Detecting Webplayer's errors from Javascript 0 Answers
WWW Request runs in Editor but not in Webplayer 1 Answer
Loading from multiple files? 2 Answers