Skip to content

hibzzgames/Hibzz.PackageEditor

Repository files navigation

Hibzz.PackageEditor

LICENSE Twitter Follow Discord Unity C#

A tool for Unity to edit a git package within the package manager

Untitled

Installation

Via Github This package can be installed in the Unity Package Manager using the following git URL.

https://github.com/hibzzgames/Hibzz.PackageEditor.git

Alternatively, you can download the latest release from the releases page and manually import the package into your project.


The problem I'm trying to solve

Across different Unity projects that I rapidly prototype, I use a lot of scripts that are shared between projects. To keep things streamlined (and shareable), I've created self-contained packages that I can easily import into any project using the Unity Package Manager. However, as I continue to work on the projects, I might find issues or want to add new features/improvements to the packages. To do this, I have to either work on the source repository directly, push an update, and then update the package in the project, or I have to manually copy the files over to the project and replace the UPM package. Both of these options are not ideal, and I wanted to find a better way to quickly iterate on my packages, test them, and then push them to the source repository.

How it works

The package editor is a tool that allows you to edit a package that is installed using a git URL via the Unity Package Manager. It does this by creating a local copy of the package in the developer's Documents/UnityPackageSource/ folder and creating a symbolic link to the local Packages folder to create an Embedded package. This allows you to edit the package in the project, and then push the changes to the source repository. Then once you are done, you can revert to the original "production" package using this tool.

This way you can quickly iterate on your packages, across multiple projects, without having to worry about juggling multiple repositories or manually copying files over.

Editing a package

  • After installing the package, you can open the package manager and select the git package you want to edit.
  • Click the Switch to Development Mode button to clone the repo and create a symbolic link to the package.
  • Now, in the package directory, you can edit the files and test them in your project

Reverting to the original package

  • After you are done editing the package and have pushed your changes to the source repository, you can revert to the original package by clicking the Revert to Production Mode button.
  • This will remove the symbolic link and restore the original package
    • Note: This will not delete the local copy of the package in the Documents/UnityPackageSource/ folder. This is so that you can continue to edit the package without having to clone it again from other projects.

Have a question or want to contribute?

If you have any questions or want to contribute, feel free to join the Discord server or Twitter. I'm always looking for feedback and ways to improve this tool. Thanks!

Additionally, you can support the development of these open-source projects via GitHub Sponsors and gain early access to the projects.