jean-moreno / EdgeDetect-PostProcessingUnity

Unity legacy Edge Detect image effect ported to Post Processing Stack v2
296 stars 32 forks source link

Add package.json for use with UPM #12

Open popcron opened 5 years ago

popcron commented 5 years ago

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. 👍

jean-moreno commented 5 years ago

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

popcron commented 5 years ago

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.