Automating the download and import of assets bought on assetstore

I would like to automate the download, import and configuration of certain assets that I bought on the asset store, i.e. there are certain assets that I basically use in each Unity project, therefore instead of installing and configuring them manually each time I would like to automate that.
I found the PackageManager.Client API that is explained here:

However, this API seems to only allow to download packages from the Unity registry and not from the asset store.
Therefore I would like to know how i can automate the downloading and importing from assetstore assets.
Has anybody done something like that?
Is it even possible using official APIs?

does really nobody know any way to automate/script the process of downloading and setting up assets that were purchased through the assetstore?

Hey there,

We can’t find an API to do this at present. The team reading the documentation about it see that it’s something you may be able to implement yourself.

Downloaded assets are present in the hard drive, in the article below, you can find where they are located: Once you have downloaded your Assets, they can be found in the following locations:

Windows - User>AppData>Roaming>Unity> Asset Store
Mac - User>Library>Unity>Asset Store

with these, you can then install it with AssetDatabase.ImportPackage

1 Like

While this thread is a bit older it might still be relevant to others: I had the same issue and created a new Unity asset which actually does exactly this, bulk package installation (including adding the needed registries is applicable) as well as asset installation, download and even searching inside assets without importing everything.

Check it out here and feedback/ideas always welcome: Asset Inventory | Utilities Tools | Unity Asset Store

Can you add an option to export a script to auto import certain packages? clearly you are having more success than the rest of us at automagically installing wanted faves in a project

my current workaround is to use custom project init script,
that allows import my predefined favorite packages too,
example video here: https://discussions.unity.com/t/674520 page-2#post-9728290

Yes, im trying to find out how to add the packages… the code for the auto setup you can download says

        [MenuItem("Tools/Initialize Project")]
        public static void Init()
        {
            assetsFolder = Application.dataPath;

            CreateFolders();
            // TODO adjust project settings, linear, company name
            // TODO remove extra packages
            // TODO setup light settings
            // TODO adjust mainscene: camera pos, skybox off?
            // TODO save mainscene
            // TODO add mainscene to build scenes list
            // TODO adjust quality settings (but only in mobile?)

            // TODO self destruct this editor script file?

            // refresh folder
            AssetDatabase.Refresh();
        }

Hence, trying to find how to add assets and packages!!!

for unity registry packages,
i append them into “packages.json”, so then unity imports them:
i have only 1 favourite now (vs studio package)
https://github.com/unitycoder/UnityInitializeProject/blob/main/Assets/Editor/InitializeProject.cs#L20
then append to json here,
https://github.com/unitycoder/UnityInitializeProject/blob/main/Assets/Editor/InitializeProject.cs#L408
*only problem with that is that i don’t know what is the latest available version… (so need to manually keep that list updated for now, like vs studio is v2.0.22)

for purchased asset store local *.unitypackage’s, it currently happens here, with AssetDatabase.ImportPackage()
https://github.com/unitycoder/UnityInitializeProject/blob/774517faa6f52fbd3ab808331493a2fbc8a3fa6f/Assets/Editor/InitializeProject.cs#L353

That feature is basically there. You can bulk install any group of assets either by category or tag with a single click. Even assets and registry packages mixed in one go. Is this what you need?

9784437--1403625--upload_2024-4-21_17-42-45.png

well. now im even more confused…

cos i told unitylauncherpro to make projects and it did nothing other than make some basically empty folders, didnt add them to project list, didnt copy the init file in and didnt open it… this is why i am getting to old and impatient for this stuff…

So, you can add items in your thing does it save them for next time??

how is it 2024, with unity working on its 13th major release and we still cant do basic simple “start default project with” options?

but you have to installed asset inventory :stuck_out_tongue: which we all know we havent done at the point in question :smile:

True. I have seen one asset a while back which had a “set as default for new projects” button. There seems to be SOME mechanism to influence the project defaults. I have it in my backlog to investigate and will post here once I find it.

1 Like

Hey, I ran into this exact problem myself each time when i create a new project, and have to search and import assets one by one.

I recently published a Unity editor tool “Asset Importer PRO” that tackles this issue by letting you organize the Asset Store assets you own into groups and batch-import them in parallel with a single button.

One of the biggest benefits using this was avoiding repeated recompiles, importing everything in batches instead of one by one ended up speeding up project setup/import times by roughly 5–10×.

Asset Store link (in case it helps): Asset Importer PRO | Utilities Tools | Unity Asset Store
Demo Video : https://youtu.be/vJv-yYZuG4k

Happy to answer questions if anyone’s curious about how it works.

kinda like it, things like it downloading but not knowing its finished seem a bit clunky, and, im puzzled by your statistics.. however, I dont really want to pay all that to find out it doesnt work with 13k+ asset packages.. for example, much as I loved asset inventory, due to needing to download, install, process each package, it took over 2 days …

1 Like

its been tested across multiple pcs, and editor versions of 6000.0+, and its also stress tested by importing 500 assets continuously without any problem. Im working on the clunky download status problem and some other features, but overall its working good.
The statistics are also true, i’ve factored in both the time to find the package we want to import, and the time to import. The “Asset Importer PRO” imports the packages in parallel, and with delayed recompile mode, so that it only recompiles minimal number of times rather than after each package import, So the 5-10x speed is indeed real.

OK, now while I dont intend to import anything like that number of assets

image

I do own a lot of assets from the store, so, im curious on the overhead of that

Woahh!! a senior unity developer, you own 1/10th of the Assetstore.

there shouldnt be any problem even with importing all the assets you have, only that, during importing some 7000th package, your system might be out of memory.

Also worth keeping in mind: some packages include their own dependencies, and different assets can reference different versions in their package.json, so version conflicts are definitely possible.

I think this use case is different, Asset Inventory takes time to index assets for single(!) file import.

But when you just want to bulk import whole packages, you can do so easily by just importing the selection. I added also custom actions that will prompt you to bulk import your favorite packages with a single click after importing AI3, making it super efficient to boot-strap new projects.


1 Like

Asset Inventory is stella, because it allows you to search for any “red car” or whatever, and it will go find that, rather than depending on it being in the name or even description of the asset. Which is highly useful.

I am curious how asset importer works, as although ive got 13k assets, a lot of them frankly arent worth a single byte of disk space.. either because they never were any good, or are so far out of date now, if they arent in a project they never will be.

So, does Asset Importer allow you to hide/delete/ceremonously burn whatever terminology feels applicable (in my case mark as s**t) so you dont accidentally include them in things?

oh and how does it handle additionally got assets eg, please dont make me reimport all 13k again

theres an option to hide depreciated assets, but if you are talking about manually hiding assets that you are not going to use, its not available yet, but will definitely add it in the next release.

Not sure what you meant by “Additionally got assets”, do you mean removing the imported assets from the project?