EdgeDetect-PostProcessingUnity icon indicating copy to clipboard operation
EdgeDetect-PostProcessingUnity copied to clipboard

Add package.json for use with UPM

Open popcron opened this issue 6 years ago • 2 comments

It would be sweet if you could add a package.json (along with the .meta file) so that it could be used in 2018.3.x editors without having to download the folder into assets, but instead by referencing it with the Package Manager.

The json entry in the manifest.json would end up looking like this: "com.jean-moreno.edgedetection": "https://github.com/jean-moreno/EdgeDetect-PostProcessingUnity.git",

If you need some directions on how to set this up, let me know. Sick stuff btw, keep it up. 👍

popcron avatar Jan 01 '19 09:01 popcron

I've just looked a bit into it but GitHub package support sounds very new and early; would love some help on how to properly set up the json file. For example, I'm not sure how it is supposed to handle multiple versions. Should I just update the package.json file each time, and it's up to users to find the relevant revision that will work in their environment? (so every time I update that json I should maybe add a release in GitHub?)

jean-moreno avatar Feb 20 '19 06:02 jean-moreno

Yes, if the version number changes in the .json file, Unity will detect and update it to the newest version accordingly. However, it doesnt allow you to pick previous versions (I dont know if this is planned or not). The workaround would be to create separate branches and reference the package specifically with commitish synthax:

"com.author.package": "https://github.com/package.git#branchname"

As long as every file has a .meta file alongside and a package.json at the root, it will work. Unity will need the .meta files and it will throw warnings if it doesnt, I usually just reference the package locally like "com.auth.pack": "file:/C\users\packs\package.json" in order to generate the files, then I push it so that the remote branch contains the meta files.

popcron avatar Feb 20 '19 19:02 popcron