//	public bool visualizeSphereProjection = false;

    void OnEnable()
    {
        // Main
        if (GetComponentInChildren <Camera> () == null)
        {
            Debug.Log("Frame Publisher could not find a Camera gameobject");
            return;
        }
        eyePublishingInitialized = new bool[] { false, false };

        PupilTools.SubscribeTo("frame.");

        PupilTools.Send(new Dictionary <string, object> {
            { "subject", "start_plugin" }, { "name", "Frame_Publisher" }
        });

//		// Sphere Projection
//		if (visualizeSphereProjection)
//		{
//			if (PupilTools.CalibrationMode == Calibration.Mode._3D)
//			{
//				PupilTools.SubscribeTo ("pupil.");
//			}
//			else
//				Debug.Log ("Sphere projections are only available for 3D calibration");
//		}

        PupilTools.OnReceiveData += CustomReceiveData;
    }
示例#2
0
    public static void StopRecording()
    {
        PupilTools.Send(new Dictionary <string, object> {
            { "subject", "recording.should_stop" }
        });

        isRecording = false;
    }
示例#3
0
    void StopBlinkSubscription()
    {
        UnityEngine.Debug.Log("Disconnected");

        PupilTools.Send(new Dictionary <string, object> {
            { "subject", "stop_plugin" }
            , { "name", "Blink_Detection" }
        });

        PupilTools.UnSubscribeFrom("blinks");
    }
示例#4
0
        private static void StartBlinkSubscription()
        {
            PupilTools.Send(new Dictionary <string, object> {
                { "subject", "start_plugin" },
                { "name", "Blink_Detection" },
                { "args", new Dictionary <string, object> {
                      { "history_length", 0.2F },
                      { "onset_confidence_threshold", 0.5F },
                      { "offset_confidence_threshold", 0.5F }
                  } }
            });

            PupilTools.SubscribeTo("blinks");
        }
示例#5
0
    public static void StartRecording()
    {
        var _p = Settings.recorder.GetRecordingPath().Substring(2);

        PupilTools.Send(new Dictionary <string, object> {
            { "subject", "recording.should_start" },
            {
                "session_name",
                _p
            }
        });

        isRecording = true;

        recordingString = "Timestamp,HitObject,HitPointX,HitPointY,HitPointZ\n";
    }
    // Use this for initialization
    public void Startup()
    {
        // Main
        if (camObj == null)
        {
            Debug.Log("Frame Publisher could not find a Camera gameobject");
            return;
        }
        eyePublishingInitialized = new bool[] { false, false };

        PupilTools.SubscribeTo("frame.");

        PupilTools.Send(new Dictionary <string, object> {
            { "subject", "start_plugin" }, { "name", "Frame_Publisher" }
        });
        PupilTools.OnReceiveData += CustomReceiveData;
    }
    void OnDisable()
    {
        UnityEngine.Debug.Log("Disabling Frame Publisher");

        PupilTools.Send(new Dictionary <string, object> {
            { "subject", "stop_plugin" }, { "name", "Frame_Publisher" }
        });

        PupilTools.UnSubscribeFrom("frame.");

        for (int i = eyeRenderer.Length - 1; i >= 0; i--)
        {
            if (eyeRenderer [i] != null && eyeRenderer [i].gameObject != null)
            {
                Destroy(eyeRenderer [i].gameObject);
            }
        }

        PupilTools.OnReceiveData -= CustomReceiveData;
    }