Click or drag to resize

ArticyFlowPlayer Class

Main flow traversal component. Used to automatically traverse the flow and notify about new branches and important objects.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          Articy.UnityArticyFlowPlayer

Namespace:  Articy.Unity
Assembly:  ArticyRuntime (in ArticyRuntime.dll) Version: 1.0.3
Syntax
C#
public class ArticyFlowPlayer : MonoBehaviour, 
	IArticyFlowPlayerCallbacks

The ArticyFlowPlayer type exposes the following members.

Properties
  NameDescription
Public propertyAvailableBranches
Gets the currently available branches.
Public propertyBranchSorting
Defines how to sort branches within the flow.
Public propertyCurrentObject
Gets the current paused on object.
Public propertyGlobalVariables
Set to change the used variable storage.
Public propertyMethodProvider
Gets or sets the method provider
Public propertyPausedOn
Gets the current paused on flow element.
Public propertyStartOn
Gets or sets the object that is used as the root for traversal.
Public propertyUseOldInputPinResolving
If enabled the plugin will resolve input pins like in older plugin versions.
Top
Methods
  NameDescription
Public methodFinishCurrentPausedObject
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.
Public methodStatic memberGetBranchesOfNode(IArticyObject, ArticyFlowPlayer)
Conveince method that sets StartOn and immediately returns AvailableBranches.
Public methodStatic memberGetBranchesOfNode(IArticyObject, PausableObjectTypes, IBaseScriptMethodProvider, BaseGlobalVariables)
Conveince method that set ups a flow player with the given arguments, sets StartOn and immediately returns AvailableBranches.
Public methodPlay
Continues the traversal using the first branch.
Public methodPlay(Int32)
Continues the traversal with a branch selected by index.
Public methodPlay(Branch)
Continues the traversal after a stop following the given branch.
Public methodPlayRandom
Continues the traversal with a randomly selected branch out of the available.
Top
Fields
  NameDescription
Public fieldcontinouslyRecalculateInterval
This is the interval in seconds used when recalculating branches.
Public fieldcontinuouslyRecalculateBranches
If enabled the flow player will check every continouslyRecalculateInterval seconds for new branches.
Public fieldignoreInvalidBranches
Determines how invalid branches are handled when the flow player is automatically traversing the flow.
Public fieldCode examplepauseOn
Determines which articy objects are valid pause types, to interrupt the traversal.
Top
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.

See Also