Version: 2022.1
언어: 한국어
패키지 에셋에 액세스
해결 및 충돌

Scoped registries

Scoped registries allow Unity to communicate the location of any custom package registry server to the Package Manager so that the user has access to several collections of packages at the same time. Here are some important concepts to help you understand this feature:

개념: 설명:
패키지 레지스트리 서버 패키지를 추적하고 저장할 장소를 제공하는 애플리케이션입니다. Unity의 Package Manager 창에서 Unity 레지스트리 컨텍스트를 선택하면 Unity의 레지스트리에 등록된 모든 패키지가 리스트 뷰에 나타납니다.
패키지 관리자 An application that tells the user what packages are available, and downloads and installs whatever package the user requests for their project. Unity has implemented its own version of a package manager, but there are several similar applications in other organizations.
범위 com.example.mycompany.animation 또는 com.example 등을 비롯한 패키지 이름 또는 네임스페이스(역 도메인 포맷)를 정의합니다. 사용자가 패키지를 요청하면 패키지 관리자는 해당 범위와 가장 일치하는 패키지를 레지스트리에서 페치합니다. 자세한 내용은 아래의 프로젝트의 범위 지정 레지스트리 관리를 참조하십시오.


The way you interact with scoped registries depends on your role:

  • Package providers set up custom registry servers to host and distribute custom packages in addition to the Unity registry.
  • Package consumers set up scoped registries for each project to access a custom package provider’s registry server.

Integrity and security of scoped registries

As a package provider, make sure any package registry servers you set up conform to Unity’s Terms of Service and Unity’s Package Guiding Principles & Guidelines. Unity provides access to the Package Manager to facilitate sharing knowledge and creations, but not as a marketplace for third-party products.

As a package consumer, when you install a scoped registry, use the same level of caution that you use when installing any other third-party software:

  • Install scoped registries only from trusted sources, since the packages in those registries can contain executable code.
  • Beware of third-party registries that may be harmful or capture data without appropriate controls. Also beware of third parties misrepresenting themselves as Unity, or sanctioned or supported by Unity.

Benefits of scoped registries

Scoped registries can help to:

  • 툴, 라이브러리 및 기타 에셋을 배포하여 새로운 기능을 제공합니다.

    As a provider, you can create your own registry to distribute tools and scripts (or other types of assets) with version numbers that indicate how mature the package is. Version numbers also indicate whether updates introduce breaking API changes or minor fixes, based on Semantic Versioning. Your code can depend on code in other packages, because the Package Manager supports package dependencies.

    As a consumer, your experience of browsing and installing third-party custom packages in the Package Manager is the same as browsing Unity’s packages.

  • Unity의 기존 패키지 기능 확장.

    소비자는 레지스트리를 수동으로 전환하거나 다른 패키지 버전을 명시적으로 설치하지 않고도, 커스텀 패키지가 Unity 패키지를 오버라이드하는 원활한 환경을 이용할 수 있습니다. 이는 패키지를 특정 레지스트리에 매핑하여, 패키지 관리자가 Unity 레지스트리 또는 커스텀 패키지 레지스트리 서버에서 페치할 수 있도록 지원하기 때문입니다.

  • 폐쇄된 네트워크 환경의 패키지 액세스.

    일부 조직은 폐쇄된 네트워크 내부에서 작업하기 때문에 Unity의 자체 패키지 레지스트리에 액세스하기 어렵습니다. 이러한 경우 조직은 폐쇄된 네트워크 내부의 서버에 자체 패키지 레지스트리를 설정할 수 있습니다. 그런 다음 네트워크 관리자는 주기적으로 Unity의 패키지 레지스트리와 동기화하여 범위 지정 레지스트리에 사용 가능한 최신 패키지 집합이 있는지 확인할 수 있습니다.

If you are a package consumer, see Managing scoped registries for a project for information about connecting to an existing custom package registry server in your Unity project. If you are a package producer, see Sharing your package for information about supported package registry servers, and to get links to information on how to set them up to use with scoped registries.

Note: If you are setting up a scoped registry that points to a package registry server with restricted access, you can configure Package Manager to pass your npm authentication token to the server. For more information, see Scoped registry authentication.

범위 지정 레지스트리 임포트

If you are working in a shared project, and another user adds a scoped registry to the project, Unity warns you that another user added a new scoped registry.

Unity는 프로젝트의 범위 지정 레지스트리 리스트가 변경되면 경고를 표시합니다
Unity는 프로젝트의 범위 지정 레지스트리 리스트가 변경되면 경고를 표시합니다

When you click the Close button, the Package Manager project settings window appears so you can add, modify, or remove scoped registries for your project.

대신에 Read more 버튼을 클릭하면 기본 웹 브라우저에서 이 페이지가 열립니다.

팁:
To access the Package Manager project settings window at any time, use the main menu in Unity (Edit > Project Settings, then the Package Manager category) or select Advanced Project Settings from the advanced settings menu on the Package Manager window.

프로젝트의 범위 지정 레지스트리 관리

프로젝트에서 범위 지정 패키지 레지스트리를 관리하려면 프로젝트 매니페스트 파일을 직접 편집하거나 패키지 관리자 프로젝트 설정 창을 사용하여 Unity가 매니페스트를 자동으로 수정하도록 설정하십시오.

프로젝트 매니페스트는 범위 지정 레지스트리 설정 오브젝트의 배열이 들어 있는 scopedRegistries 프로퍼티를 사용합니다. 각 오브젝트에는 다음의 프로퍼티가 포함되어 있습니다.

프로퍼티 JSON 타입 설명
name String 사용자 인터페이스에 표시되는 범위 이름입니다. Package Manager 창의 패키지 세부 정보 뷰에 이 이름이 표시됩니다.

예: "name": "Tools"
url String npm 호환 레지스트리 서버의 URL입니다.

예: "url": "https://mycompany.example.com/tools-registry"

참고: 모든 레지스트리 공급자가 Unity의 패키지 관리자와 호환되는 것은 아닙니다. 추가하려는 패키지 레지스트리 서버가 /-/v1/search 또는 /-/all 엔드포인트를 구현하는지 확인하십시오.
scopes 문자열 배열 Array of scopes that you can map to a package name, either as an exact match on the package name, or as a namespace. Wildcards and other glob patterns aren’t supported.

For example, "scopes": [ "com.example", "com.example.tools.physics" ]

Note: This configuration type assumes that packages follow the Reverse domain name notation. This ensures that com.unity is equivalent to any package name that matches the com.unity namespace, such as com.unity.timeline or com.unity.2d.animation.

Warning: Unity doesn’t support npm’s scope notation.

When the Package Manager decides which registry to fetch a package from, it compares the package name to the scopes values and finds the registry whose scopes value is the closest match.

예를 들어 아래의 프로젝트 매니페스트에는 두 개의 범위 지정 레지스트리, 즉 “General”과 “Tools”가 있습니다.

{
    "scopedRegistries": [
        {
            "name": "General",
            "url": "https://example.com/registry",
            "scopes": [
                "com.example", "com.example.tools.physics"
            ]
        },
        {
            "name": "Tools",
            "url": "https://mycompany.example.com/tools-registry",
            "scopes": [
                "com.example.mycompany.tools"
            ]
        }
    ],
    "dependencies": {
        "com.unity.animation": "1.0.0",
        "com.example.mycompany.tools.animation": "1.0.0",
        "com.example.tools.physics": "1.0.0",
        "com.example.animation": "1.0.0"
    }
}

When the Package Manager looks up the com.example.animation package, it finds that the com.example namespace is the closest match to its name, and fetches that package from the “General” registry.

패키지 관리자가 com.example.tools.physics 패키지를 검색할 때 “General” 레지스트리에는 패키지 이름과 정확히 일치하는 범위가 있습니다.

When the Package Manager looks up the com.example.mycompany.tools.animation package, the Package Manager finds that the com.example.mycompany.tools namespace is the closest match to its name and fetches that package from the “Tools” registry. Even though it also matches the “General” scope, the com.example namespace isn’t as close a match.

When the Package Manager looks up the com.unity.animation package, the Package Manager doesn’t find a match in any of the scoped registries, so it fetches the package from the default registry.


패키지 에셋에 액세스
해결 및 충돌
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961