A template for UXF projects that uses experiment server with a calibration phase before any given block.
Install as a git dependency (https://docs.unity3d.com/Manual/upm-ui-giturl.html)
or
Add it as an embedded package - Clone/copy/submodule this repo into the Packages directory of your unity project.
A representation of the process can be seen in the following activity chart. Note that the user-defined lane are functionalities expected to be provided by the user:
To use this, extend the ubc.ok.ovilab.uxf.extensions.BlockData.
Data from the experiment server would be parsed to this class.
Then use that as the generic type and implement the ubc.ok.ovilab.uxf.extensions.ExperimentManager abstract class.
There are two ways to use data from the experiment_server
- Connecting to an server endpoint launched with
epxeriment-server run - Using the json file generated by
experiment-server generate-config-json
Create a DataSource asset (in the create asset menue UXF > Extensions > DataSource) and configure how the data is loaded.
In the Unity Scene, ensure the extended implemenation of ExperimentManager class is setup with the DataSource added, setup the button and UI elements and provide the session details. If these values are not being set, this can also be done programatically with ExperimentManager.SessionBeginParams and ExperimentManager.MoveToNextState. Note that you also can use the UXF UI to start a session. NOTE: If using the UXF UI to provide the participant id, currently it wil not be used. Instead the participant index configured on experiment-server will be used.
See documentation on ubc.ok.ovilab.uxf.extensions.IExperimentManager and ubc.ok.ovilab.uxf.extensions.ExperimentManager for more details.
The following state diagram shows the state transitions of the ExperimentManager:
The current state can be accessed with ExperimentManager.CurrectState. When state changes, the ExperimentManager.StateChanged event will be fired. See documentation on ubc.ok.ovilab.uxf.extensions.ExperimentManagerState for more details.
- The package comes with 2 Samples
Config files to setup the experiment server. After importing copy the direcotry in Assets/Samples/UXF extensions/0.1.1/Sample experiment-server setup to the root of the unity project (e.g. Experiment).
Contains a sample implemenation. The implementation is based on the study config in the Sample experiment-server setup sample. To use, import this and play the SampleUXFExtensionScene.

