- Home /
Is there a way to collapse all folders in the Project View?
I have given up on using the project view in any manner without doing a text search first, and that's ok with me. 19 times out of 20 it is faster. However, there are some times where it seems inescapable, such as trying to move an asset from one location to another. In that situation though, there are miles of assets between the start of the drag and the destination because every folder in between is expanded to the max.
I didn't expand them, at least not directly. I don't know all the reasons, but merely mentioning an asset in whispers over coffee tends to expand the entire tree in a 4 folder radius around it. That may be helpful sometimes, but is there a way to fold them all up at once? Or is there scriptable access to them? (i.e. foreach gameobject expanded = false).
Answer by Eric5h5 · May 24, 2011 at 08:32 PM
Holding down option/alt while opening/closing folders affects all subfolders. If you have all your folders in a root folder, then you can collapse all of them at once this way.
Thank you, I think. ;) Note that this applies to everything...for example, a public variable "`var stuff : Vector3[];`"...you can use option/alt to expand all the x/y/z components of the entire array at once, ins$$anonymous$$d of having to open each array element individually.
Really brilliant tip Eric, thanks for that!
I sent you 5 of the new "Reward Points" - wouldn't want you to have a low score on the site ;)
This is particularly useful with the new feature where you can edit more than one AudioClip at the same time, for example.
Answer by jdyeager · Nov 05, 2012 at 09:09 PM
I think Eric's answer is definitely the way to go, but just for reference there is another way to collapse all the folders in a project. You have to delete the Library/expandedItems file in your project and restart Unity.
That doesn't help anyone trying to expand all sub-folders, but if your project isn't structured with a single root folder in Assets, it might be easier than clicking all your folders to collapse them.