Click or drag to resize

IArticyFlowPlayerCallbacksOnFlowPlayerPaused Method

Called when the traversal has found a valid stop target, or when the execution has reached a dead end.

Namespace:  Articy.Unity
Assembly:  ArticyRuntime (in ArticyRuntime.dll) Version: 1.0.3
Syntax
C#
void OnFlowPlayerPaused(
	IFlowObject aObject
)

Parameters

aObject
Type: Articy.UnityIFlowObject
The found object.
Remarks

This is the most common way of the flow player to tell about an object you are interested in. How you implement this is highly depending on your use case, for example you could show the object in your UI, modify it or trigger custom game logic events depending on the type.

The supplied type is IFlowObject but basically all articy objects, that can be encountered in the flow, implement this interface. So you can write code that tests for a specific type or interface.

C#
void OnFlowPlayerPaused(IFlowObject aObject)
{
    // using property interfaces
    var txtObj = aObject as IObjectWithText;
    if(txtObj != null)
        Debug.Log(txtObj.Text);
    var clObj = aObject as IObjectWithColor;
    if(clObj != null)
        gameObject.renderer.material.color = clObj.Color;
    // using basic type interfaces
    var dlgFragment = aObject as IDialogueFragment;
    if(dlgFragment != null)
        Debug.Log(txtObj.TechnicalName);
    // using explicit type (remember that this is for object WITHOUT an template) and only works if you exported that property on FlowFragments
    var flwFragment = aObject as FlowFragment;
    if(dlgFragment != null)
        Debug.Log(flwFragment.Attachements.Count);
}
See Also