패키지가 들어 있는 모든 로컬 폴더 또는 타르볼로 종속성을 지정할 수 있습니다. 이 기능은 로컬 오프라인 개발 및 테스트에 유용합니다.
Note: If you want to reference a package on the local file system as a Git dependency, use the file://<url>
format instead. Unity doesn’t support directly referencing a locally accessible Git repository with a file path. For more information on the file://<url>
format, refer to Git dependencies.
이 섹션에서는 프로젝트 매니페스트를 사용하여 로컬 종속성을 설정하는 방법을 설명합니다. 대신 Package Manager 창을 사용하려면 다음 페이지의 지침을 따르십시오.
경로 레퍼런스는 file:
접두사로 시작하고 포워드슬래시(/
)를 경로 구분자로 사용합니다.
Note: On Windows, you can also use backslashes (\
), but only if you escape each one (for example, "file:..\\github\\my_package_folder"
or "file:C:\\Users\\my_username\\github\\my_package_folder"
). These paths aren’t as easy to read as the forward slashes, they’re prone to typing errors, and you can’t use them anywhere but on a Windows machine. For these reasons, using forward slashes is preferable.
절대 경로, 또는 프로젝트의 Packages
폴더에 상대적인 경로(즉 프로젝트 매니페스트의 루트 폴더)를 사용할 수 있습니다. 즉, 앞에 두 개의 점(..
)이 붙은 경로는 프로젝트 경로의 루트를 나타냅니다. 따라서 ../another_folder
는 Packages
폴더의 형제입니다.
Tip: Relative paths with forward-slashes offer better portability across different machines and operating systems when tracking a project and packages in the same repository.
For Windows absolute paths, the drive letter and its colon (usually C:
) follows the file:
prefix but is otherwise the same as Linux or macOS paths.
After the file:
prefix, the path is a standard relative path. In the following example:
Packages
folder is C:\Users\my_username\Projects\my_project\Packages
.Projects
, github
, and Downloads
folders are peer folders.my_package_c
is an embedded package (a package whose folder was copied into the Packages
folder, to make it mutable).{
"dependencies": {
"my_package_a": "file:../github/my_package_folder",
"my_package_b": "file:../Downloads/my_package_tarball.tgz"
"my_package_c": "file:com.unity.textmeshpro"
}
}
After the file:
prefix, the path is a standard Portable Operating System Interface (POSIX) path, starting with a forward slash /
:
{
"dependencies": {
"my_package_a": "file:/Users/my_username/github/my_package_folder",
"my_package_b": "file:/Users/my_username/Downloads/my_package_tarball.tgz"
}
}
드라이브 문자는 file:
접두사 바로 뒤에 옵니다.
{
"dependencies": {
"my_package_a": "file:C:/Users/my_username/github/my_package_folder",
"my_package_b": "file:C:/Users/my_username/Downloads/my_package_tarball.tgz"
}
}