示例#1
0
    void startRecording()
    {
        SetupNewRecorder();

        if (actorRecorder.IsRecording() == false)
        {
            actorRecorder.StartRecording();
        }
    }
    void startRecording()
    {
        SetupNewRecorder();

        if (filmbackRecorder.IsRecording() == false)
        {
            recordingBulb.SetColor("_EmissionColor", Color.red);
            filmbackRecorder.StartRecording();
        }
    }
        public void StartAndStopRecording_WithValidSettings_ShouldStartThenStopRecording()
        {
            var settings      = ScriptableObject.CreateInstance <RecorderControllerSettings>();
            var imageRecorder = ScriptableObject.CreateInstance <AOVRecorderSettings>();

            settings.AddRecorderSettings(imageRecorder);
            var recorderController = new RecorderController(settings);

            Assert.IsTrue(recorderController.StartRecording());
            Assert.IsTrue(recorderController.IsRecording());

            recorderController.StopRecording();
            Assert.IsFalse(recorderController.IsRecording());

            Object.DestroyImmediate(imageRecorder);
            Object.DestroyImmediate(settings);
        }
示例#4
0
 public static async UniTask CaptureFrame()
 {
     image.FileNameGenerator.FileName = $"image_{captureId:0000000}";
     ++captureId;
     controller.PrepareRecording();
     controller.StartRecording();
     await UniTask.WaitWhile(() => controller.IsRecording());
 }
        public void StartRecording_WithNullSettings_ThrowsException()
        {
            var recorderController = new RecorderController(null);

            var ex = Assert.Throws <NullReferenceException>(() => recorderController.StartRecording());

            Assert.IsTrue(ex.Message.Contains("Can start recording without prefs"));
            Assert.IsFalse(recorderController.IsRecording());
        }
        public void StartRecording_WithEmptySettings_ShouldNotStartRecording()
        {
            var settings           = ScriptableObject.CreateInstance <RecorderControllerSettings>();
            var recorderController = new RecorderController(settings);

            Assert.IsFalse(recorderController.StartRecording());
            Assert.IsFalse(recorderController.IsRecording());

            Object.DestroyImmediate(settings);
        }
        public void StartRecording_InNonPlayMode_ShouldThrowsException()
        {
            var settings           = ScriptableObject.CreateInstance <RecorderControllerSettings>();
            var recorderController = new RecorderController(settings);

            var ex = Assert.Throws <Exception>(() => recorderController.StartRecording());

            Assert.IsTrue(ex.Message.Contains("Start Recording can only be called in Playmode"));
            Assert.IsFalse(recorderController.IsRecording());

            UnityObject.DestroyImmediate(settings);
        }
示例#8
0
        public void SceneHookGameObject_AfterStartRecording_ShouldBeVisible()
        {
            var settings = ScriptableObject.CreateInstance <RecorderControllerSettings>();
            var recorder = ScriptableObject.CreateInstance <ImageRecorderSettings>();

            settings.AddRecorderSettings(recorder);
            var recorderController = new RecorderController(settings);

            Options.verboseMode = false;             // Make sure visibility is not toggled on because of debugMode.

            Assert.IsTrue(recorderController.StartRecording());
            Assert.IsTrue(recorderController.IsRecording());

            var gameObject = GameObject.Find("Unity-RecorderSessions");

            Assert.IsNotNull(gameObject);
            Assert.IsTrue(gameObject.hideFlags == HideFlags.None);

            recorderController.StopRecording();

            Object.DestroyImmediate(recorder);
            Object.DestroyImmediate(settings);
        }