Version: 2023.2
언어: 한국어
패키지용 샘플 생성
버전 지정

패키지 매니페스트

Unity는 패키지 매니페스트 파일(package.json)을 사용하여 특정 패키지의 특정 버전에 대한 정보를 관리합니다.패키지 매니페스트는 항상 패키지의 루트에 있으며, 등록 이름 및 버전 번호와 같이 패키지에 대한 중요한 정보를 포함하고 있습니다.

또한 패키지 매니페스트는 다음과 같이 사용자와 통신하는 데 유용한 정보도 정의합니다.

  • UI에 표시되는 사용자 친화적 이름
  • 패키지에 대한 간략한 설명
  • 패키지가 호환되는 Unity 에디터의 최신 버전

The package manifest uses JSON (JavaScript Object Notation) syntax to describe what’s inside the package. The file’s format is similar to npm’s package.json format, but uses different semantics for some of its properties. Refer to the example for a sample package manifest file.

The Package Manager reads this manifest to find out the package’s contents, how to unpack its contents, and what information to display in the Package Manager window. The manifest stores this information in a series of required, recommended, and optional properties.

필수 프로퍼티

이러한 프로퍼티가 없으면 패키지가 퍼블리시될 때 레지스트리가 거부하거나, 패키지 관리자가 패키지를 페치하거나 로드할 수 없습니다.

프로퍼티 JSON 타입 설명
name String A unique identifier that conforms to the Unity Package Manager naming convention, which uses reverse domain name notation. For more information about the naming convention, refer to Naming your package.

Note: The name identifier is different than the user-friendly display name that appears in the list panel in the Package Manager window.
version String The package version number, which uses the format "major.minor.patch".

For example, "3.2.1" indicates that this is the 3rd major release, the 2nd minor release, and the 1st patch.

This value must respect Semantic Versioning. For more information, refer to Versioning.

권장 프로퍼티

The Package Manager can install packages in a project even if the recommended properties are missing or have invalid values.

However, the recommended best practice is to assign values for these properties to make sure that your package is discoverable and to offer a better experience for users.

프로퍼티 JSON 타입 설명
description String A brief description of the package. This is the text that appears in the details panel of the Package Manager window. This field supports UTF–8 character codes. This means that you can use special formatting character codes, such as line breaks (\n) and bullets (\u25AA).
displayName String A user-friendly name that appears in the Unity Editor (for example, in the Project window, the Package Manager window, etc.).

Examples of displayName values are Unity Timeline, ProBuilder, and In App Purchasing.
unity String Indicates the lowest Unity version the package is compatible with. If omitted, the Package Manager considers the package compatible with all Unity versions.

The expected format is "major.minor" (for example, "2018.3"). To point to a specific patch, also include the unityRelease property, described in Optional properties.

Note: A package that isn’t compatible with Unity doesn’t appear in the Package Manager window.

옵션 프로퍼티

선택 사항인 프로퍼티입니다. 즉, 생략할 수 있지만, 포함할 경우 유효한 값을 지정해야 합니다.

프로퍼티 JSON 타입 설명
author 오브젝트 또는 문자열입니다. 패키지의 작성자입니다.

이 프로퍼티에는 이름이라는 필수 필드 하나와 이메일url이라는 선택 필드 두 개가 있습니다.

이러한 필드를 JSON 객체로 지정하거나 키가 작성자인 단일 문자열로 축소할 수 있습니다.

객체 예시:
{
   "name" :"John Doe",
   "email" :"john.doe@example.com",
   "url" :"http://john.doe.example.com/"
}

문자열 예시:
"John Doe <john.doe@example.com> (http://john.doe.example.com/)"
changelogUrl String URL로 지정된 이 패키지의 변경 로그에 대한 커스텀 위치입니다. 예를 들면 다음과 같습니다.
"changelogUrl": "https://example.com/changelog.html"

참고: 네트워크 문제 등으로 인해 패키지 관리자가 URL 위치에 도달할 수 없으면 다음을 수행합니다.

- 패키지가 설치된 경우 패키지 관리자는 패키지 캐시에 CHANGELOG.md 파일을 표시하는 파일 브라우저를 엽니다.
- 패키지가 설치되지 않은 경우 패키지 관리자는 오프라인 변경 로그를 사용할 수 없다는 경고를 표시합니다.
dependencies 오브젝트 패키지 종속성의 맵입니다.키는 패키지 이름이고, 값은 특정 버전입니다.이 패키지가 종속된 다른 패키지를 식별합니다.

참고:패키지 관리자는 범위 구문을 지원하지 않으며, SemVer 버전만 지원합니다.
documentationUrl String Custom location for this package’s documentation, specified as a URL. For example:
"documentationUrl": "https://example.com/"

Note: When the Package Manager can’t reach the URL location (for example, if there is a network issue), it does the following:

- If the package is installed, the Package Manager opens a file browser displaying the Documentation~ folder in the package cache.
- If the package isn’t installed, the Package Manager displays a warning that offline documentation isn’t available.
hideInEditor 부울 By default, the Project window hides package’s assets and omits them from the results when you use the Object Picker in the Inspector window. Set this property to "false" to make sure that this package’s assets are always visible.
keywords 문자열 배열 패키지 관리자가 API를 검색할 때 사용하는 키워드 배열입니다. 사용자가 적절한 패키지를 찾는 데 도움이 됩니다.
license String Identifier for an OSS license using the SPDX identifier format, or a string such as “Refer to LICENSE.md file”.

Note: If you omit this property in your package manifest, your package must contain a LICENSE.md file.
licensesUrl String Custom location for this package’s license information, specified as a URL. For example:
"licensesUrl": "https://example.com/licensing.html"

Note: If the Package Manager can’t reach the URL location (for example, if there is a network issue), it does the following:

- If the package is installed, it opens a file browser displaying the LICENSE.md file in the package cache.
- If the package isn’t installed, the Package Manager displays a warning that offline license information isn’t available.
samples 오브젝트 배열 List of samples included in the package. Each sample has a display name, a description, and the path to the sample folder starting at the Samples~ folder:

{
   "displayName": "<name-to-appear-in-the-UI>",
   "description": "<brief-description>",
   "path": "Samples~/<sample-subfolder>"
}

For more information, refer to Creating samples for packages.
type String Reserved for internal use.
unityRelease String Part of a Unity version indicating the specific release of Unity that the package is compatible with. You can use this property when an updated package requires changes made during the Unity alpha/beta development cycle. This might be the case if the package needs newly introduced APIs, or uses existing APIs that have changed in a non-backward-compatible way without API Updater rules.

The expected format is "<update><release> (for example, "0b4").

Note: If you omit the recommended unity property, this property has no effect.

A package that isn’t compatible with Unity doesn’t appear in the Package Manager window.

패키지 매니페스트 예시

{
  "name": "com.[company-name].[package-name]",
  "version": "1.2.3",
  "displayName": "Package Example",
  "description": "This is an example package",
  "unity": "2019.1",
  "unityRelease": "0b5",
  "documentationUrl": "https://example.com/",
  "changelogUrl": "https://example.com/changelog.html",
  "licensesUrl": "https://example.com/licensing.html",
  "dependencies": {
    "com.[company-name].some-package": "1.0.0",
    "com.[company-name].other-package": "2.0.0"
 },
 "keywords": [
    "keyword1",
    "keyword2",
    "keyword3"
  ],
  "author": {
    "name": "Unity",
    "email": "unity@example.com",
    "url": "https://www.unity3d.com"
  }
}

추가 리소스

패키지용 샘플 생성
버전 지정