Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Accidental file deletion

Discussion in 'Editor & General Support' started by Epimolophant, Sep 7, 2018.

  1. Epimolophant

    Epimolophant

    Joined:
    Dec 6, 2014
    Posts:
    33
    I just performed a surgical attack on myself.

    Working on a project. Hit play to test. Started having fun, pressing WASD, moving the mouse and clicking like crazy.

    Then the cursor moved outside the game area. Right clicked the Scripts folder, the context menu came up in the blink of an eye. Was still trying to move my character to the right, so I presssed D repeatedly... It went for the Delete shortcut. D also goes for the confirmation dialog that asks if you really want to delete the folder.

    Everything is gone. Even tried file recovering software. Nada. Had a backup from yesterday. Lost the day.

    To Unity guys, would you consider removing the D shortcut for deletion and the confirmation dialog? Thanks.

    Windows 10, Unity 2018.1.1f1
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,799
    Why aren't you using version control?
     
    carking1996, angrypenguin and Ryiah like this.
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    Lesson learned. Next time be more careful. Put Project window in less accessible place, or even put different tab on top of it. And don't get crazy with inputs ;)
    My Project Folder tab is often hidden replaced by another scene, or inspector.

    One day is nothing, if you come into realization, that spending week on something trivial, will make you mad.
    Surely you get some ideas,and next time yo u will improve upon.
    In the end, you did backup, which is good.
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,182
    Screw all of that. Just use version control. Commit after every change. You'll never have to worry about it again.
     
    angrypenguin likes this.
  5. Epimolophant

    Epimolophant

    Joined:
    Dec 6, 2014
    Posts:
    33
    Version control is great for coding, but I have issues using it with other kinds of files, such as textures and binaries. Do you guys use it for everything?

    Well, good news here, everything was on the trash bin. I feel stupid for not checking there first, and glad Unity uses it properly.
     
    Antypodish likes this.
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Yeah I was going to say I thought Unity would just shove deleted files into the recycle bin, since it irritates me that it actually does that. Glad it saved you :D
     
  7. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,002
    Everything.
     
    Ryiah and angrypenguin like this.
  8. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    Yes. You can exclude stuff like autogenerated files, the Library folder created by Unity, and so on. Yes, binaries can eat up space, but in theory these shouldn't change much, so it's largely a non-issue.

    Cool. You should still look into source control, though. There WILL be a time where you stop and think, "Hmm it used to work... what happened?" Then you'll be thankful that you have a history of code changes to walk through.
     
    Ryiah, angrypenguin and Epimolophant like this.
  9. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    Pretty much. As mentioned, make sure you ignore stuff that shouldn't be versioned. Once you're in the version control groove you'll wonder how you ever worked productively without it.

    Yes, binary files are unwieldy for systems like Git to handle compared to text files. But, Git handling them is still far less unwieldy than you doing versioning by hand or, worse, not versioning at all.
     
    Last edited: Sep 8, 2018
  10. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,605
    My question is why were you clicking so haphazardly in the first place honestly.
     
  11. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    This may be useful for OP, of how to setup github repo

     
  12. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    But do please note that "GitHub" is not the same thing as "Git", and that stuff hosted on GitHub is public by default .So don't accidentally give your, or other peoples', stuff away.
     
    Ryiah and Antypodish like this.
  13. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    Yes true.
    Good think in video however, is that it shows how to use desktop github, so you can have as well only local repository, without needing uploading to the server. I think is good for starters, as is simple to setup.

    @angrypenguin do you have specific suggestion / advice, or preference regarding git?
     
  14. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    Not really, aside from that bit.

    I'm no Git expert. I know it well enough to work effectively with it, and that's really about it.

    There are hosts who offer free private repos, so perhaps look around before you choose one?
     
  15. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    Darn, I had one on my mind long time ago recommended, but my brain fade out. I need reach the person back.
    I think reason I haven't used it, that all configuration was command line based.

    As of now I run repos mainly on local machine, with periodical backups on external storages.

    Thx anyway.
     
  16. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    I use Visual Studio Online. Despite the name you don't have to use it with the Visual Studio IDE, it's free for teams of up to 5 people, and there are no repo size limits which makes it particularly well suited to game projects.

    I definitely recommend getting 3rd party hosting, if for no other reason than it provides a backup of your project.
     
    Antypodish likes this.
  17. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    Thx checking now. Looks ok in first glance. Just not so fan, on using too much of M$ services ;)

    In fact I got access to hosting storage in few places. And I do occasionally store project files, usually pass worded. But not as often as on local drive backups. But indeed precautions.

    Also, since I am using VS only from early 2018, I had repo organised a bit differently before then.
    With a recent little arrangement, I have find out, that VS plays nicely out of the box with git in project folder.

    upload_2018-9-8_7-36-27.png

    Definitely I like it.
     
  18. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,182
    Antypodish likes this.
  19. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    Yeah, complete target hit in 10 ;)
    Cheers

    Yep, I do recall these restrictions, but storing mainly scripts is more than enough.
     
  20. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    GitHub is now an MS service, too.

    I don't mean somewhere online to stash files. I mean online Git hosting so that a remote copy just happens as a part of your normal workflow without you having to do anything special.
     
    Antypodish likes this.
  21. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,592
    Oh is it? Darn bugger monopolists :eek:
    I know they are taking lot of services. But thats new to me.

    I thought briefly you may be heading thoughts that direction. I got you now.
    In such case, high capacity hosting is desirable indeed.