My goal is to make reusable components that I would reuse throughout most of my games.
Sign up as a Publisher
I went to the Publisher sign up page, and filled out the required info. As usual, I used the tools at http://blog.wafrat.com/beginning-android-day-1/#publishinganapp to make an icon and graphic quickly. I can always refine them later.
Setting up Google Analytics
Unity requires a Tracking ID, but by default, Google Analytics won't create one for you. Instead they create what they call a Google Analytics 4 property, with a Tag ID.
To create a Tracking ID, you have to specifically create a special property.
Setting up a package
To make a new package, go over https://publisher.assetstore.unity3d.com/package.html. I filled up basic info.
Then I went over to my Unity project, reorganized what I wanted to package up, and exported it, and ensured that "Include dependencies" was checked.
To check that it worked, I created a brand new project, and imported that package back. It's nice that it kept the hierarchy I had made for it.
Upon import, I realized that it did not import Unity.InputSystem automatically.
I checked https://docs.unity3d.com/Manual/AssetPackagesCreate.html, and it turns out "Include dependencies" will include the assets that the ones you are exporting depend on. In my case, I'm depending on a Unity Registry package, not an asset package...
I haven't found a way to make Unity propose to install Input System at the same time, but I've experienced the same issue with tutorials, where upon importing an Asset, I had to update a certain Unity Registry asset before it would compile again.
So the solution will be to document this in a README. Also the user will have to agree for Unity to re-setup the project.
Then the unit tests also failed with this error:
Assets/wafrat/Gesture/Tests/GestureManagerTests.cs(12,40): error CS0246: The type or namespace name 'InputTestFixture' could not be found (are you missing a using directive or an assembly reference?)
This is because in order to include those test files, the user should tweak their Package/manifest.json, as I had experienced at http://blog.wafrat.com/unit-testing-in-unity/#creating-the-test-assembly.
So I'd rather not publish unit tests, so as not to add an extra step for the user.
I made a sample Scene to demonstrate how to use the package. However, the Debug Touchscreen setting is not embedded in the scene. So instead I added a TouchSimulation component to an object in the scene. It does the same thing.
Uploading the package
I thought I could just export the file, then upload the .unitypackage file from my browser. It turns out it has to be done from the Asset Store Tools package from Unity.
When uploading, it shows this warning:
Some assets listed have dependencies that are part of Package Manager packages and these cannot be exported, so those references will be lost if those packages are not present in the importing project.
Which is what I had figured out earlier.
After upload, I went back to the publishing page.
Finishing up publishing
When I refreshed the page, my uploaded package showed up and they asked me to answer a form. The answers don't seem to make sense but ok.
Then I wrote the meta description and previewed it. It turns out, they don't use MD format. My itemized lists were broken. In https://unity3d.com/asset-store/sell-assets/onboarding#submitting-via-portal, they say that it should be HTML tags. It'd have been easier with MD format.
7. Use HTML tagging for description text (see Submission Guidelines for tags).
So I tried to use <ul><li> tags for my list. The editor complained. I should be using BR. Ugh!!!!!!
Once I was done, I clicked Upload, but it said I was missing a Cover image. In the Submission guidelines, they list the following requirements for "key images":
2.4.b Key images that are not a clear representation of your content may be rejected.
2.4.c Key images should not be an unedited screen capture of your content inside the Unity editor or a digital photograph of your computer monitor.
2.4.d Key images that only have plain text will be rejected.
Well, my package is a bare bones API, so the demo is mostly text. I uploaded a screenshot. We'll see how it goes.
I think I get it. This is the image used in the search results page. Alright. Let's make a real image then.
Unlike the Publisher sign up page, where you could upload any image, then use their tool to rescale and crop, this one just straight refuses to let you upload any image that's not the right size.
It actually required me to upload all the other images as well. Why do they also need an icon for it? Let's see if my generic publisher icon passes review.