Step 4: Add scripts for procedures
- Last UpdatedJan 20, 2025
- 2 minute read
Scripts are needed to handle the start and exit of the procedures. These scripts provide a way to add additional application behaviors or functionality when a procedure is started or stopped.
Techniques
There are two techniques you can use to add a script to manage the procedures. It is your choice how to manage project scripts, however, new script files must be <include> for the XR engine to parse and execute them.
-
Create a new script file and add scripts to this new file.
-
Add procedure scripts to existing XML script file apm_data_sampleAsset.
Create a new script file
-
In Project Explorer, right-click Apm_sample, point to Add New File, then click Script.

-
Enter a name for the script file and click OK.

The new script file will be created under the project GameData\Logic\user directory and will be added to the Apm_sample section of the Project Explorer.
-
Include this new script file in graphic_context_logic.xml using the following code. This will instruct the XR engine to parse and load this script when running the project
<include name="user/Procedures.xml"/>
-
In this new script called Procedures.xml you must add the following scripts.