Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

IAssetProvider

Contains methods for accessing assets of a given type stored within an object.
public interface IAssetProvider

#Methods

#GetAssetsOfType<T>()

Gets a collection of assets of type T from the target.
public IEnumerable<T> GetAssetsOfType<T>()
    where T : UnityEngine.Object;

Type Parameters

  • T
    The type of the asset.

Returns IEnumerable: A collection of assets. This collection may be empty.

#TryGetAsset<T>(T?)

Attempts to fetch an asset of type T from the object.
public bool TryGetAsset<T>([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T? result)
    where T : UnityEngine.Object;

Type Parameters

  • T
    The type of the assets.

Parameters

  • resultT
    On return, the fetched asset, or null.

Returns Boolean: true if an asset was fetched; false otherwise.

Generated from Yarn Spinner for Unity 3.3.