Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How To Clean Project , Delete temp files, etc?

Discussion in 'Scripting' started by Kai, Jun 4, 2009.

  1. Kai

    Kai

    Joined:
    May 28, 2009
    Posts:
    24
    I'm getting a weird bug where my project is executing code that's no longer in the CS files.

    Anybody know how one manually cleans out the unity generated assemblies/project files?

    (Re-import all assets doesn't seem to do it.)

    Edit:
    Doh! NM. This was an issue with a dynamically (from code) generated object apparently being saved to the scene hiearchy for some odd reason.
     
  2. apalombaML

    apalombaML

    Joined:
    Jan 14, 2021
    Posts:
    1
    I would still like to know how to do a clean build of project. Can someone please post this?
     
  3. Bunny83

    Bunny83

    Joined:
    Oct 18, 2010
    Posts:
    521
    Unity does not have build artifacts that need or could be cleaned up. Unity does create a temporary staging folder where the build is performed in which is deleted once the build process has finished. The Unity project itself does not really have any cleaning options. Sometimes it's possible that the assetdatabase gets corrupted. In this case you could delete the Library folder after you created a backup of your project while the Unity editor is closed. When you restart Unity, the editor will recreate the database from the assets and their meta files.

    Removing of old or unused assets has to be done by yourself. Though unused assets usually do not affect the project unless they are inside a Resources or the StreamingAsset folder.
     
    Kurt-Dekker and Joe-Censored like this.
  4. seejayjames

    seejayjames

    Joined:
    Jan 28, 2013
    Posts:
    345
    My understanding is that you can safely delete the Library folder anytime (while Unity is closed of course). I have my students do this to save huge amounts of space in the project .zip files they turn in. Never had a problem with rebuilding. The Library is often many times the size of the rest of the project (which is mainly the Assets folder), so if you're using big asset packs, it rapidly soars into many GB...totally wasted space when transferring projects or saving archived versions.
     
  5. Bunny83

    Bunny83

    Joined:
    Oct 18, 2010
    Posts:
    521
    Yes, you usually can safely delete the library folder. In the past the meta files were optional. If you hadn't enabled them you would have lost all asset references. However for some time now meta files are always enabled. For version control you never had included the library folder as it contains local information that wouldn't work on other machines. The library essentially contains the imported and cached versions of the assets. The import configuration for each asset is usually stored inside the corresponding meta file.
     
    seejayjames likes this.
unityunity