Table of Contents

Class PackageExtensions

Namespace
Stride.Core.Assets
Assembly
Stride.Core.Assets.dll

Extensions for Package

public static class PackageExtensions
Inheritance
PackageExtensions

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

packages IEnumerable<Package>

The packages.

assetId AssetId

The asset unique identifier.

Returns

bool

true if the specified packages contains asset; otherwise, false.

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

packages IEnumerable<Package>

The packages.

location UFile

The location.

Returns

bool

true if the specified packages contains asset; otherwise, false.

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

package Package

The package.

reference IReference

The reference to the asset.

Returns

AssetItem

An AssetItem or null if not found.

FindDependencies(Package, bool)

Finds the package dependencies for the specified Package. See remarks.

public static PackageCollection FindDependencies(this Package rootPackage, bool includeRootPackage = false)

Parameters

rootPackage Package

The root package.

includeRootPackage bool

if set to true [include root package].

Returns

PackageCollection

List<Package>.

Exceptions

ArgumentNullException

rootPackage

ArgumentException

Root package must be part of a session;rootPackage