2019.1부터 패키지에 샘플을 추가할 수 있습니다. 샘플은 일반적으로 프로젝트의 에셋
폴더에서 찾을 수 있는 예제 코드, 몇 가지 셰이더와 텍스처, 일부 애니메이션 또는 다른 파일이 될 수도 있습니다.
사용자가 패키지 관리자 창을 열어 샘플이 포함된 패키지를 선택하면 패키지에 있는 각 샘플에 대한 패키지 세부 정보 창에 Import 버튼이 표시됩니다. 사용자가 Import 버튼을 클릭하면 패키지 관리자는 프로젝트의 에셋
폴더에 있는 해당 샘플에 대한 전체 하위 폴더 구조를 복사합니다.
패키지에 샘플을 추가하려면 다음 단계를 따르십시오.
Samples
로 시작하는 폴더 아래에 놓습니다. 패키지 안에는 다음과 같이 샘플을 하나 이상 둘 수 있습니다. Samples
로 시작하는 폴더의 각 하위 폴더는 샘플 하나를 포함합니다.Package.json
패니페스트 파일의 samples
배열 아래 각 샘플용 JSON 객체를 추가합니다.패키지의 Samples
로 시작하는 폴더의 하위 폴더 아래에 샘플 에셋을 추가할 수 있습니다. 예를 들어 셰이더 샘플이 있는 패키지는 다음과 같이 보일 수 있습니다.
MyPackage
├── package.json
└── Samples
├── SamplesHDRP
│ ├── Textures
│ | ├── MossyRock.bmp
│ | └── SandyRock.bmp
│ └── Shader
│ ├── Lit Texture Blend HDRP.ShaderGraph
│ └── Lit Vertex Color HDRP.ShaderGraph
└── SamplesStandard
│ ├── Textures
│ | ├── MossyRock.bmp
│ | └── SandyRock.bmp
│ └── Shader
│ ├── StandardTextureBlend.shader
│ └── StandardVertexColor.shader
└── SamplesUniversalRP
├── Textures
| ├── MossyRock.bmp
| └── SandyRock.bmp
└── Shader
├── Lit Texture Blend URP.ShaderGraph
└── Lit Vertex Color URP.ShaderGraph
samples
라고 부르는 package.json
파일에 JSON 배열을 추가합니다. 각 샘플에는 최소한 다음과 같은 displayName
과 path
를 포함하고 있는 JSON 객체를 샘플 폴더에 추가합니다.
Value: | 설명: |
---|---|
displayName |
패키지 관리자 창의 패키지 세부 정보에 표시되는 샘플 이름입니다. |
description |
샘플이 설명하거나 포함하고 있는 내용에 대한 간단한 설명입니다. 이 부분은 패키지 매니페스트에만 해당됩니다. 설명은 툴팁으로도 인터페이스에 표시되지 않습니다. |
path |
Samples 로 시작하는 폴더에서 샘플의 루트 폴더까지의 경로입니다. |
예를 들어 샘플 파일의 위치에 대한 예제로 동일한 구조를 사용하면 samples
섹션은 다음과 유사하게 보입니다.
{
"samples": [
{
"displayName": "HDRP Shaders",
"description": "Contains sample shaders for the High Definition render pipeline",
"path": "Samples~/SamplesHDRP"
},
{
"displayName": "URP Shaders",
"description": "Contains sample shaders for the Universal render pipeline",
"path": "Samples~/SamplesUniversalRP"
},
{
"displayName": "Standard RP Shaders",
"description": "Contains sample shaders for the Standard render pipeline",
"path": "Samples~/SamplesStandard"
}
]
}
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.