IArticyFlowPlayerCallbacksOnFlowPlayerPaused Method |
Namespace: Articy.Unity
void OnFlowPlayerPaused( IFlowObject aObject )
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.
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); }