Project setup
Before jumping into the tutorial, you need to set up the Easter Egg Hunt project in Unity. This section will guide you through downloading the tutorial files, opening the Unity project, and setting up the project for VR. Additionally, you will learn how to set up a physiological signal stream to be used in the Easter Egg Hunt project.
Download the tutorial files
Option 1: Download as ZIP
- Go to the Tutorial GitHub page and download the repository as ZIP.
- Unpack the downloaded .zip file.
Option 2: Clone the repository
- Clone the repository using the command line. If Git is not installed on your computer, you can download it.
Open the tutorial Unity project
- Open Unity Hub.
Note
If Unity Hub is not installed on your computer, you can download it. From Unity Hub, you can install Unity 2022.3 or later. (Optional) If you want to build your application on an Android platform (e.g., Meta Quest), make sure to install the Android developer kit when installing Unity.
-
In Unity Hub, add the project by clicking on
Add -> Add Project From Disk
. Select the Easter Egg Hunt folder located atPLUME-Tutorial-Basics\Unity\EasterEggHunt
-
Open the Easter Egg Hunt project that has been added to your list of projects.
Note
If Unity issues a warning regarding the Editor version, you can confidently discard it and continue opening the project.
VR Setup
To follow along with the Easter Egg Hunt project, you will need to set up your Unity project for VR. The Easter Egg Hunt project is designed to work with VR headsets, you can also use the XR Simulator Device to test the application on desktop if you don't have direct access to a VR headset.
Option 1: VR HMD
- Click on
Edit -> Project Settings
. - Under
XR Plug-in Management
, ensureOpenXR
is enabled.
Warning
In this window, you can manage both Desktop and Android projects. Make sure to configure for the platform you want to build for.
- Select the relevant Interaction Profile. E.g.,
Oculus Touch Controller Profile
for Meta Quest. - Select the relevant OpenXR Feature Groups to enable. E.g.,
Meta Quest Support
when building for Meta Quest.
- Close the Project Settings Window.
Option 2: XR simulator device
The XR Interaction Toolkit (v3.1.0+) provides an easy-to-use simulator of a VR HMD. The simulator prefab is already integrated within the Easter Egg Hunt project. Make sure it is enabled if you want to try the Easter Egg Hunt application on desktop.
Physiological signal stream setup
Option 1: Use a physiological device
For this tutorial, you can use your own physiological device and create a LSL stream. Check the list of supported devices. Create your own stream using one of the numerous implementations of LSL. All the physiological signals stream detected on the network will be picked up by PLUME.
Option 2: Simulate a physiological signal stream
If you don't have access to a physiological device, we provide you with a Python script (stream_eda.py
) that simulates one by streaming pre-recorded physiological signals using PyLSL and PyXDF. The script is adapted from a PyLSL example and sends 2 EDA signals sampled at 8Hz. To run the script, you will need a Python virtual environment with PyLSL and PyXDF installed.
Here is a step-by-step guide to creating a new Python environment using venv.
-
Open a command line and make sure Python 3.12 is installed:
If you don’t have Python 3.12, you can download and install it from Python Downloads.
-
In the command line, navigate to the Python files within the Project folder
UnityProject/EasterEggHunt/Assets/PythonScripts~
. -
Create a new virtual environment inside this folder:
This creates a folder named
venv
containing the isolated Python environment. -
Activate the Virtual Environment On Windows:
On macOS/Linux:
Once activated, your terminal will show (venv)
at the beginning of the line, indicating you are now inside the virtual environment.
-
Install dependencies from
requirements.txt
using the following command: -
Launch
stream_eda.py
using the following command. Physiological streams can now be picked up by PLUME.