• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by PictonicStudio · Sep 14, 2013 at 11:09 AM · corruptedcorruptdecompile

Unity crashed and corrupted a huge .cs script.

The problem: I have a corrupted script that shows up blank in MonoDevelop, and a bunch of nulls in Notepad++. alt textalt text

What I have tried: I've tried version $$anonymous$$story, but I don't t$$anonymous$$nk my file has that. I've searched for how to de-compile a unity project (I have a recent build) to retrieve my script, but none of that has worked yet.

help1.jpg (40.0 kB)
help2.jpg (51.9 kB)
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jamora · Sep 14, 2013 at 11:26 AM 0
Share
avatar image ArkaneX · Sep 14, 2013 at 11:38 AM 1
Share
avatar image DannyB · Sep 14, 2013 at 11:47 AM 1
Share

4 Replies

· Add your reply
  • Sort: 
avatar image
13
Best Answer Wiki

Answer by PictonicStudio · Sep 14, 2013 at 12:12 PM

So I found the answer. And I hope I help someone on their quest.

  1. You need to download t$$anonymous$$s software http://ilspy.net/ (click download binary)

  2. Once installed and opened click File->Open

  3. Navigate to MyBuildFolder/MyBuild_Data/Managed and open Assembly-CSharp.dll and Assembly-UnityScript.dll

  4. Click the search icon on the top and search for your script name. And viola it should be there.

Hope that helped, peace.

Comment
Add comment · Show 10 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DannyB · Sep 14, 2013 at 12:22 PM 0
Share
avatar image ArkaneX · Sep 14, 2013 at 12:54 PM 0
Share
avatar image Bunny83 · Sep 14, 2013 at 01:27 PM 0
Share
avatar image ArkaneX · Sep 14, 2013 at 01:47 PM 0
Share
avatar image PictonicStudio · Sep 14, 2013 at 02:05 PM 0
Share
Show more comments
avatar image
12

Answer by ArkaneX · Sep 14, 2013 at 11:59 AM

If you have a recent build, then you can decompile it. Here's a short info how to do it on Windows.

After building a project, you have an exe file, let's name it MyGame.exe, and folder MyGame_Data. Inside t$$anonymous$$s folder there's subfolder Managed, containing the compiled Unity assemblies. Those interesting you are:

C#: Assembly-CSharp.dll, Assembly-CSharp-firstpass.dll

JS: Assembly-UnityScript.dll, Assembly-UnityScript-firstpass.dll

Your code is most probably inside an assembly without firstpass in its name.

To decompile, download any .NET decompiler. I suggest free ILSpy or trial version of .NET Reflector. After opening decompiler, drag the assembly and just browse to desired file. If your class was contained wit$$anonymous$$n namespace, then it will be accessible under t$$anonymous$$s namespace. In other case, it should be under empty namespace (minus sign). Clicking the class should open it in disassembled form, though if I remember, in .NET Reflector you have to double click it or right click and select Disassemble.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image PictonicStudio · Sep 14, 2013 at 02:10 PM 0
Share
avatar image ArkaneX · Sep 14, 2013 at 02:17 PM 0
Share
avatar image Hsni · Mar 08, 2019 at 07:45 AM 0
Share
avatar image
4

Answer by moghazy · Apr 06, 2014 at 01:07 PM

If you have a corrupted scripts only and you don't have a building project t$$anonymous$$s is the solution w$$anonymous$$ch is similar to PictonicStudio solution:

  1. Download t$$anonymous$$s software **http://ilspy.net/** (click download binary)

  2. Once installed and opened click File->Open

  3. Open Assembly-CSharp.dll on the root folder of your project.

  4. Congrats! your scripts is here now :)

I just faced t$$anonymous$$s issue and i hope if it will help you too.

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image PictonicStudio · May 07, 2015 at 07:41 PM 0
Share
avatar image Bunny83 · Jul 28, 2015 at 11:04 AM 1
Share
avatar image aleichert · Apr 06, 2016 at 03:18 PM 0
Share
avatar image Dave-Carlile aleichert · Apr 06, 2016 at 03:23 PM 0
Share
avatar image aleichert Dave-Carlile · Apr 06, 2016 at 03:57 PM 0
Share
avatar image hitarthdoc1994 · Jun 06, 2016 at 08:03 AM 0
Share
avatar image
0

Answer by Xeonce · Jun 22, 2016 at 05:59 AM

Big, big Thanks to you!!

You have saved me from over 30 hours of work, cause i have deleted all my original scripts by mistake, without backup, and on a ssd..

I have tried a backup tool, but t$$anonymous$$s also has failed.

Without you i were not so happy in t$$anonymous$$s moment as i am now. :-)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Corrupted/disarrange 2D Texture after app is built 0 Answers

Character Motor Script Corrupted 1 Answer

Corrupted lightmap 1 Answer

Unity scene completely broken. How to recover? 0 Answers

Localizing level0 file 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges