ArticyFlowPlayer Class

Main flow traversal component. Used to automatically traverse the flow and notify about new branches and important objects.

Definition

Namespace: Articy.Unity
Assembly: ArticyRuntime (in ArticyRuntime.dll) Version: 1.3.1
C#
public class ArticyFlowPlayer : MonoBehaviour, 
	IArticyFlowPlayerCallbacks
Inheritance
Object    Object    Component    Behaviour    MonoBehaviour    ArticyFlowPlayer
Implements
IArticyFlowPlayerCallbacks

Remarks

Attach this component to one of your game objects to have access to a single flow traversal unit. You can set a startOn object on which the ArticyFlowPlayer should start traversing. The flow player will walk the flow until it hits an object of the type you supplied in pauseOn and calls on your game object a method called "OnFlowPlayerPaused" and/or until the flow is no longer distinct. In this case, the flow player will notify you about all available options, called branches, via a method on your game object called "OnBranchesUpdated. Once stopped, the flow player can continue traversal by calling one of the Play() methods.

The flow player and the underlying ExecutionEngine will automatically take care of evaluating all found scripts and storing the modified variables.

It is perfectly valid to have multiple ArticyFlowPlayers in your scene and/or game. Unless overwritten each new flow player will use the same default Global variables, this default can be found on DefaultGlobalVariables. If necessary you can create a new instance of a Global Variable Storage (Via unity menu entry "Articy/Create new global variables copy" and assign this in the inspector to your ArticyFlowPlayer component.

If you script code contains methods, the flow player will need your help to call the correct implementation. To do that, your game object, hosting the ArticyFlowPlayer needs to implement the generated interface called IScriptMethodProvider". Once implemented, if the flow player encounters a method inside the scripts, it will call your game object and use the correct method.

Properties

AvailableBranches Gets the currently available branches.
BranchSorting Defines how to sort branches within the flow.
CurrentObject Gets the current paused on object.
GlobalVariables Set to change the used variable storage.
MethodProvider Gets or sets the method provider
PausedOn Gets the current paused on flow element.
StartOn Gets or sets the object that is used as the root for traversal.
UseOldInputPinResolving If enabled the plugin will resolve input pins like in older plugin versions.

Methods

FinishCurrentPausedObject Use this to call the script on an output pin of the current object. When a branch has successive output pins due nested flow objects, this method go up in the flow hierarchy and call these scripts too.
GetBranchesOfNode(IArticyObject, ArticyFlowPlayer) Conveince method that sets StartOn and immediately returns AvailableBranches.
GetBranchesOfNode(IArticyObject, PausableObjectTypes, IBaseScriptMethodProvider, BaseGlobalVariables) Conveince method that set ups a flow player with the given arguments, sets StartOn and immediately returns AvailableBranches.
Play Continues the traversal using the first branch.
Play(Branch) Continues the traversal after a stop following the given branch.
Play(Int32) Continues the traversal with a branch selected by index.
PlayRandom Continues the traversal with a randomly selected branch out of the available.

Fields

continouslyRecalculateInterval This is the interval in seconds used when recalculating branches.
continuouslyRecalculateBranches If enabled the flow player will check every continouslyRecalculateInterval seconds for new branches.
ignoreInvalidBranches Determines how invalid branches are handled when the flow player is automatically traversing the flow.
onBranchesUpdated Called when the traversal found multiple branches and/or when the execution paused because of a PausedOn, or it found a dead end.
onFlowPlayerPaused Called when the traversal has found a valid stop target, or when the execution has reached a dead end.
pauseOn Determines which articy objects are valid pause types, to interrupt the traversal.

See Also