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).

RandomBestLeastRecentlyViewedSaliencyStrategy

A content saliency strategy that returns a random choice of the best, least-recently seen choices from the provided options.
public class RandomBestLeastRecentlyViewedSaliencyStrategy : IContentSaliencyStrategy

Inherits from System.Object

Implements Yarn.Saliency.IContentSaliencyStrategy

This strategy stores information about the number of times each piece of content has been seen in the provided Yarn.Saliency.RandomBestLeastRecentlyViewedSaliencyStrategy.VariableStorage.

#Constructors

#RandomBestLeastRecentlyViewedSaliencyStrategy(IVariableStorage)

Initializes a new instance of the RandomBestLeastRecentlyViewedSaliencyStrategy class.
public RandomBestLeastRecentlyViewedSaliencyStrategy(IVariableStorage storage)

Parameters

Exceptions

  • System.ArgumentNullException
    Thrown when the provided storage argument is null.

#Methods

#ContentWasSelected(ContentSaliencyOption)

Called by Yarn Spinner to indicate that a piece of salient content has been selected, and this system should update any state related to how it selects content.
public void ContentWasSelected(ContentSaliencyOption content)

Parameters

If a content saliency strategy does not need to keep track of any state, then this method can be empty.

#QueryBestContent(IEnumerable<ContentSaliencyOption>)

Chooses an item from content that is the most appropriate (or salient) for the user's current context.
public ContentSaliencyOption? QueryBestContent(IEnumerable<ContentSaliencyOption> content)

Parameters

  • contentIEnumerable<Yarn.Saliency.ContentSaliencyOption>
    A collection of content items. This collection may be empty.

Returns ContentSaliencyOption: An item from content that is the most appropriate for display, or null if no content should be displayed.

Implementations of this method should not modify any state - that is, they should be 'read-only' operations. If a strategy needs to record information about when a piece of content has been selected, it should do it in the ContentWasSelected(ContentSaliencyOption) method.

Generated from Yarn Spinner for Unity 3.3.