Struct Sample
Struct for Package Sample
Inherited Members
Namespace: UnityEditor.PackageManager.UI
Syntax
public struct Sample
Properties
description
Declaration
public string description { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The description of the package sample |
displayName
Declaration
public string displayName { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The display name of the package sample |
importPath
Declaration
public string importPath { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The full path to where the sample will be imported, under the project assets folder. It is in the form of |
interactiveImport
Declaration
public bool interactiveImport { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Indicates whether to show the import window when importing a sample that is an asset package (a .unitypackage file) |
isImported
Declaration
public bool isImported { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Indicates if the sample has already been imported |
resolvedPath
Declaration
public string resolvedPath { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The full path to where the sample is on disk, inside the package that contains the sample. It is usually in the form ofResolved Full Path to Package/Samples~/Sample Display Name/
|
Methods
FindByPackage(String, String)
Given a package of a specific version, find a list of samples in that package.
Declaration
public static IEnumerable<Sample> FindByPackage(string packageName, string packageVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | packageName | The name of the package |
| System.String | packageVersion | The version of the package |
Returns
| Type | Description |
|---|---|
| IEnumerable<Sample> | A list of samples in the given package |
Import(Sample.ImportOptions)
Imports the package sample into the Assets folder.
Declaration
public bool Import(Sample.ImportOptions options = Sample.ImportOptions.None)
Parameters
| Type | Name | Description |
|---|---|---|
| Sample.ImportOptions | options | Custom import options. See Sample.ImportOptions for more information. Note that Sample.ImportOptions are flag attributes, therefore you can set multiple import options using the| operator
|
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns whether the import is successful |