Version: 2020.3
Creating samples for packages
버전 지정

패키지 매니페스트

Unity는 패키지 매니페스트 파일(package.json)을 사용하여 특정 패키지의 특정 버전에 관한 정보를 관리합니다. 패키지 매니페스트는 항상 패키지의 루트에 위치하며, 패키지에 관한 중요 정보(예: 등록 이름, 버전 숫자 등)를 담고 있습니다. 또한 UI에 표시되는 사용자 친화적 이름, 패키지에 대한 간략한 설명, 패키지와 호환되는 가장 낮은 Unity 버전 등과 같이 사용자에게 전달할 유용한 정보를 정의합니다.

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

The Package Manager reads this manifest to find out what the package contains, how to unpack its contents, and what information to show the user in the Package Manager window. The manifest stores this information in a series of required, mandatory, and optional properties.

Required properties

These properties are required. If they are not present, either the registry refuses the package when it is published, or the Package Manager cannot fetch or load the package.

프로퍼티 JSON 타입 설명
name String The officially registered package name. This name must conform to the Unity Package Manager naming convention, which uses reverse domain name notation. For more information about the naming convention, see Naming your package.

Note: This is a unique identifier, not the user-friendly name that appears in the list view on the Package Manager window.
version 문자열 패키지 버전 숫자입니다(MAJOR.MINOR.PATCH).

예를 들어 “3.2.1”은 3번째 메이저 릴리스, 2번째 마이너 릴리스, 첫 번째 패치를 나타냅니다.

이 값은 시맨틱 버전 지정을 준수해야 합니다. 자세한 내용은 버전 지정을 참조하십시오.

Mandatory properties

These properties are technically optional, and the Package Manager can still install them in a project even if they do not contain valid values or are missing. However, you should give values for these properties, to make your package easily discoverable and provide a better experience for users.

프로퍼티 JSON 타입 설명
description String 패키지에 대한 간략한 설명입니다. 이 텍스트는 Package Manager 창의 세부 정보 뷰에 나타납니다. UTF–8 문자 코드가 지원됩니다. 즉, 줄바꿈(\n), 불릿(\u25AA) 등과 같은 특수 포매팅 문자 코드를 사용할 수 있습니다.
displayName String Unity 에디터에 표시되는 사용자 친화적 이름입니다(예: 프로젝트 브라우저의 Package Manager 창 등).

예: Unity Timeline, ProBuilder, In App Purchasing
unity String Indicates the lowest Unity version the package is compatible with. If omitted, the package is considered compatible with all Unity versions.

The expected format is “<MAJOR>.<MINOR>” (for example, 2018.3). To point to a specific patch, use the unityRelease property as well.

Note: A package that is not compatible with Unity will not appear in the Package Manager window.

Optional properties

These properties are optional, meaning that you can omit them. However, if they are present, they must have a valid value.

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

이 오브젝트에는 하나의 필수 필드(name)와 두 개의 옵션 필드(emailurl)가 들어 있습니다.

예를 들어 다음과 같습니다.
{ "name" : "John Doe",
   "email" : "john.doe@example.com",
   "url" : "http://john.doe.example.com/"
}
changelogUrl String Custom location for this package’s changelog specified as a URL. For example:
"changelogUrl": "https://example.com/changelog.html"

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, it opens a file browser displaying the CHANGELOG.md file in the package cache.
- If the package is not installed, the Package Manager displays a warning that an offline changelog is not available.
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, it opens a file browser displaying the Documentation~ folder in the package cache.
- If the package is not installed, the Package Manager displays a warning that offline documentation is not available.
hideInEditor 부울 Normally, the Package Manager hides most packages automatically (the implicit value is “true”), but you can set this property to “false” to make sure that your package and its assets are always visible.
keywords 문자열 배열 패키지 관리자가 API를 검색할 때 사용하는 키워드 배열입니다. 사용자가 적절한 패키지를 찾는 데 도움이 됩니다.
license String Identifier for an OSS license using the SPDX identifier format, or a string such as “See 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: 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, it opens a file browser displaying the LICENSE.md file in the package cache.
- If the package is not installed, the Package Manager displays a warning that offline license information is not available.
samples 오브젝트 배열 List of samples included in the package. Each sample contains a display name, a description, and the path to the sample folder starting at the Samples~ folder itself:

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

For more information, see Creating samples for packages.
type String 패키지 관리자에 추가 정보를 제공하는 상수입니다.

내부 사용으로 예약되어 있습니다.
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 (for example, if it needs newly introduced APIs, or uses existing APIs that 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 unity property, this property has no effect.

A package that is not compatible with Unity does not appear in the Package Manager window.

패키지 매니페스트 예시

{
  "name": "com.unity.example",
  "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.unity.some-package": "1.0.0",
    "com.unity.other-package": "2.0.0"
 },
 "keywords": [
    "keyword1",
    "keyword2",
    "keyword3"
  ],
  "author": {
    "name": "Unity",
    "email": "unity@example.com",
    "url": "https://www.unity3d.com"
  }
}


Creating samples for packages
버전 지정
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961