A lightweight package management system for Unity projects, consisting of a Unity Editor window and a C# console server application. This system allows teams to share and manage custom packages without requiring a full-scale asset server.
This system consists of two main components:
- Unity Editor Window - A custom editor window that allows you to browse, download, and upload packages
- C# Console Server - A standalone server application that manages the package repository
The system is designed to be simple to set up and use, making it ideal for small teams or individual developers who want to maintain a library of reusable assets.
- Browse available packages
- Download packages directly into your Unity project
- Upload new packages or update existing ones
- Search for packages by name or description
- Track upload and download progress
- Support for large file uploads through chunking
- Simple JSON-based package database
- Clone this repository
- Open the server solution in Visual Studio
- Build the console application
- Run the server application
The server will create a packages directory and a package_db.json file in its working directory to store packages and metadata.
- Copy the
PackageManagerWindow.csfile to your Unity project'sEditorfolder - Open the Package Manager window in Unity via
Window > Package Manager > Personal Package Manager - Configure the server URL (default is
http://localhost:5005)
Packages are stored on the server as ZIP files in the packages directory. Each package has its own subdirectory named after the package. The server maintains a JSON database (package_db.json) that tracks metadata for each package, including:
- Package name
- Version
- Description
- File path
- Upload date
The Unity Editor and server communicate via HTTP using the following endpoints:
GET /api/search?q=query- Search for packagesGET /api/details/packageName- Get details for a specific packageGET /api/download/packageName/version- Download a packagePOST /api/upload- Upload a package using multipart form dataPOST /api/upload-json- Upload a package using JSON with base64-encoded file dataPOST /api/upload-chunk- Upload a chunk of a large package (for files >2GB)
- The Unity Editor sends a request to download a specific package version
- The server locates the package in its database
- The server sends the package ZIP file to the Unity Editor
- The Unity Editor extracts the ZIP file to the specified location
- If the extraction location is within the Assets folder, the Asset Database is refreshed
- The Unity Editor compresses the selected folder into a ZIP file
- For small files (<2GB), the ZIP file is sent to the server in a single request
- For large files (>2GB), the ZIP file is split into chunks and sent in multiple requests
- The server saves the package and updates its database
The server listens on port 5005 by default. You can change this by modifying the PORT constant in the Program.cs file.
The Unity Editor window connects to http://localhost:5005 by default. You can change this by modifying the serverUrl variable in the PackageManagerWindow.cs file.
- The server uses HttpListener, which has a 2GB limit for single file uploads (chunked uploads are used for larger files)
- The system does not include user authentication or access control
- Package versioning is manual (you need to specify the version when uploading)
The system can be extended in several ways:
- Add user authentication
- Implement package dependencies
- Add version control integration
- Create a more sophisticated web interface for the server
- Add package validation and testing
- 404 Not Found when downloading: Check that the package name and version match exactly what's in the database
- Upload errors: Ensure all required fields are filled in and the package folder exists
- Package not visible in Unity: Try refreshing the Asset Database manually (Assets > Refresh)
- The server logs detailed information to the console
- The Unity Editor logs errors and warnings to the Unity Console
This project is licensed under the MIT License - see the LICENSE file for details.