hecomi / uWindowCapture

This allows you to use Windows Graphics Capture / PrintWindow / BitBlt in Windows to capture multiple windows individually and easily use them as Texture2D in Unity.
https://tips.hecomi.com/entry/2021/04/30/230322
MIT License
493 stars 79 forks source link

Refactor into UPM package structure #39

Closed hybridherbst closed 2 years ago

hybridherbst commented 2 years ago

This looks like a big change but actually it's just some folder renames and AsmDef creation. The result is that this repository is compatible with Unity's Package Manager (UPM) and thus becomes much easier to consume and use in projects.

image

It will simply show in the Packages list instead of Assets: image

For now I added just one sample to package.json which imports all sample scenes, but that could be split into multiple if wanted.

hecomi commented 2 years ago

Thanks for the great pull request! I've not been familiar with UPM yet, so please give me some time to learn it.

hybridherbst commented 2 years ago

Sure! Let me know if you have any questions or something is unclear :)

hecomi commented 2 years ago

I'm sorry for the late reply. After a lot of research, I decided to do a branch-based release. Here is the research article (written in Japanese, sorry about that)

I made this structure in uOSC and tried to do a release.

For this reason, I'm going to change the directory structure a bit based on it.

hecomi commented 2 years ago

Now we can import uWindowCapture with Package Manager from the URL https://github.com/hecomi/uWindowCapture.git#upm. Thank you for your contribution!

hybridherbst commented 2 years ago

Usually it's not necessary to have a special branch, tag-based releases work great (you can see e.g. https://github.com/needle-tools/compilation-visualizer for an example of that).

People can either then pin the right tag when they add as a git repo, or consume the releases from OpenUPM.

hecomi commented 2 years ago

Just using the tag-based release is not enough for my usecases. So, I'm using GitHub Actions that is activated automatically when a new tag is pushed to recreate the directory structure itself:

Also, I don't want to use the directory name Samples~. I think this is convenient for users who don't need the samples. However, for me, who does a lot of development and testing with samples, this restriction, which is not imported by default, creates additional works. And the .meta files will not be updated until I remove ~ and import them again. Also, the structure using Samples~ or symbolic links makes it difficult to release using the old .unitypackage (some users still develop their apps using .unitypackage because they want to tweak some code, or just don't want to use UPM).

Here's what I'd like to achieve: