Conditional compilation if an asset is present

I apologize if this isn’t the correct section to ask this question. I wasn’t sure where to post it.

Here it my problem : I released an asset on the Asset Store. I would like to release a second asset that can optionally make use of the first asset if present but can also work on its own if not. That means conditional compilation. I need a way to define a symbol if the first asset if present and use it to enable/disable parts of the code of the second asset.

I looked though the Assembly definitions documentation but I couldn’t find a solution there. It seems I could create an assembly definition for my second asset and use it to define a symbol if my first asset is present (as explained here). But it doesn’t work. My first asset is not listed as a package. Assets sold on the Asset Store are not package, they’re just files added to the project.

I also tried creating a package.json file for my first asset but that didn’t change anything.

Is there a way to do this? Thanks.

Yes, you can only add Version Defines for packages. You can convert your assets to packages with the help of this tool. I don’t use it myself, but people mentioned on the forum that they use it.

Or you can write your own installer that will install your product from Assets to Packages folder. But I should warn you that both these methods are very risky and your customers will have to remove the old version of your product completely before installing a new one.

Thank you KirillKuzyk.

This is disappointing to say the least. I wish Unity would allow us to publish packages on the asset store. But I will have to live without it for now.