How do handle fonts and other assets that are shared among multiple scenes?
Each tool has its own Editor folder. This used to be a reasonable way to organize scripts. However, if you use assembly definitions to speed up compilation and enforce modularity, you’ll probably want to put all your editor scripts in one folder. Otherwise you’ll end up with too many asmdefs, and it will slow down compilation.
- 0 MyFiles // "0" so it is always the topmost folder
--- 0 Core // things that are used among the whole project, like extensions, editor scripts, ...
----- Scripts
--- Player
----- Scripts
----- Models
----- Textures
----- ...
--- Enemy
----- Scripts
----- Models
----- Textures
----- ...
- FromAssetStore1
- FromAssetStore2
- ...
“Enemy” and “Player” are systems, such as “UI”, “Environment”, “Weapons” and so on, and everything related to it can be found in their specific folder or the folder further up, for example:
Inside “Weapons”, there are 8 different weapons, but two of them (“Pistol” and “Rifle”) share the same sound file, then it can found in “Weapons/Sound” instead of “Weapons/Pistol/Sound” or “Weapons/Rifle/Sound”.
If there is no top folder, like for “Player” and “Enemey”, but both use the same animations, a new folder will be created, in this case “HumanoidCharacter” - where animations are stored.
There isn’t a one fits it all folder structure in my opinion but I have a few fundamentals that I follow.
I have projects that only have a Content folder with some assets in that and some that have 4 Levels of categorization of assets. But usually, I try to keep the folder structure as flat as possible. Once I find myself having too many objects in one folder that are not of the same purpose then I create subfolders.
For instance, a folder of country flags is fine in one folder. But 100 UI Prefabs I would categorize in Sliders, Buttons etc.
Also, I make use of CustomImporters sometimes, for example, to define the content of AssetBundles by location or to mark all images that are imported to a “Sprites” folder are automatically imported as Sprites.