示例#1
0
        void StartRecording(bool autoExitPlayMode)
        {
            var settings = (RecorderSettings)m_Editor.target;
            var go       = FrameRecorderGOControler.HookupRecorder(!settings.m_Verbose);
            var session  = new RecordingSession()
            {
                m_Recorder   = RecordersInventory.GenerateNewRecorder(m_recorderSelector.selectedRecorder, settings),
                m_RecorderGO = go,
            };

            var component = go.AddComponent <RecorderComponent>();

            component.session          = session;
            component.autoExitPlayMode = autoExitPlayMode;

            if (session.SessionCreated() && session.BeginRecording())
            {
                m_State = EState.Recording;
            }
            else
            {
                m_State = EState.Idle;
                StopRecording();
            }
        }
示例#2
0
        public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
        {
            var playable = ScriptPlayable <RecorderPlayableBehaviour> .Create(graph);

            var behaviour = playable.GetBehaviour();

            if (recorderType != null && UnityHelpers.IsPlaying())
            {
                behaviour.session = new RecordingSession()
                {
                    m_Recorder   = RecordersInventory.GenerateNewRecorder(recorderType, m_Settings),
                    m_RecorderGO = FrameRecorderGOControler.HookupRecorder(!m_Settings.m_Verbose),
                };
            }
            return(playable);
        }
        void StartRecording(bool autoExitPlayMode)
        {
            var settings = (RecorderSettings)m_Editor.target;
            var go       = FrameRecorderGOControler.HookupRecorder();
            var session  = new RecordingSession()
            {
                m_Recorder         = RecordersInventory.GenerateNewRecorder(m_recorderSelector.selectedRecorder, settings),
                m_RecorderGO       = go,
                m_RecordingStartTS = Time.time / Time.timeScale,
                m_FrameIndex       = 0
            };

            var component = go.AddComponent <RecorderComponent>();

            component.session          = session;
            component.autoExitPlayMode = autoExitPlayMode;

            session.BeginRecording();
            m_State = EState.Recording;
        }