-
Notifications
You must be signed in to change notification settings - Fork 63
Development Setup
VPE uses Unity's Package Manager to fetch its code. For users that's great because they get updates without having to deal with git, and the actual project to work with is very small because the heavy dependencies get pulled in by UPM. We use our own scoped registry. Packages get published automatically when something gets merged or pushed to master
.
However, packages are immutable in Unity, meaning code can't be updated and thus they are not suitable for local development. For that, you need to clone each package locally and manually add them to the project.
VPE consists of multiple repositories. We have split them because of two reasons:
- We want to have code separate from the rather heavy assets (textures, models, etc)
- URP and HDRP aren't compatible and cannot live together in the same project (and we support both).
Here an overview of VPE's repositories:
When using the HDRP or URP project, the scoped registry is already set up and Unity will pull in dependencies in from that. So the first step is to remove it. For that, go to project settings, and remove the Visual Pinball Engine registry under Package Manager. Then, remove the VPE packages. The most-parent package is Visual Pinball Engine (HDRP), so removing that should remove the others as well.
The second step is to clone all the repos:
git clone [email protected]:VisualPinball/VisualPinball.Unity.AssetLibrary.git
git clone [email protected]:VisualPinball/VisualPinball.Unity.AssetLibrary.Hdrp.git
git clone [email protected]:freezy/VisualPinball.Engine.git
git clone [email protected]:VisualPinball/VisualPinball.Unity.Hdrp.git
git clone [email protected]:VisualPinball/VisualPinball.Unity.Urp.git
In your Unity project, add the repositories as package from disk in the following order:
- VisualPinball.Unity.AssetLibrary
- VisualPinball.Unity.AssetLibrary.Hdrp
- VisualPinball.Engine
- VisualPinball.Unity.Hdrp
When working with URP, use these repositories in this order:
VisualPinball.Unity.AssetLibrary.Urp does not exist yet, but it will be added here when it does.
One advantage of UPM is that it makes it easy for users to upgrade:
In order for that to work, we use GitHub actions to increase the package version on each merge to master, publish the package to our registry and update the dependents. For example, if you commit to vpe.assets
, GitHub will:
- Increase the version of
vpe.assets
and publish a new package to our package registry - Update
vpe.assets.hdrp
,vpe.assets.urp
andmain
to use the new version - Since they got updated, the three repos in the last step will also increase their version and publish themselves
- The will also update their dependents, e.g.
vpe.assts.hdrp
will updatevpe.hdrp
, which then will bump its version and publish itself, too.
Summary: Committing to master on any repo will automatically release itself and its dependents. So avoid committing to master directly and use PRs!
Sometimes you'll be working on features that span over multiple repositories. We recommend branching each repository to the same branch name so it's clear which branches belong together when testing the feature.