Adding tests to a package
Creating samples for packagesStarting with Unity Editor version 2019.1, you can add samples to a package. A sample might be a piece of example code, some shadersA program that runs on the GPU. More info
See in Glossary and textures, some animation, or any other files that you can usually find under the projectâs Assets
folder.
When you open the Package Manager window and select a package containing samples, an Import button appears in the packageâs details panel for each sample in the package. When you select Import, the Package Manager copies the whole subfolder structure for that sample under the projectâs Assets
folder.
To add samples to your package:
Put the asset files or example C# code files under the Samples~ folder. You can have more than one sample in a package; each subfolder of the Samples~
folder has one sample.
Note: The tilde character (~
) tells Unity to ignore the contents the Samples~
folder. Such folders arenât tracked with .meta
files.
Add a JSON object for each sample under the samples
array in your package.json
manifest file.
You can add your sample assets under subfolders of the Samples~
folder of your package. For example, a package with shader samples might look something like this:
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
Include your samples in the manifest
Add a JSON array called samples
to the package.json
file. For each sample, add a JSON object containing at least the displayName
and the path
to the samples folder:
displayName
The name of the sample as it appears in the package details in the Package Manager window. description
A brief description of what the sample demonstrates or contains. This is just for the package manifestEach package has a manifest, which provides information about the package to the Package Manager. The manifest contains information such as the name of the package, its version, a description for users, dependencies on other packages (if any), and other details. More infopath
The path from the Samples~
folder to the sampleâs root folder.
For example, using the same structure as the example for Location of sample files, the samples
section looks similar to this:
{
"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"
}
]
}
Adding tests to a package
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4