Essentially when you delete an asset from your project, you’re deleting the file from your assets folder in your computers file directory. So why doesn’t it end up in the recycling bin?
Because Unity just does not talk to the recycle bin API (if such a thing even exists.) The regular file delete API does not use the recycle bin.
Unity should have an “internal” recycle bin… at least to keep the assets recoverable until you close Unity.
Can you explain further? When I delete stuff in Windows or finder, it winds up in the recycle bin/trash
That is correct. But what you do as a user is to tell the Windows Explorer to delete something, and what it does is not simply use the delete API to delete the file. You see, there’s two parts to this story:
- There is an API that can be used to delete files. The file will be just gone. No recycle bin here. That is what Unity is using.
- Second, there is a function in the Windows Explorer that can “delete” files. I put that in quotes because it is rather misleading. What it does is it moves your file into the “recycle bin” folder. This function is what you as a user can use in the Windows Explorer, but it is not what Unity is using.
- (There is a third part: When you empty the recycle bin, the Windows Explorer is calling the delete API to actually delete the files from the recycle bin folder.)
Ah right, so the equivalent is having a folder named “recycle bin” within ones project.
That actually makes sense.
Yes, something like that. Although the recycle bin in Windows Explorer has an additional feature to resolve name clashes, that is, when you delete two files that have the same name.
Even that deleted files go to trash in OSX, i still use my own “trash”. I always got these folders:
__shit
__temp
Double underscore makes them stay on top for easy finding. __shit is basically recycle bin, and __temp for temporal stuff.
I also got WebPlayerTemplates named folder where i can dump copies of scripts, and / or some third party script packs that i use only sometimes. Scripts in this folder are not compiled, so it speeds up things quite a lot in some cases.