Class PackageExtensions
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
AssetIdThe 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
UFileThe 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
PackageThe package.
reference
IReferenceThe reference to the asset.
Returns
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
PackageThe root package.
includeRootPackage
boolif set to
true
[include root package].
Returns
- PackageCollection
List<Package>.
Exceptions
- ArgumentNullException
rootPackage
- ArgumentException
Root package must be part of a session;rootPackage