コード例 #1
0
ファイル: DisplayData.cs プロジェクト: 221boy221/game-lab
    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);
    }
コード例 #2
0
ファイル: neuroskytest.cs プロジェクト: diabolusss/Neurosky
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown("space"))
     {
         controller.Connect();
     }
 }
コード例 #3
0
    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);
        }
    }
コード例 #4
0
    // 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;
    }
コード例 #5
0
    // 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>();
    }
コード例 #6
0
    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();
    }
コード例 #7
0
ファイル: MenuController.cs プロジェクト: rkonecny/Foresthlon
 /**
  * <summary>Reconnects to Neurosky headset</summary>
  **/
 public void ReconnectInput()
 {
     InputController.Connect();
 }
コード例 #8
0
    //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;
    }
コード例 #9
0
    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);
            }
        }
    }