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 = SceneHook.HookupRecorder(),
                };
                behaviour.OnEnd = () =>
                {
                    try
                    {
                        if (OnClipDone != null)
                        {
                            OnClipDone(this);
                        }
                    }
                    catch (Exception ex)
                    {
                        Debug.Log("OnClipDone call back generated an exception: " + ex.Message);
                        Debug.LogException(ex);
                    }
                };
            }
            return(playable);
        }
Example #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 = m_SceneHook.CreateRecorderSession(settings);
            }
            return(playable);
        }
Example #3
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);
        }