Exemple #1
0
    void CloseShop()
    {
                #if UNITY_EDITOR // Operator window will only be available in Editor mode
        if (OperatorWindow.Instance != null)
        {
            OperatorWindow.Instance.Close();
        }
                #endif

        if (Settings.DataProcessState == PupilSettings.EStatus.Calibration)
        {
            PupilTools.StopCalibration();
        }

        PupilTools.StopEyeProcesses();

        Thread.Sleep(1);

        Settings.connection.CloseSockets();

        StopAllCoroutines();

        if (Recorder.isRecording)
        {
            Recorder.Stop();
        }

        PupilTools.RepaintGUI();

        Pupil.processStatus.eyeProcess0 = false;
        Pupil.processStatus.eyeProcess1 = false;
    }
Exemple #2
0
    public static void AutoRunLayout()
    {
        PupilSettings pupilSettings = PupilTools.Settings;

        ////////////////////////////TOGGLE AUTO MODE////////////////////////////

        PupilTools.Settings.connection.isAutorun = GUILayout.Toggle(PupilTools.Settings.connection.isAutorun, "Autorun Pupil Service", "Button");

        if (!PupilTools.Settings.connection.isAutorun && Application.isPlaying)
        {
            GUILayout.BeginHorizontal();

            if (GUILayout.Button("Start"))
            {
                Debug.Log("start button before connect");
                PupilTools.Connect();
                Debug.Log("start button after connect");

                //				if (PupilTools.Settings.connection.isLocal)
                //					PupilTools.RunServiceAtPath ();
                //
                //
                //				PupilDataReceiver.Instance.StartCoroutine (PupilDataReceiver.Instance.Connect (retry: true, retryDelay: 5f));



                //				if (PupilTools.Settings.connection.isLocal) {
                //
                //					PupilTools.RunServiceAtPath ();
                //					PupilDataReceiver.Instance.StartCoroutine (PupilDataReceiver.Instance.Connect (retry: true, retryDelay: 5f));
                //
                //				} else {
                //
                //					PupilDataReceiver.Instance.StartCoroutine (PupilDataReceiver.Instance.Connect (retry: true, retryDelay: 5f));
                //
                //				}
            }

            if (GUILayout.Button("Stop"))
            {
                PupilTools.StopEyeProcesses();
            }

            GUILayout.EndHorizontal();
        }

        ////////////////////////////TOGGLE AUTO MODE////////////////////////////
    }