void OnGUI() { GUILayout.BeginHorizontal(); if (GUILayout.Button("Connect")) { controller.Connect(); } if (GUILayout.Button("DisConnect")) { controller.Disconnect(); indexSignalIcons = 1; } GUILayout.Space(Screen.width - 250); GUILayout.Label(signalIcons[indexSignalIcons]); GUILayout.EndHorizontal(); GUILayout.Label("PoorSignal1:" + poorSignal1); GUILayout.Label("Attention1:" + attention1); GUILayout.Label("Meditation1:" + meditation1); GUILayout.Label("Delta:" + delta); }
// Update is called once per frame void Update() { if (Input.GetKeyDown("space")) { controller.Connect(); } }
void OnGUI() { GUILayout.BeginHorizontal(); if (GUILayout.Button("Connect")) { controller.Connect(); } if (GUILayout.Button("DisConnect")) { controller.Disconnect(); indexSignalIcons = 1; } GUILayout.Space(Screen.width - 250); //GUILayout.Label(signalIcons[indexSignalIcons]); GUILayout.EndHorizontal(); // Generate Randome Data 30% if (Random.Range(1, 101) < 10) { poorSignal1 = Random.Range(80, 95); } if (Random.Range(1, 101) < 10) { attention1 = Random.Range(60, 80); } if (Random.Range(1, 101) < 10) { meditation1 = Random.Range(15, 25); } if (Random.Range(1, 101) < 3) { eyestren = Random.Range(30, 80); } GUILayout.Label("Signal Power:" + poorSignal1); GUILayout.Label("Attention:" + attention1); GUILayout.Label("Meditation:" + meditation1); if (eyestren >= 74) { GUILayout.Label("Eye Blink Detected Strength:" + eyestren); } else { GUILayout.Label("Eye Blink Strength:" + eyestren); } }
// Use this for initialization void Start() { controller = TGCConnectionController.current; controller.UpdatePoorSignalEvent += OnUpdatePoorSignal; controller.UpdateAttentionEvent += OnUpdateAttention; controller.UpdateMeditationEvent += OnUpdateMeditation; controller.UpdateBlinkEvent += OnUpdateBlink; controller.UpdateDeltaEvent += OnUpdateDelta; controller.Connect(); initialY = transform.position.y; }
// Use this for initialization void Start() { controller = GameObject.Find("NeuroSkyTGCController").GetComponent<TGCConnectionController>(); controller.UpdatePoorSignalEvent += OnUpdatePoorSignal; controller.UpdateAttentionEvent += OnUpdateAttention; controller.UpdateMeditationEvent += OnUpdateMeditation; controller.UpdateBlinkEvent += OnUpdateBlink; controller.UpdateDeltaEvent += OnUpdateDelta; controller.Connect(); light = GetComponent<Light>(); }
void OnGUI() { GUILayout.BeginHorizontal(); if (GUILayout.Button("Connect")) { controller.Connect(); } if (GUILayout.Button("DisConnect")) { controller.Disconnect(); indexSignalIcons = 1; } GUILayout.Space(Screen.width - 250); GUILayout.Label(signalIcons[indexSignalIcons]); GUILayout.EndHorizontal(); }
/** * <summary>Reconnects to Neurosky headset</summary> **/ public void ReconnectInput() { InputController.Connect(); }
//private float delta; void Start() { //playerprefs medDur = PlayerPrefs.GetFloat ("medDur"); medTot = PlayerPrefs.GetInt ("medTot"); //find and connect controller controller = GameObject.Find("NeuroSkyTGCController").GetComponent<TGCConnectionController>(); controller.Connect (); //update signals controller.UpdatePoorSignalEvent += OnUpdatePoorSignal; //controller.UpdateAttentionEvent += OnUpdateAttention; controller.UpdateMeditationEvent += OnUpdateMeditation; //controller.UpdateDeltaEvent += OnUpdateDelta; }
void OnGUI() { if (!EEGManager.Instance.useNeuroSky || !ActionManager.Instance.initialized) { return; } if (useGUI) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Connect")) { controller.Connect(); } if (GUILayout.Button("DisConnect")) { controller.Disconnect(); indexSignalIcons = 1; } if (usePoorSignal) { GUILayout.Space(Screen.width - 250); GUILayout.Label(signalIcons[indexSignalIcons]); } GUILayout.EndHorizontal(); if (usePoorSignal) { GUILayout.Label("PoorSignal:" + poorSignal); } if (useAttention) { GUILayout.Label("Attention:" + attention); } if (useMeditation) { GUILayout.Label("Meditation:" + meditation); } if (useBlink) { GUILayout.Label("Blink:" + blink); } if (useDelta) { GUILayout.Label("Delta:" + delta); } if (useTheta) { GUILayout.Label("Theta:" + theta); } if (useLowAlpha) { GUILayout.Label("Low Alpha:" + lowAlpha); } if (useHighAlpha) { GUILayout.Label("High Alpha:" + highAlpha); } if (useLowBeta) { GUILayout.Label("Low Beta:" + lowBeta); } if (useHighBeta) { GUILayout.Label("High Beta:" + highBeta); } if (useLowGamma) { GUILayout.Label("Low Gamma:" + lowGamma); } if (useHighGamma) { GUILayout.Label("High Gamma:" + highGamma); } } }