public void StartVisualizing()
        {
            Debug.Log("Start Visualizing Gaze");

            if (subscriptionsController == null)
            {
                Debug.LogError("SubscriptionController missing");
                return;
            }

            if (projectionMarker == null)
            {
                Debug.LogError("Marker reference missing");
                return;
            }

            if (cameraTransform == null)
            {
                Debug.LogError("Camera reference missing");
                enabled = false;
                return;
            }

            if (gazeListener == null)
            {
                gazeListener = new GazeListener(subscriptionsController);
            }

            gazeListener.OnReceive3dGaze += ReceiveGaze;
            projectionMarker.gameObject.SetActive(true);
            isGazing = true;
        }
示例#2
0
        public void StartLooking()
        {
            Debug.Log("Start looking");

            if (subscriptionsController == null)
            {
                Debug.LogError("SubscriptionController missing");
                return;
            }


            if (cameraTransform == null)
            {
                Debug.LogError("Camera reference missing");
                enabled = false;
                return;
            }

            if (gazeListener == null)
            {
                gazeListener = new GazeListener(subscriptionsController);
            }

            gazeListener.OnReceive3dGaze += ReceiveGaze;
            isGazing = true;
        }
示例#3
0
        void OnEnable()
        {
            if (subscriptionsController == null)
            {
                Debug.LogWarning("Required components missing.");
                enabled = false;
                return;
            }

            if (listener == null)
            {
                listener = new GazeListener(subscriptionsController);
                listener.OnReceive3dGaze += Forward3dGaze;
            }

            listener.Enable();
        }
示例#4
0
        void OnEnable()
        {
            if (subscriptionsController == null)
            {
                Debug.LogError("GazeController is missing the required SubscriptionsController reference. Please connect the reference, or the component won't work correctly.");
                enabled = false;
                return;
            }

            if (listener == null)
            {
                listener = new GazeListener(subscriptionsController);
                listener.OnReceive3dGaze += Forward3dGaze;
            }

            listener.Enable();
        }
        void Start()
        {
            // create a folder
            string OutputDir = Path.Combine(FolderName, string.Concat(DateTime.Now.ToString("MM-dd-yyyy-HH-mm")));

            Directory.CreateDirectory(OutputDir);

            // create a file to record data
            String trialOutput = Path.Combine(OutputDir, DateTime.Now.ToString("yyyy-MM-dd-HH-mm") + ".txt");

            //String trialOutput = Path.Combine(OutputDir, "test.txt");
            trialStreams = new FileStream(trialOutput, FileMode.Create, FileAccess.Write);

            //Call the function below to write the column names
            WriteHeader();

            gazeListener = new GazeListener(PupilConnection);
            gazeListener.OnReceive3dGaze += ReceiveGaze;
        }
示例#6
0
        void OnEnable()
        {
            if (gazeListener == null)
            {
                gazeListener = new GazeListener(subscriptionsController);
            }

            if (calibrationController == null)
            {
                Debug.LogWarning("CalibrationController missing");
                return;
            }

            if (cameraTransform == null)
            {
                Debug.LogWarning("Camera reference missing");
                return;
            }

            calibrationController.OnCalibrationSucceeded += StartVisualizing;
        }