{"id":25208029,"url":"https://github.com/fki-htw/unitypackagetemplate","last_synced_at":"2025-04-05T04:19:05.309Z","repository":{"id":247605252,"uuid":"824671161","full_name":"FKI-HTW/UnityPackageTemplate","owner":"FKI-HTW","description":"Repository template for a Unity package","archived":false,"fork":false,"pushed_at":"2024-07-24T10:39:48.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-02-10T12:18:05.415Z","etag":null,"topics":["package","packages","template","unity","unity-package"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FKI-HTW.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-05T16:44:44.000Z","updated_at":"2024-11-26T09:11:00.000Z","dependencies_parsed_at":"2024-07-09T17:58:06.895Z","dependency_job_id":null,"html_url":"https://github.com/FKI-HTW/UnityPackageTemplate","commit_stats":null,"previous_names":["fki-htw/unitypackagetemplate"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FKI-HTW%2FUnityPackageTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FKI-HTW%2FUnityPackageTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FKI-HTW%2FUnityPackageTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FKI-HTW%2FUnityPackageTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FKI-HTW","download_url":"https://codeload.github.com/FKI-HTW/UnityPackageTemplate/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247285516,"owners_count":20913833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["package","packages","template","unity","unity-package"],"created_at":"2025-02-10T12:18:07.241Z","updated_at":"2025-04-05T04:19:05.282Z","avatar_url":"https://github.com/FKI-HTW.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity Package Template\n\nThis repository is a template for creating Unity packages. Unity packages are useful for creating separate features that can be easily imported into any other Unity project to reuse them. These packages can be automatically managed with the inbuilt Unity Package Manager, allowing developers to switch between different versions of the same package at any time. Packages can also define optional samples and their own dependencies that should be automatically downloaded alongside them. This template contains a complete Unity project, which can be used to develop and test the package, and then publish the inner package with three simple git commands.\n\n## File structure\n\n\u003e `Assets` : all assets used for the development of the package are placed here \u003c/br\u003e\n\u003e\u003e Assets should adhere to the normal unity folder structure (Scene, Resources, Materials etc.), assets placed here can be used to develop and test the package without having the test assets be included in the published package \u003c/br\u003e\n\u003e\u003e `/UnityPackage` : all assets that should be part of the published package are placed underneath this directory \u003c/br\u003e\n\u003e\u003e\u003e `/Editor` : all editor scripts such as custom editors or settings are placed here \u003c/br\u003e\n\u003e\u003e\u003e `/Runtime` : all runtime scripts are placed here \u003c/br\u003e\n\u003e\u003e\u003e `/Samples~` : optional samples of the package are placed here \u003c/br\u003e\n\nOnly assets underneath the Assets/\u003cstrong\u003eUnityPackage\u003c/strong\u003e will be part of the published package. Assets that are only used for developing and testing the package should therefore be outside the \u003cstrong\u003eUnityPackage\u003c/strong\u003e folder. The Editor and Runtime directories inside the \u003cstrong\u003eUnityPackage\u003c/strong\u003e directory should contain assembly definitions to make sure the contained assets are only included in the corresponding platform. The Editor assembly definition, if the package should even use a Editor directory, should also have a one-directional GUID reference to the runtime assembly definition.\n\nThe root directory of the repository should contain a \u003cstrong\u003eLICENSE\u003c/strong\u003e and a \u003cstrong\u003eREADME.md\u003c/strong\u003e file to allow Github to index them easily. Alongside the \u003cstrong\u003epackage.json\u003c/strong\u003e the \u003cstrong\u003eUnityPackage\u003c/strong\u003e directory should contain a \u003cstrong\u003eLICENSE.md\u003c/strong\u003e, \u003cstrong\u003eREADME.md\u003c/strong\u003e and \u003cstrong\u003eCHANGELOG.md\u003c/strong\u003e file, which are linked to in the \u003cstrong\u003epackage.json\u003c/strong\u003e and can be from viewed inside the Unity Package Manager UI. \n\nFor more information see [Unity Package Layout](https://docs.unity3d.com/Manual/cus-layout.html).\n\n## Samples\n\nSamples are optional features and assets that can be downloaded alongside the package from the Unity Package Manager. Samples can be used to provide example scenes, explanations, tests etc. for the users. Samples must be placed underneath the `Samples~` folder inside the package and be defined in the package.json. To prevent Samples from being imported automatically alongside the rest of the package, the Samples folder must contain a \u003cstrong\u003e~\u003c/strong\u003e character at the end of the folder name. This hides the folder from Unity, and allows users to selectively import samples from the Package Manager UI. Because the \u003cstrong\u003e~\u003c/strong\u003e must be added back to the samples folder, hiding the folder from Unity, it can be annoying to develop the samples in the provided template project. It is therefore recommended to have two separate branches (ex.: develop and main). All changes should first be made on develop and then be merged to the main branch, where the package can be published. On the develop branch the Samples directory should not contain the \u003cstrong\u003e~\u003c/strong\u003e character. Once a new sample is added to the project, a new commit should be made, where the \u003cstrong\u003e~\u003c/strong\u003e character is added to the folder name ONLY on the main branch. This enables you to develop the sample on the develop branch and have the \u003cstrong\u003e~\u003c/strong\u003e automatically be added everytime you merge your changes to the main branch.\n\n`Samples` should have the following folder structure:\n\n\u003e `Samples~`\n\u003e\u003e `/SAMPLE_NAME`\n\u003e\u003e\u003e normal Unity folder structure\n\nFor more information see [Unity Samples](https://docs.unity3d.com/Manual/cus-samples.html).\n\n## Using the template\n\nWhen using the template to create a new Unity package project, make sure to first adjust the Unity project version. Then update the \u003cstrong\u003eEdit \u003e Project Settings \u003e Player\u003c/strong\u003e CompanyName, Product Name and Version. Also update the \u003cstrong\u003eUnityPackage/package.json\u003c/strong\u003e values, like name (ex.: de.htw-berlin.centis.project-name), display name, version, URLs, author and samples. The version number in the Player settings and package.json should adhere to the SemVer format.\n\n## Publishing\n\nTo publish the package it is recommended to make all changes on the develop branch, then merge the changes to the main branch and publish the package from there. Before publishing make sure to update the version number in the \u003cstrong\u003eEdit \u003e Project Settings \u003e Player\u003c/strong\u003e settings and the \u003cstrong\u003eUnityPackage/package.json\u003c/strong\u003e. Also make sure that if any samples are present, they have a \u003cstrong\u003e~\u003c/strong\u003e character at the end of the Samples directory name. \nOnce the main branch and version is updated, the package can be published from the Git Bash tool. Using the commands:\n\n```\ngit subtree split --prefix=Assets/UnityPackage --branch upm\ngit tag VERSION upm\ngit push origin upm --tags\n```\n\nthe local package version can be published under a new tag on the Unity Package Manager (upm) branch. When using the commands make sure to replace the \u003cstrong\u003eVERSION\u003c/strong\u003e with the SemVer version number for the package. All files underneath the \u003cstrong\u003eUnityPackage\u003c/strong\u003e directory are then published with the Git tag on the upm branch. After publishing the branch, no commits must be made to the upm branch. To update the package, simply change the version number and run the commands with the new version again. The published tags and package version can be viewed on Github in the Release \u003e Tag section.\n\nTo import the package into a new Unity project paste the package URL in the \u003cstrong\u003eWindow \u003e Package Manager \u003e + \u003e Add package from git URL...\u003c/strong\u003e field. The package URL is the HTTPS URL (ex.: https://github.com/FKI-HTW/UnityPackageTemplate.git) with a \u003cstrong\u003e#upm\u003c/strong\u003e for the most recently published version or \u003cstrong\u003e#VERSION_TAG\u003c/strong\u003e at the end. The complete URL for a specific version of a package could look something like this: https://github.com/FKI-HTW/UnityPackageTemplate.git#1.2.3.\nIf you are developing a package, you can also import the package from Github into a Unity project without creating a new tag or package branch, by directly specifiying the desired package directory in the URL. This can be done by using the path specificer `?path=`at the end of the URL (ex.: ?path=/subfolder2/subfolder3). This can also be combined with a tag or branch revision specifier (ex.: https://github.com/FKI-HTW/UnityPackageTemplate.git?path=/subfolder2/subfolder3#1.0.0). For more information see [URL Specifier](https://docs.unity3d.com/Manual/upm-git.html#subfolder).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffki-htw%2Funitypackagetemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffki-htw%2Funitypackagetemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffki-htw%2Funitypackagetemplate/lists"}