> For the complete documentation index, see [llms.txt](https://bonspiel-games.gitbook.io/cortex-unity-plugin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bonspiel-games.gitbook.io/cortex-unity-plugin/getting-started.md).

# Getting Started

This documentation aims to be a developer biased overview of using the [Bonspiel Games custom Emotiv Cortex support package](https://github.com/cm-nielsen/CortexPlugin) to make BCI enabled video games in Unity.

There is a significant amount of UI/UX and game design inherent to any project involving BCI. An effort will be made to guide these efforts, but the majority of content will involve technical integration.

## Background

Ultimately, the unity package in question is a wrapper of [the official websocket API](https://emotiv.gitbook.io/cortex-api/)

Though the structure may be altered or simplified, ultimately the package conforms to the same processes and credential checks as the raw API. That is to stress that though these docs should provide most developers enough information to make a functional game, familiarity of or frequent reference to the base material may be an import augment to those looking to do more.

## Prerequisites

As Emotiv services are centralized and proprietary, official credentials are required for any third party application. See [the official docs](https://emotiv.gitbook.io/cortex-api/#prerequisites) on how to set up an account and get app credentials. **MAKE SURE TO NOTE THE CLIENT SECRET.**

1. Install Unity. You can get it for free at [unity3d.com](https://unity3d.com/get-unity/download).
2. Make an EmotivID on [the official website](https://emotiv.com)
3. Create a Cortex application on [the account page](https://emotiv.com/my-account/cortex-apps/) to get an app client id and secret. **MAKE SURE TO NOTE THE CLIENT SECRET AS IT WILL ONLY BE SHOWN ONCE**
4. [Download and install](https://www.emotiv.com/emotiv-launcher/#download) the EMOITV Launcher
5. Add the CortexPlugin package to any Unity project using the package manager via git url:

```
https://github.com/cm-nielsen/CortexPlugin.git
```

In the likely event that you don't have access to hardware for hands on testing, the Emotiv launcher allows you to create a "Virtual Brainwear device" which will simulate a headset, providing contact quality and mental commands.
