Seanba / Aseprite2Unity

Import Aseprite files to Unity
MIT License
49 stars 10 forks source link

Package manager integration #3

Open colinbellino opened 4 years ago

colinbellino commented 4 years ago

Hello there.

I like this project a lot and recently tried to install it on a new project and realised there was no way to install it with Unity Package Manager (UPM).

So i was wondering if you would be open to a discussion and/or pull request about integrating this asset with the new package manager?

I've been playing around with it on a local fork and managed to get it working (see screenshot below). But that would mean changing the folder structure of the project (no code change though), because currently UPM includes all files in a repository (it's on the roadmap).

I've created a really quick and dirty fork here to show what the folders structure might look like. I think we could make it a lot cleaner but here is a quick list of things i came across to get to this result:

To use it, you would just have to add this line to your manifest.json for unity to install it.

"aseprite2unity": "git@github.com:Seanba/Aseprite2Unity.git",
// or git@github.com:cbellino/Aseprite2Unity.git for the proof of concept

Okay reading back on what i wrote, that's a bigger comment than i thought it would be (sorry about that). So i would totally understand if you don't have the time or don't want to go this way, no worries :)

Cheers.

What it looks like in the editor: image

Seanba commented 4 years ago

Hi there, @cbellino. I like the idea of using the UPM. Ideally that's how everyone would get my tools.

Is there a way register the package with Unity so that people don't have to modify their manifest?

colinbellino commented 4 years ago

That's great to hear :) I think moving forward it will be the default way to import tools into Unity.

Is there a way register the package with Unity so that people don't have to modify their manifest?

I was wondering about that too ! I'll look into it. For now, the Package Manager UI have an add by URL button that people can use and put the git repository URL instead of editing the manifest (still not ideal i know).

colinbellino commented 4 years ago

After some research, i don't think Unity offers to register packages to their repository (yet ?).

One alternative they offer is to create your own registry but that still forces users to edit the manifest file.

Seanba commented 4 years ago

Hi again, @cbellino.

For now, the Package Manager UI have an add by URL button ...

Hmmm ... I can't find any button on the Package Manager for adding a package by URL. Are you on a Unity beta? (I'm currently on Unity 2019.2).

Edit to add: Nevermind, I see it there on the Unity 2020 alpha. I'll get this (and SuperTiled2Unity) ready to be deployed this way for when Unity 2020 goes mainstream. Thanks!

colinbellino commented 4 years ago

Ah, sorry about that. I was indeed on the 2020 alpha ! Didn't realise this button was not in 2019.

If you need me, i'd be happy to help where i can :)