Unity 패키지 관리자는 Unity의 공식 패키지 관리 시스템으로 다음과 같은 기능을 수행합니다.
You can use the Package Manager to define project dependencies, resolve package dependencies, download packages, add packages, and integrate content in your projects.
패키지 소개와 Unity 패키지 관리자의 작동 방식에 대한 일반적인 내용은 패키지 문서를 참조하십시오.
패키지는 다음을 포함할 수 있습니다.
참고: 패키지 관리자는 패키지의 스트리밍 에셋을 지원하지 않습니다. 대신 어드레서블 패키지를 사용하십시오.
또한 각 패키지는 패키지 이름, 패키지 버전, 종속성 리스트, 저장소 URL 등과 같은 정보가 들어 있는 패키지 매니페스트 파일을 포함합니다.
새 패키지를 만들려면 다음 단계를 따르십시오.
다음 방법 중 하나를 사용하여 패키지를 위한 빈 셸을 만듭니다.
Make sure the layout of your folder structure follows the package layout convention for Unity packages. For example, if you have Editor and Runtime libraries, make sure you store them under the Editor
and Runtime
folders.
If your package includes code, make sure the package layout you created has the necessary assembly definition files. For information about creating and defining assembly definition files, see Assembly definition and packages. For additional information, see Assembly definitions.
Note: If the console window reports a warning after adding an assembly definition file, save your project, close it, then reopen it.
Add your tools, libraries, and any assets your package requires.
Add tests to your package. Tests are essential for ensuring that the package works as expected in different scenarios:
Tests/Editor
에 작성합니다.Tests/Runtime
.If you have samples for your package, add them to the proper samples subfolder.
참고: 패키지는 샘플만 포함할 수 있지만 동일한 레이아웃과 JSON 구조를 사용한 툴 또는 템플릿 패키지의 일부로 샘플을 포함할 수도 있습니다.
You can update the CHANGELOG.md
file every time you publish a new version. Every new feature or bug fix should have a trace in this file. For more details on the chosen changelog format, see the Keep a Changelog documentation.
This step is optional for packages that you don’t share, but strongly recommended for shared packages, so that users know which version best suits their needs.
Tip: You can provide a link to an external web page where you host this package’s changelog by setting the changelogUrl property in your package’s package.json
manifest file.
You can include licenses and third-party notices in the LICENSE.md
and THIRD PARTY NOTICES.md
files.
This step is optional for packages that you don’t share, but strongly recommended for shared packages, so that your users don’t misuse your packages or violate any third-party licenses.
Tip: You can provide a link to an external web page where you host this package’s licensing and third-party notices by setting the licensesUrl property in your package’s package.json
manifest file.
Document your package.
Tip: You can provide a link to an external web page where you host this package’s documentation by setting the documentationUrl property in your package’s package.json
manifest file.
Share your package.
프로젝트 폴더 내부에 커스텀 패키지를 만들려면 다음 단계를 따르십시오.
Note: These instructions are part of the larger procedure for Creating custom packages.
Unity Hub를 열고 컴퓨터에 빈 프로젝트를 생성합니다.
컴퓨터의 기존 프로젝트를 사용하거나, 프로젝트 아래에 패키지를 포함하거나, 로컬 폴더에서 패키지를 설치할 수 있습니다. 하지만 새로운 프로젝트로 시작하면 패키지 콘텐츠의 오류를 줄일 수 있습니다.
Using your computer’s file manager (for example the Windows File Explorer or the macOS Finder), navigate to your project folder and locate the Packages
subdirectory.
Create a new subdirectory for your package inside the Packages
folder using a name that matches the package name and follows the naming conventions. For example, if your package name is com.example.mypackage
, create a subdirectory called com.example.mypackage
.
Note: This is particularly important if your package contains assets, because the AssetDatabase looks for an asset path that matches Packages/<your-package-name>/Assets
, regardless of the actual folder name.
Open your preferred text editor and create a JSON file called package.json
in the root of the package folder.
Fill out all required and recommended fields in the package.json
file. You can use the package manifest example as a reference.
When you reopen Unity, the new package appears in the Package Manager window and in the Project window, where you can view and modify the package contents. If you select the package.json
file in the Project window, you can also modify its JSON values directly in the Inspector window.
Return to the main procedure to complete the creation of your package.
Follow these instructions if you want to create a custom package outside your project folder.
Note: These instructions are part of the larger procedure for Creating custom packages.
컴퓨터의 파일 관리자(예: Windows File Explorer 또는 macOS Finder)를 사용하여 패키지를 위한 폴더를 만듭니다.
패키지의 일부 콘텐츠를 이미 만든 경우에는 기존 위치를 사용할 수도 있습니다.
Open your preferred text editor and create a JSON file called package.json
in the root of the package folder.
Fill out all required and recommended fields in the package.json
file, making sure the name
property follows the naming conventions. You can use the package manifest example as a reference.
In Unity, create a new project or open an existing project.
Open the Package Manager window and follow the instructions for installing a local package, using the package.json
file you just created.
The new package appears in the Package Manager window and in the Project window, where you can view and modify the package contents. If you select the package.json
file in the Project window, you can also modify its JSON values directly in the Inspector window.
Return to the main procedure to complete the creation of your package.