Search Unity

Imports are going to the Assets folder and not the Asset Pack folder?

Discussion in 'General Discussion' started by stoneylol, Jun 9, 2021.

  1. stoneylol

    stoneylol

    Joined:
    Mar 13, 2021
    Posts:
    2
    Hello,
    Recently i got into unity and started following multiple tutorials online. One of the main aspects i was taught was to seperate out my asset packs from my project, therefor there was an 'Assets/Asset Packs' folder where i would place an asset pack i might download from the unity store.

    I have been playing around with some assets from the store and i find that they seem to install directly to the Assets/ folder and a few large asset packs even have hard coded paths to this Assets folder meaning they cannot be moved without adjusting this hard coded path.

    Am i missing some standard implementation structure where i should be sticking asset packs directly into the Assets/ folder?

    thanks.
     
  2. sxa

    sxa

    Joined:
    Aug 8, 2014
    Posts:
    741
    Assets folder within a project is the containing folder for all assets for that project. Unity unpacks .unitypackage files into 'somewhere' below that Assets folder, with the filepath relative to that based on where they were when they were packaged.
    There is also a 3rd party package2folder tool which can unpack them somewhere else within Assets subject to the following.

    Some packages can be relocated as is. As you've found out, some have hardcoded paths, so you'd need to edit code to move them. Some have what you could call 'softcoded' paths, ie there's a single path file or whatever to change to move the Asset.
    There are also some special folder names within asset's folders that may need to be respected.

    There's no standard, and it varies a lot. Ive come to the conclusion it may be easier to have a single parent folder for all the non-3rdparty project stuff than it is to try and sort all the various third-party script assets that might be hardcoded or whatever into a cohesive, unintrusive subfolder.
     
    angrypenguin, stoneylol and JoNax97 like this.
  3. stoneylol

    stoneylol

    Joined:
    Mar 13, 2021
    Posts:
    2
    Thanks for the reply, makes sense, for now i have just changed the hard coded paths and moved them next time might just keep them in the high level folder and push everything else down one level into something like 'game/'
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    I think that's what most people do. Put all of your own content in a folder, but name it something like "___game" or "zzz_game" so that it's always at the top or bottom of the list. That will make it easy to access quickly.

    You'll find that if you move assets from their default location then you might have annoyances when you go to update to a newer version of these assets in the future. There are also some assets that have full paths hard-coded(despite that being a bad idea :rolleyes:) and these will break if you try to move them.
     
    stoneylol likes this.