Пример #1
0
        private USRecordSequence GetOrSpawnRecorder()
        {
            var recorder = FindObjectOfType(typeof(USRecordSequence)) as USRecordSequence;

            if (recorder)
            {
                return(recorder);
            }

            var recordingObject   = new GameObject("Recording Object");
            var recordingSequence = recordingObject.AddComponent <USRecordSequence>();

            recordingSequence.CapturePath      = USRecordRuntimePreferences.CapturePath;
            recordingSequence.CaptureFrameRate = USRecord.GetFramerate();
            recordingSequence.UpscaleAmount    = USRecord.GetUpscaleAmount();

            return(recordingSequence);
        }
Пример #2
0
        private void PlayOrPause()
        {
            if (!CurrentSequence)
            {
                return;
            }

            if (CurrentSequence.IsPlaying)
            {
                CurrentSequence.Pause();

                if (isArmed && GetOrSpawnRecorder())
                {
                    GetOrSpawnRecorder().PauseRecording();
                }
            }
            else
            {
                USUndoManager.PropertyChange(CurrentSequence, "Play");

                if (isArmed && !System.IO.Directory.Exists(USRecordRuntimePreferences.CapturePath))
                {
                    EditorUtility.DisplayDialog("Error", String.Format("Recording Directory : {0} doesn't exist, make sure you set one up in the uSequencer preferences (Edit/uSeqeucer/Recording Preferences)", USRecordRuntimePreferences.CapturePath), "OK");
                    return;
                }

                StartProcessingAnimationMode();
                CurrentSequence.Play();

                if (isArmed && GetOrSpawnRecorder())
                {
                    var recordingSequence = GetOrSpawnRecorder();

                    recordingSequence.StartRecording();

                    recordingSequence.CapturePath      = USRecordRuntimePreferences.CapturePath;
                    recordingSequence.CaptureFrameRate = USRecord.GetFramerate();
                    recordingSequence.UpscaleAmount    = USRecord.GetUpscaleAmount();
                }
            }
        }
 public override void FireEvent()
 {
     if (!Application.isPlaying)
     {
         Debug.Log("Recording events only work when in play mode");
         return;
     }
     USRuntimeUtility.StartRecordingSequence(base.Sequence, USRecordRuntimePreferences.CapturePath, USRecord.GetFramerate(), USRecord.GetUpscaleAmount());
 }