Controlling Transitions with Conditions and Action Chains
ThisdaIn pagethis walkspage, you through implementingimplement a conditional automatic transition for the DetailView, combining a timer with a checkbox value. The central concept heretheme is the division of roles: the Action Chain Editor is wherethe youplace to build the processing flow, andwhile the Condition Editor is wherethe youplace independentlyto define the condition expressions.expression independently. You will create abuild behavior that returns to the MainView after a certain amount of time haselapses elapsed sinceafter entering the DetailView, while stopping thatthe automatic auto-transition only when the KeepDetailOpenCheckBoxKeep Detail Open CheckBox is checked.on. This lets you understand inthe practicecoordination howof Triggers,triggers, Conditions,conditions, and Actionsactions workin together.practice. In particular, in this page, setting the OperationMode of Check Processed Value to CompareExternalValueWithConditionValue is the key to correct operation on this page.behavior.
Configuring the CheckBox Control
First, you convert the state of the CheckBox control placed in the DetailContent scene into a form thatreadable by the Condition Editor can read.Editor. If you skip this step, you cannot use the current checkchecked state withinin a condition expression.
- Double-click the DetailContent scene to open the Scene Editor.
SelectKeepDetailOpenCheckBoxinIn the SceneTree.Tree, select KeepDetailOpenCheckBox.- Drag and drop a Forward Value behavior onto the Extra Scene Tree.
- Select the added Forward Value behavior
you just addedand configure the following properties in the Properties panel:
Property Category Item Value Asset EventDispatchStrategy DedicatedBehavior - Add a Value behavior under
theDedicatedBehaviornodeof the Forward Value behavior. - Drag and drop the added Value behavior
you just addedonto the DetailContent scene in the Scene Tree to associate it.
ThisWith configurationthis causesconfiguration, the current value of the CheckBox control'scontrol current value to beis held on the scene nodenode, side, making it available toand the Condition Editor can reference it as an external value. The Valuetarget that you created here is the target you will specify as the ValueBehavior in the next step.step is the Value you created here.
Configuring the ConditionBlock
Here, you define the condition logic that determines whether the automatic transition is allowed, separately from the Action Chain. By isolatingSeparating the condition,condition youmakes canit easier to understand the processing flow and the evaluation logic independently.
In this task, you createbuild a condition that evaluates tobecomes true only when both the timer has fired and the KeepDetailOpenCheckBoxKeep Detail Open CheckBox is unchecked.off. This is the heart of the conditional transition.
SelectIntheSolutionSolutionExplorer,folder inselect the SolutionExplorer,folderthenand select Add > New Item from the context menu.SelectConditionBlockfromIn the New Itemdialogdialog, select ConditionBlock and name itReturnToMainOnTimeoutCondition.ReturnToMainOnTimeoutCondition.- The Condition Editor panel
appears,appearsdisplayingand displays the diagramforof the newly created ReturnToMainOnTimeoutCondition > Condition.
- The Condition Editor panel
Right-clickOn thediagramdiagram, use the context menu and select Add Check > Condition > Control > Check Timer to add it to the diagram.Similarly,In the same way, from the context menu, select Add Check > Condition > Control > Check Processed Valuefrom the context menuto add it to the diagram.- Select the added Check Processed Value
you just addedand configure the following properties in the Properties panel:
Property Category Item Value Asset OperationMode CompareExternalValueWithConditionValue ConditionOperator Equal ConditionValue type Bool ConditionValue False ValueBehavior DetailContent scene > Value - Next, from the context menu, select Add AND
from the context menuto add an AND node. - Connect Check Timer and Check Processed Value to the
AND node.AND. - Connect the output of the AND
nodetoConditionOutput.the ConditionOutput.


The meaning of the condition createdbuilt here means:is: allow the automatic transition only when the timer has fired and the checkbox is unchecked.off. The OperationMode setting is particularlyespecially important. If you set thisit to aan processed-in-process event-dependent mode such as CompareProcessedValueWithConditionValue, no value event to compare against exists for comparison at the time of the Timer event, and the condition cannotis benot evaluated correctly. The correct choice here is CompareExternalValueWithConditionValue, which references the external value held on the scene node.
Configuring the DetailView On Entry Settingfor DetailView
Next, you configure athe settingaction that starts athe timer at the moment youof enter theentering DetailView. NoAt this point, no transition occurs atyet this— point; this stepyou only establishesset up the reference time for the subsequent condition evaluation.
You can edit a View's OnEntry action in the OnEntry / OnExit Editing Mode of the Action Chain Editor. This tutorial uses this method.
- Double-click MainViewTree to open the View Tree panel.
- Double-click DetailView to open the Action Chain Editor.
On the right side of the pseudo-block, select Add Action > Action > Control > Start Timer from the context menu to add a Start Timer action.
Select
| Property Category | Item | Value |
This settingconfiguration meansmeans: thatuse 3the moment three seconds after entering the DetailView is used as the timing for the automatic transition evaluation.decision. Note that starting the timer and performing the transition itself are separate configurations. The content added to OnEntry in the Action Chain Editor is automatically synchronized with the OnEntry property of DetailView.
Configuring the Action Chain
Finally, you build thea processing flow that receives the timer firing,event, evaluates the ConditionOutput, and returns to the MainView only when the result is true. This is wherethe first point at which the Action Chain Editor and the Condition Editor work together for the first time.together.
Double-click MainViewTree to open the View Tree panel.
Double-click DetailView to open the Action Chain Editor.
Double-clickActionChain1inIn the leftpanepane, double-click ActionChain1 to open the diagram.-
Right-clickOn thediagramdiagram,andfrom the context menu Add Condition, select the Condition of thepreviouslyReturnToMainOnTimeoutCondition you createdCloseMenuOnTimeoutConditionfromAdd Conditionearlier to add it. -
SelectFrom the context menu, select Add Action > Action > Views > Jump To Viewfrom the context menuand place it on the diagram. -
Select the Jump To View and configure the following properties in the Properties panel:
Property Category Item Value General Name JumpToMainViewAfterTimeout Asset View MainView - From
Selectthe context menu, select Add Trigger > Condition > Control > Check Timerfrom the context menuand place it on the diagram. - On
Condition.Connectthe diagram, connect Check TimerandtoConditionon the diagram.


-
Finally, snap the
**Jump ToView**View action to the**Condition**Condition to connect them.


This configuration means: when the Check Timer fires, the system evaluatesevaluate the ConditionOutput of ReturnToMainOnTimeoutCondition, and ifreturn to MainView only when the result is true, returns to the MainView.true. If you connect Check Timer anddirectly to Jump To View directly,View, the system always returns after the timer elapses,elapses and cannot reflect the checkbox state. By placing thea ConditionOutput in between, the transition becomes a conditional for the first time.one.
Verifying the Behavior in the Player
ThisIn verificationthis confirmsverification, you confirm not onlyjust the automatic transition triggered by the timer,timer itself, but also that the behavior changes depending on the checkbox state. This is the final check to ensureverify that the division of roles between the Action Chain and the Condition is functioning correctly.
- Save the solution and
startlaunch the Player.- Verify that
theMainViewappearsis displayed immediately afterstartup.launch.
- Verify that
- Click the Open Detail
.button.- Verify that the
displayscreen switches totheDetailView.
- Verify that the
- Leave the Keep Detail Open checkbox
uncheckedoff and wait3for three seconds.- Verify that the
display automaticallyscreen returns totheMainViewMainView.automatically.
- Verify that the
- Click the Open Detail button again.
- This time,
checkturn the Keep Detail Opencheckbox.checkbox on.- Verify that the
displayscreen does not return automaticallyreturneven afterapproximatelywaiting3about three seconds.
- Verify that the
- Verify that you can return to
theMainView by clicking the Back.button.
OnIn this page, you used the Action Chain Editor and the Condition Editor together to implementimplemented a conditional automatic transition whose behavior changes dependingaccording onto the UI state.state, by coordinating the Action Chain Editor with the Condition Editor. With this, you have practiced all four basic functionsfeatures of the View Editor: creating screen-level Views within the View Definition Editor, structuringconfiguring their relationships within the View Tree, building processing flows within the Action Chain Editor, and isolatingseparating condition expressions within the Condition Editor. ThisThe completescomplete flow of the entire tutorial series.is now finished.