PackageExtensions Class
Namespace: Stride.Core.AssetsAssembly: Stride.Core.Assets.dll
Extensions for Package
public static class PackageExtensions
              | Name | Description | |
|---|---|---|
| Methods | ||
| ContainsAsset(IEnumerable<Package>, AssetId) | Determines whether the specified packages contains an asset by its guid.  | 
                          |
| ContainsAsset(IEnumerable<Package>, UFile) | Determines whether the specified packages contains an asset by its location.  | 
                          |
| FindAsset(Package, IReference) | Finds an asset from all the packages by its asset reference. It will first try by id, then location.  | 
                          |
| FindDependencies(Package, Boolean) | Finds the package dependencies for the specified Package. See remarks.  | 
                          |
Methods
ContainsAsset(IEnumerable<Package>, AssetId)
Determines whether the specified packages contains an asset by its guid.
public static bool ContainsAsset(this IEnumerable<Package> packages, AssetId assetId)
              Parameters
| Type | Name | Description | 
|---|---|---|
| System.Collections.Generic.IEnumerable<Package> | packages | The packages.  | 
                  
| AssetId | assetId | The asset unique identifier.  | 
                  
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
  | 
                  
ContainsAsset(IEnumerable<Package>, UFile)
Determines whether the specified packages contains an asset by its location.
public static bool ContainsAsset(this IEnumerable<Package> packages, UFile location)
              Parameters
| Type | Name | Description | 
|---|---|---|
| System.Collections.Generic.IEnumerable<Package> | packages | The packages.  | 
                  
| Stride.Core.IO.UFile | location | The location.  | 
                  
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
  | 
                  
FindAsset(Package, IReference)
Finds an asset from all the packages by its asset reference. It will first try by id, then location.
public static AssetItem FindAsset(this Package package, IReference reference)
              Parameters
| Type | Name | Description | 
|---|---|---|
| Package | package | The package.  | 
                  
| IReference | reference | The reference to the asset.  | 
                  
Returns
| Type | Description | 
|---|---|
| AssetItem | An AssetItem or   | 
                  
FindDependencies(Package, Boolean)
Finds the package dependencies for the specified Package. See remarks.
public static PackageCollection FindDependencies(this Package rootPackage, bool includeRootPackage = false)
              Parameters
| Type | Name | Description | 
|---|---|---|
| Package | rootPackage | The root package.  | 
                  
| System.Boolean | includeRootPackage | if set to   | 
                  
Returns
| Type | Description | 
|---|---|
| PackageCollection | List<Package>.  | 
                  
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentNullException | rootPackage  | 
                  
| System.ArgumentException | Root package must be part of a session;rootPackage  |