Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package manager integration #3

Open
colinbellino opened this issue Oct 15, 2019 · 5 comments
Open

Package manager integration #3

colinbellino opened this issue Oct 15, 2019 · 5 comments

Comments

@colinbellino
Copy link

colinbellino commented Oct 15, 2019

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:

  • UPM includes all folders/files in the project. This is problematic because we don't want the ProjectSettings and Packages folders to be included.
  • UPM will ignore folders with a ~ suffix. So i've moved the Editor and Examples folder to the root and rename Aseprite2Unity to Aseprite2Unity~ as a quick way to exclude it.
  • UPM has a way to link/import sample code. So we can point to the MegaDad example (see package.json). I've taken the liberty to rename it to Samples~ since it's the convention the unity packages use, but that's totally optional.

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

"aseprite2unity": "[email protected]:Seanba/Aseprite2Unity.git",
// or [email protected]: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

@colinbellino colinbellino changed the title Package manager Package manager integration Oct 15, 2019
@Seanba
Copy link
Owner

Seanba commented Oct 15, 2019

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
Copy link
Author

colinbellino commented Oct 16, 2019

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
Copy link
Author

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
Copy link
Owner

Seanba commented Oct 20, 2019

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
Copy link
Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants