Version: 2022.1
언어: 한국어
패키지 상태 및 라이프사이클
전역 캐시

종속성 및 해결

Package Manager 창에서 작업하는 경우 다양한 소스(레지스트리, 로컬 폴더, 타르볼Git URL)에서 패키지를 설치할 수 있습니다. 하지만 패키지 관리자가 이러한 소스에서 패키지를 원활하게 설치하지만, 먼저 일련의 계산을 통해 설치할 버전 그리고 이 버전을 지원하기 위해 설치할 다른 패키지 및 버전을 결정해야 합니다.

Direct dependencies

When you select a package version to install through the Package Manager window, you are adding a “dependency” to your project manifest. This is a declaration that you need a specific version of a particular package in order for the project to work. To add a dependency to your project, you add a reference to the package and version in the form package-name@package-version to the dependencies property of the <project-root>/Packages/manifest.json file. These are called “direct” dependencies because your project directly depends on them.

Indirect dependencies

Packages can also require other packages in order to work. These are called “indirect”, or transitive, dependencies. The package developer adds these to the dependencies property of the package manifest file during development (<package-root>/package.json). For example, in the diagram below, the alembic@1.0.7 package has a dependency on the timeline@1.0.0 package, so the timeline package is an “indirect ”dependency. On the other hand, the project has dependencies on the cinemachine@2.6.0 and alembic@1.0.7 packages, so those are both “direct” dependencies.

직접 종속성과 간접 종속성을 보여주는 다이어그램

Version overrides

When you add a package version as a dependency, that version is not necessarily the version that the Package Manager installs, because it has to consider all of the dependencies in your project, whether direct or indirect. For example, in this case, the XR Plugin Management package requested was version 4.0.3, but the installed version is actually version 4.0.6 because another package depended on the higher version, as indicated in the information message (B):

세부 정보 창(A)에서 정보 버튼을 클릭하면 요청한 버전 대신 이 버전이 설치된 이유를 설명하는 텍스트 상자(B)가 나타납니다
세부 정보 창(A)에서 정보 버튼을 클릭하면 요청한 버전 대신 이 버전이 설치된 이유를 설명하는 텍스트 상자(B)가 나타납니다

Dependency graph

패키지 관리자는 한 번에 하나의 패키지 버전만 설치할 수 있으므로, 프로젝트에 대한 모든 직접 및 간접 종속성 리스트인 종속성 그래프를 구성해야 합니다. 종속성 그래프는 설치할 각 패키지의 버전을 결정합니다.

Lock file

패키지 관리자가 모든 버전 충돌을 성공적으로 해결하면 잠금 파일에 해결 방법을 저장하여 결정론적 분명성을 보장(매번 동일한 패키지가 안정적으로 설치됨)하고, 종속성 그래프를 다시 계산하는 데 필요한 시간과 리소스를 줄입니다.


패키지 상태 및 라이프사이클
전역 캐시
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961