Exemple #1
0
    void OnGUI()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Label("Demo App");
        GUILayout.Space(Screen.width - 250);
        GUILayout.Label(signalIcons[(int)indexSignalIcons]);
        GUILayout.EndHorizontal();

        if (GUI.Button(new Rect(190, 20, 100, 80), "Init"))
        {
            UnityThinkGear.Init(true);
        }

        if (GUI.Button(new Rect(190, 140, 100, 80), "Connect"))
        {
            print("Connect Button CLick");
                        #if UNITY_IPHONE
            clearDataArr();
            UnityThinkGear.ScanDevice();
            showListViewFlag = true;
                        #elif UNITY_ANDROID
            UnityThinkGear.StartStream();
                        #endif
        }

        if (GUI.Button(new Rect(190, 250, 100, 80), "Quit"))
        {
            Application.Quit();
        }

        if (showListViewFlag)
        {
            //andrew code;  show device list view;
            GUILayout.BeginArea(new Rect(rectX, rectY, rectWidth, rectHeight));
            windowRect = GUILayout.Window(0, new Rect(rectX, rectY, rectWidth, rectHeight), DeviceListWindow, "Device List");
            GUILayout.EndArea();
        }


        GUILayout.BeginVertical();
        GUILayout.Label("Raw:" + Raw);
        GUILayout.Label("PoorSignal:" + PoorSignal);
        GUILayout.Label("Attention:" + Attention);
        GUILayout.Label("Meditation:" + Meditation);
        GUILayout.Label("Blink:" + Blink);
        GUILayout.Label("Delta:" + Delta);
        GUILayout.Label("Theta:" + Theta);
        GUILayout.Label("LowAlpha:" + LowAlpha);
        GUILayout.Label("HighAlpha:" + HighAlpha);
        GUILayout.Label("LowBeta:" + LowBeta);
        GUILayout.Label("HighBeta:" + HighBeta);
        GUILayout.Label("LowGamma:" + LowGamma);
        GUILayout.Label("HighGamma:" + HighGamma);

        GUILayout.EndVertical();
    }