Package Manager 창에서 작업하는 경우 여러 소스에서 패키지를 설치(레지스트리, 로컬 폴더 또는 타르볼, Git URL, 이름)할 수 있습니다. 하지만 패키지 관리자는 이러한 소스에서 패키지를 원활하게 설치하는 동안, 먼저 설치할 버전을 결정하기 위해 일련의 계산을 수행해야 합니다. 또한 선택한 패키지를 지원하기 위해 설치할 다른 패키지 및 버전도 결정해야 합니다.
직접 종속성
Package Manager 창을 통해 설치할 패키지 버전을 선택하면 프로젝트 매니페스트에 “종속성”을 추가하게 됩니다.프로젝트가 작동하기 위해 특정 패키지의 특정 버전이 필요하다는 선언입니다.프로젝트에 종속성을 추가하려면 <project-root>/Packages/manifest.json
파일의 dependencies 프로퍼티에 package-name@package-version
형식의 패키지 및 버전에 대한 레퍼런스를 추가하십시오.프로젝트가 직접 종속되어 있으므로 이를 “직접” 종속성이라고 합니다.
간접 종속성
또한 패키지가 작동하려면 다른 패키지가 필요합니다. 이를 “간접” 또는 중간적 종속성이라고 부릅니다. 패키지 개발자는 개발 과정에서 이러한 종속성을 패키지 매니페스트 파일의 종속성 프로퍼티에 추가합니다(<package-root>/package.json
). 예를 들어 아래 다이어그램에서 alembic@1.0.7
패키지에는 timeline@1.0.0
패키지에 대한 종속성이 있으므로, 타임라인 패키지는 “간접 ” 종속성입니다. 반면에 프로젝트에는 cinemachine@2.6.0
및 alembic@1.0.7
패키지에 대한 종속성이 있으므로, 둘 다 “직접” 종속성입니다.
버전 오버라이드
패키지 버전을 종속성으로 추가하는 경우 해당 버전이 반드시 패키지 관리자가 설치하는 버전일 필요는 없습니다. 이는 직접 또는 간접 종속성인지 여부에 관계없이 패키지 관리자가 프로젝트의 모든 종속성을 고려해야 하기 때문입니다. 예를 들어 이 경우 요청된 XR Plugin Management 패키지는 4.0.3
버전이었습니다. 하지만 설치된 패키지 관리자는 4.0.6
버전인데, 이는 정보 메시지(B)에 표시된 것처럼 다른 패키지가 상위 버전에 종속되었기 때문입니다.
종속성 그래프
패키지 관리자는 한 번에 하나의 패키지 버전만 설치할 수 있으므로 종속성 그래프를 구성해야 합니다. 이 그래프는 프로젝트에 대한 모든 직간접 종속성의 목록입니다. 종속성 그래프에 따라 설치할 각 패키지 버전이 결정됩니다.
잠금 파일
패키지 관리자가 모든 버전 충돌을 성공적으로 해결하면 다음과 같은 두 가지 이유로 잠금 파일에 해결 방법을 저장합니다.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.