Esempio n. 1
0
    public static void Initialize()
    {
        window = (OperatorWindow)EditorWindow.GetWindow(typeof(OperatorWindow));
        window.Show();

        _texture = new Texture2D(1, 6);
        _texture.SetPixel(0, 0, new Color(1, 1, 1, .6f));
        _texture.SetPixel(0, 1, new Color(1, 1, 1, .5f));
        _texture.SetPixel(0, 2, new Color(1, 1, 1, .4f));
        _texture.SetPixel(0, 3, new Color(1, 1, 1, .3f));
        _texture.SetPixel(0, 4, new Color(1, 1, 1, .2f));
        _texture.SetPixel(0, 5, new Color(1, 1, 1, .1f));
        _texture.Apply();

//		GameObject _camGO = new GameObject ();
//		_camGO.name = "Operator Camera";
//		OperatorMonitor _opscript = _camGO.AddComponent<OperatorMonitor> ();
//		Camera _cam = _camGO.GetComponent<Camera> ();
        pupilTracker = PupilGazeTracker.Instance;

        Operator.properties.Properties = pupilTracker.OperatorMonitorProperties;

//		Operator.properties.Properties [0].OperatorCamera = _cam;
//		_cam.stereoTargetEye = StereoTargetEyeMask.None;
//		//		_cam.backgroundColor = Color.gray;
//		_cam.transform.parent = Camera.main.transform;
//		_cam.fieldOfView = Camera.main.fieldOfView;
//		_cam.clearFlags = CameraClearFlags.Depth;

//		_opscript.MainCameraTargetDisplay = Camera.main.targetDisplay;
        //		Camera.main.targetDisplay = 1;


        Operator.properties.Properties [0].confidenceList.Capacity = Operator.properties.Properties [0].graphLength + 1;
        Operator.properties.Properties [1].confidenceList.Capacity = Operator.properties.Properties [1].graphLength + 1;

        _offsetMatrix = new Matrix4x4();

        pupilTracker.SubscribeTo("pupil.");

        pupilTracker.CreateEye0ImageMaterial();
        pupilTracker.CreateEye1ImageMaterial();
        pupilTracker.InitializeFramePublishing();
        pupilTracker.StartFramePublishing();
    }
Esempio n. 2
0
//	public void Close(){
//		window.Close ();
//	}
    // Use this for initialization
    void Start()
    {
        window = this;
    }