Search Unity

Creating a package under Assets/ folder.

Discussion in 'Package Manager' started by hbguler, Apr 27, 2021.

  1. hbguler

    hbguler

    Joined:
    May 16, 2017
    Posts:
    8
    Is creating a package under assets folder possible? The concept of creating a package that holds small mechanics that maintained for being bug-free and fast and reusing these mechanics are attractive idea. But these mechanics are not suitable for package/ folder, can be changed etc.
    Using regular.unitypackages are hard to maintain, and hard to share.
     
    Last edited: Apr 27, 2021
    wolfyllow likes this.
  2. hbguler

    hbguler

    Joined:
    May 16, 2017
    Posts:
    8
    BUMP there are assetstore packages work like this, maybe it can be added for custom packages too.
     
  3. XenotechSrl

    XenotechSrl

    Joined:
    Dec 2, 2020
    Posts:
    5
    hbguler likes this.
  4. hbguler

    hbguler

    Joined:
    May 16, 2017
    Posts:
    8
    As far as i understand, this apporach allows CREATING source packages into assets folder. It is very usable btw, thanks for the heads up.

    But what I want is IMPLEMENTING packages into assets folder. Lets say you have a texture in your package. I want to put texture into Assets/Textures folder at importing, is this possible? No matter what I do, packages always goes to Packages/ folder when I use package manager and import my custom package.

    I am asking this because there are so many asset store packages goes to Assets/ folder when I import to any of my project. Somehow this should be possible.
     
    _eternal likes this.
  5. cassandraL

    cassandraL

    Unity Technologies

    Joined:
    Dec 7, 2017
    Posts:
    111
    You can import stuff into the Assets folder by using the .unitypackage file format.
    To do this, simply right-click on your Assets/Textures/ folder and select "Export package".
    This will open the export window, which will in turn create a new file x.unitypackage.
    This created file can be imported into any Unity project by drag and dropping it into the Project window.
    It is also the file format used on the Asset Store.
    Screen Shot 2021-06-28 at 1.05.01 PM.png Screen Shot 2021-06-28 at 3.06.17 PM.png Screen Shot 2021-06-28 at 3.06.30 PM.png
     
    zelderus, hbguler and UnityMaru like this.
  6. markmozza

    markmozza

    Joined:
    Oct 16, 2015
    Posts:
    86
    I just come accross this problem. I want to create an Asset that is not on the asset store, but distribute like a package? I have 3 projects that im building that share the same code, it would be cool to use the package manager for that.
     
    deivid-01 and croixbk like this.
  7. guycmlabs

    guycmlabs

    Joined:
    Sep 22, 2020
    Posts:
    1
  8. Volorf

    Volorf

    Joined:
    May 9, 2017
    Posts:
    9
    Hi @hbguler, have you found a solution to your problem? I'm facing the same issue and can't figure out how to move some Prefabs from a package folder to Assets (automatically).
     
  9. Volorf

    Volorf

    Joined:
    May 9, 2017
    Posts:
    9
    @hbguler

    to specify my problem — I get my packages from my git repos. There is a way to import some data from a package to the Assets folder manually as samples, but I would like to have it by default because I want to put prefabs there.
     
    Last edited: Sep 24, 2022
    hbguler likes this.
  10. KHodow

    KHodow

    Joined:
    Sep 7, 2020
    Posts:
    1
    Hey, this post was a while ago but you can use the AssetPostProcessor to move the scripts into the Assets folder! What's nice is it automatically runs after all the assets are imported, so you can just tell it to move the stuff you need!

    Unity Documentation:
    https://docs.unity3d.com/ScriptReference/AssetPostprocessor.html
     
  11. hbguler

    hbguler

    Joined:
    May 16, 2017
    Posts:
    8
    I still check the answers so thank you for your reply!

    Nowadays simply using a codebase project partially solves my problem but I'll try and see if post processor approach works.
     
  12. restush96

    restush96

    Joined:
    May 28, 2019
    Posts:
    137
    anyone know how to make dependency assets where it come from Unity Asset Store?
    It would be great saving git bandwidth.