Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Unity ugly project structure

Discussion in 'Unity Reflect' started by mgazisalik, Jan 28, 2021.

  1. mgazisalik

    mgazisalik

    Joined:
    Jan 19, 2019
    Posts:
    16
    The most difficult thing when working in Unity is not being able to master the project structure. Of course, we can master what is in the project without installing any packages. In my opinion, if we have included a package in the project, this package should be located outside of the project or stored in a folder named "external packages". Also, when I look at the folder names, the names of these folders are not the same as the package name. In addition, some packages can be exıst in the project as 2 folders. Firebase as an example.

    Screen Shot 2021-01-29 at 00.46.55.png

    Let me give you an example. Some packages have files in the plugins folder. However, other packages have files. Thus, the project structure starting to get complicated.

    Screen Shot 2021-01-29 at 00.47.09.png

    In addition, other packages can interfere with the Android folder. Thus, the Android folder is starting to get complicated as well.

    Screen Shot 2021-01-29 at 00.47.39.png

    Also look at the iOS folder;

    Screen Shot 2021-01-29 at 00.47.50.png

    As you can see, it is not clear to which package some files belong here. Maybe some files are unnecessary but I do not intervene in order not to ruin the project. Maybe I'll get an error in the project and this error can be related to one of these files. However, I may not know which package this file is for, or it may take me a lot of time to learn.

    In addition, packages intervene in the Resources and StreamingAssets folders. However, these folders can get complicated with every new package addition.

    Screen Shot 2021-01-29 at 00.48.21.png

    I want to express my views on this subject. None of us start developing Unity professionally. Even if we have done advanced development on the other platform in the past, we do not want to be confused when starting to develop on a new platform.

    All packages added externally should be collected in a folder named "External Packages". Packages should not create two folders, they should have just one folder. Each package should have its own Plugins, Resources, and StreamingAssets folder.

    Also, when I want to add a component to an object, I should know that the scripts come from outside. In other words, when adding a script to the object, it should write "from external packge" or "from ... package".

    A global definition file can be placed in the project to get the assets of external packages in Plugins, Resources and streamingsAsset folders. For example, whichever package is included in the "globalResources" file, the file directory of that package can be written. I think this situation is important during the build phase.

    Some developers said that this situation is related to the creator of the asset's package. However, the person writing the asset package may not be a very good developer. If Unity had prevented this, it would have had to write the package properly.

    Some developers also said that we can do this ourselves, that is, we can edit the package files ourselves. However, I got too many errors when I tried this. Also, this is not best practice. When we want to update the package, the file structure will change again.

    Please think about this situation a little bit. I think the reason this issue bothers me is that I developed projects with nodejs in the past or I am currently writing projects with golang. The packages and the project are completely separate in these languages. In fact, this is the case in most programming languages.

    I know the situation may be a little different in Unity. For example, some packages may contain the game itself. Then Unity should give us a choice, "Whether this package is included in or outside of the project".

    Unity should set a standard in this matter. Otherwise, those who write asset packages will continue to create assets in the same way.
     
    Last edited: Jan 28, 2021
unityunity