コード例 #1
0
	// Update is called once per frame
	void Update() {
		if ((!captureVideo) && (!captureParams)) {
			return;
		}

		if (stopCaptureFlag) {
			SaveCapture();
			stopCaptureFlag = false;
		}

		if ((writingFile) && (recorder.GetNumberOfPendingFiles() == 0)) {
			Debug.Log("File written to disk.");
			OnFileWritten(this, null);
			writingFile = false;
		}

		if (captureMode == VideoCaptureMode.Manual) {
			if ((!capturing) && (!writingFile)) {
				if (Input.GetKeyDown(startCaptureKey)) {
					StartCapture(null, null);
				}
			}

			if (!writingFile) {
				if (Input.GetKeyDown(stopCaptureKey)) {
					StopCapture(null, null);
				}
			}
		}
	}
コード例 #2
0
ファイル: EMREVideoAutoCapture.cs プロジェクト: VoxML/Jarvis
    // Update is called once per frame
    void Update()
    {
        if ((!captureVideo) && (!captureParams))
        {
            return;
        }

        if (captureExample)
        {
            StartCapture(null, null);
            intervalWaitTimer.Enabled = true;
            captureExample            = false;
        }

        if (initialWaitComplete)
        {
            intervalWaitTimer.Interval = intervalWaitTime;
            intervalWaitTimer.Enabled  = false;
            Debug.Log(string.Format("Focusing object {0}", focusObjIndex));
            refExpGenerator.OnObjectSelected(this,
                                             new SelectionEventArgs(refExpGenerator.world.availableObjs[focusObjIndex]));
            initialWaitComplete = false;
        }

        if (stopCaptureFlag)
        {
            dbEntry.FilePath  = outFileName;
            dbEntry.FocusObj  = refExpGenerator.focusObj.name;
            dbEntry.ObjCoords = String.Join("\n",
                                            refExpGenerator.objSelector.allVoxemes.Select(
                                                v => string.Format("{0}:{1}", v.name, Helper.VectorToParsable(v.transform.position)))
                                            .ToArray());
            dbEntry.RefModality    = referringModalities[expModalityIndex].ToString();
            dbEntry.DescriptionStr = refExpGenerator.fullDesc;
            dbEntry.RelationSet    = String.Join("\n", refExpGenerator.relationTracker.relStrings.ToArray());
            dbEntry.ObjDistToAgent =
                Vector3.Distance(refExpGenerator.agent.transform.position,
                                 refExpGenerator.focusObj.transform.position);
            dbEntry.DistanceDistinction = Convert.ToInt32(refExpGenerator.distanceDistinction);
            dbEntry.DistDistinctionType = refExpGenerator.distanceDistinction
                                ? (refExpGenerator.relativeDistance ? "Relative" : "Absolute")
                                : null;
            dbEntry.RelationalDescriptors = String.Join("\n", refExpGenerator.descriptors.ToArray());

            SaveCapture();
            stopCaptureFlag = false;
        }

        if ((writingFile) && (recorder.GetNumberOfPendingFiles() == 0))
        {
            Debug.Log("File written to disk.");
            OnFileWritten(this, null);
            writingFile = false;
        }

        if (captureMode == VideoCaptureMode.Manual)
        {
            if ((!capturing) && (!writingFile))
            {
                if (Input.GetKeyDown(startCaptureKey))
                {
                    StartCapture(null, null);
                }
            }

            if (!writingFile)
            {
                if (Input.GetKeyDown(stopCaptureKey))
                {
                    StopCapture(null, null);
                }
            }
        }
    }