4
\$\begingroup\$

I've seen a couple different answers or weird workarounds to this topic: Package folders usually just go straight into the Assets folder, pretty much turning everything into a huge mess.

Here's a related but old question to this: Import Unity Package Into Specific Folder

I can't imagine that there is no way to clean this up without doing weird workarounds like that. Do professionally developed games like Rust and Yooka-Layle really just have a messy Assets folder?

I've read that moving the folders will cause problems down the line, if packages have hard-coded paths or during updating. This info is a few years old by now, is that still a real concern?

I'm currently getting to a point where my Assets folder contains more external packages (NuGet, TextMeshPro, Ink, etc, etc) than my own, and its getting fairly chaotic.

Can I move my external packages to a different folder?

(Out of curiosity: how do large game productions handle this? Do they just live with the chaos?)

\$\endgroup\$
3
  • 3
    \$\begingroup\$ I usually go the path of least resistance and create separate folders "_MyStuff" and "_ThirdParty" under "Assets" where I put anything that is not from a package. The _MyStuff folder is also the level where I start using version control. \$\endgroup\$
    – Philipp
    Sep 5, 2022 at 9:10
  • \$\begingroup\$ @Philipp that was my first instinct too, but I'm not exactly happy with it, since the "Assets" folder is already intended to be that folder. I'm kind of surprised how issues like these seem to still be unresolved in Unity, or at least how its fairly hard to find clear answers - even in the forums. I mean, this is literally an issue everyone would run into by default. \$\endgroup\$
    – Katai
    Sep 5, 2022 at 10:03
  • \$\begingroup\$ I tend to import packages into blank projects then move stuff over, putting it where I want it. Depending on what source control you're using, you can set this up as some kind of branch operation which makes dealing with updates cleaner. Never had a problem with packages breaking when they're moved, but I'd imagine it'd be easily fixed it there were hardcoded paths in something. \$\endgroup\$ Sep 9, 2022 at 12:03

1 Answer 1

3
\$\begingroup\$

The Assets folder is a root folder where you put all of your assets (whether you've developed them or they're from a third-party). How you organize files within the Assets folder is up to you. My Assets folders usually end up looking something like this:

Assets/
    AcmeGames/
        SomePackage/
            Examples/
            Scripts/
            Textures/
        SomeOtherPackage/
            Scripts/
    {MyStudio}/
        Shared/
            Scripts/
        {MyGame}/
            Animations/
            Audio/
            Meshes/
            Scripts/
            Shaders/
            Textures/
    XYZ Studios/
        SoundFXPackage/
            Audio/

Each package is organized into a subfolder named for the author of the package. You'll note that I organize the files for the game I'm working on into Assets/{MyStudio}/{MyGame}. I feel this approach is clean and easily to navigate; it also works best with Visual Studio's ability to automatically generate namespaces based on the folder structure. Some teams don't want to have to navigate into a subdirectory and prefer to put the folders for their game in the Assets root, usually preceded by an underscore to ensure they sort at the top of the alphabetical order:

Assets/
    _Audio/
    _Animations/
    _Scripts/
    _Textures/

I do not recommend this approach as I find it messy and it's not always obvious which assets were developed internally and which are from third-party sources.

If you have a large number of third-party packages, you can put them all in a subfolder:

Assets/
    ThirdParty/
        AcmeGames/
        Misc/
        Odin/
        Microsoft/
        Photon/
        PlaceholderSoftware/
        Unity/
        Vuforia/
        XYZStudios/

Otherwise, the only way to keep packages out of the Assets folder is to configure them for compatibility with the Unity Package Manager, so that they can be installed in the Packages folder. I've never seen a third-party asset that is configured as a Package Manager package, but in theory you can manually create Packages from third-party assets.

I've read that moving the folders will cause problems down the line, if packages have hard-coded paths or during updating. This info is a few years old by now, is that still a real concern?

I don't often encounter this as an issue. If you do run into such an issue, it's usually easy to fix. What typically causes difficult problems is if you modify any of the files in the package, since your changes will be overwritten and lost when you update the package.

\$\endgroup\$
4
  • \$\begingroup\$ I have no intention to modify the packages directly, so that shouldn't be an issue. I've just been held back by reading a lot of "don't move the package folders" advice - but it gets hard to tell what info is still outdated or up-to-date on topics like these. \$\endgroup\$
    – Katai
    Sep 6, 2022 at 10:34
  • \$\begingroup\$ "I've never seen a third-party asset that is configured as a Package Manager package" that truly baffles me. I was under the impression that's the default for any package / asset imported from the asset store... This is really messy if packages just sit in the normal project assets WHILE THERE IS A "PACKAGES" FOLDER ALREADY... \$\endgroup\$
    – Vinz
    Oct 28, 2022 at 15:21
  • \$\begingroup\$ @Vinz The Asset Store has been around for much longer than the package manager. Also, AFAIK you can't safely modify things in the Packages folder; Unity discards the changes (at least, it does that with official packages). Finally, it's not hard to just create a folder in Assets where you put all of your third party packages. \$\endgroup\$
    – Kevin
    Oct 28, 2022 at 17:24
  • \$\begingroup\$ @Kevin ah I see. I've found that you can still install some packages like this however, by manually adding to the "Packages/manifest.json" file. An example of a plugin where this can be done is NaughtyAttributes with the entry "com.dbrizov.naughtyattributes": "https://github.com/dbrizov/NaughtyAttributes.git#upm". I don't know how that works specifically, but it seems like you can setup a github repository to support this at least. \$\endgroup\$
    – Vinz
    Oct 29, 2022 at 13:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .