Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    PackageExtensions Class

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

    Extensions for Package

    System.Object → PackageExtensions
    Derived from PackageExtensions:

    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.

    | Improve this Doc View Source

    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

    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
    Type Name Description
    System.Collections.Generic.IEnumerable<Package> packages

    The packages.

    Stride.Core.IO.UFile location

    The location.

    Returns
    Type Description
    System.Boolean

    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
    Type Name Description
    Package package

    The package.

    IReference reference

    The reference to the asset.

    Returns
    Type Description
    AssetItem

    An AssetItem or null if not found.


    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 true [include root package].

    Returns
    Type Description
    PackageCollection

    List<Package>.

    Exceptions
    Type Condition
    System.ArgumentNullException

    rootPackage

    System.ArgumentException

    Root package must be part of a session;rootPackage


    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation