Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • 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 redteardrop · Aug 16, 2012 at 04:56 AM · monodevelopsave

recover script instead of autosave?

when opening my script it asked me if I wanted to open it or the autosave it found. The auto save is the one I opened, but apparently was the wrong one and missing a LOT of my code. Is there any way to get the last save of it instead? I do have a build version with the exe and _data folder, but no idea how to turn that back into my scripts.

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
7
Best Answer

Answer by Bunny83 · Aug 17, 2012 at 05:50 PM

If the code in question doesn't contain coroutines, you can use ILSpy to decompile the assemblies from your build to C#. Just open the assemblies in ILSpy and extract the code. It can of course recover UnityScript - scripts as well, but only as C# code ;) AFAIK there is no UnityScript decompiler out there since UnityScript is an artificial language which only exists in Unity.

Just take a look into your _Data folder: _Data/Managed/

The dlls that start with "Assembly-" contains your scripts

edit

If you have trouble to get it working, upload your assemblies somewhere and post them here. I can extract them for you, but's it's actually not that hard ;)

Comment
Add comment · Show 13 · 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 redteardrop · Aug 18, 2012 at 04:58 AM 0
Share

FREA$$anonymous$$IN' AWESO$$anonymous$$$$anonymous$$ Thanks, I had some trig variables in there that were a pain to work out the first time. I originally wrote in JS, but it's not that hard to switch back over to somthing I've already done if I have the layout back. Once again, thank you!

avatar image PyroChiliarch · May 14, 2014 at 03:37 AM 0
Share

I second that, it saved me too

avatar image fammXyShea849 · Jan 28, 2015 at 02:40 PM 0
Share

If this works for me I am probably going to kill myself of pure joy.

EDIT: I just finished using ILSpy and I'm setting up the noose right now. Thank you so much!

avatar image Rickywild · Jul 18, 2015 at 03:03 PM 0
Share

Thank you for this! I do back up my project,however not frequently enough. This saved me re doing a days work of coding

avatar image huulong · Dec 21, 2016 at 05:57 PM 1
Share

Nice! It also works on projects you haven't built yet but Unity has compiled in the editor. Check PROJECT_PATH/Library/ScriptAssemblies/Assembly-CSharp.dll and its variants for Editor scripts and plugins.

CAUTION: do not reopen / focus on Unity / refresh your assets, it would recompile the code, causing you to lose the dll! Fortunately, if you have really lost a lot of code, it is likely that a class is missing, preventing Unity from recompiling. Grab that chance and make a copy of your DLLs immediately.

$$anonymous$$y problem wasn't as terrible as the others: thanks to Git stashing I kept a copy of my work of the last hour. That said, $$anonymous$$onoDevelop (combined with Unity trying to recompile I guess) deleted my file without warning and I closed the tab containing the code in RA$$anonymous$$ just at that moment. ILSpy allowed me to remember what I had done, even if comments and original variable names were removed.

Show more comments
avatar image
1

Answer by Kryptos · Aug 16, 2012 at 01:02 PM

Consider using a version control system such as Subversion or Git (which are both free). And do regular backups of your project.

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 redteardrop · Aug 16, 2012 at 01:59 PM 0
Share

That's a good idea for future issues, but does that mean I can't get back what was lost?

avatar image Kryptos · Aug 16, 2012 at 02:06 PM 0
Share

Looks like you can't recover what you lost if it is not in the autosave file.

avatar image redteardrop · Aug 17, 2012 at 03:56 PM 0
Share

I should have assumed I saved the version I needed and not worried about the autosave. oh well. I have some idea of whats missing.

avatar image
0

Answer by PDay · Sep 26, 2018 at 08:27 PM

I just had this, and it deleted my local git as well which was in the same directory (lesson learnt). I also didn't have the assembly file, however, I did have a recent build of my game (the night before), you can find a copy of the Assembly-CSharp.dll in the _Data/Managed folder.

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.

Follow this Question

Answers Answers and Comments

17 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

Related Questions

using monodevelop to print script files 2 Answers

Monodevelop freezes on saving Javascript OR C#. Critical headdesk! 1 Answer

MonoDevelop Opening New Window 1 Answer

Unity Project doesn't have solution file 1 Answer

Unity switches MonoDevelop to .Net 3.5 constantly 0 Answers


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