public override void OnBehaviourPause(Playable playable, FrameData info) { if (session == null) { return; } if (session.isRecording && m_PlayState == PlayState.Playing) { #if UNITY_EDITOR const double eps = 1e-5; // end is never evaluated RecorderAnalytics.SendStopEvent(session, false, playable.GetTime() >= playable.GetDuration() - eps); #endif session.Dispose(); session = null; } m_PlayState = PlayState.Paused; }
public override void OnBehaviourPlay(Playable playable, FrameData info) { if (session == null) { return; } // Assumption: OnPlayStateChanged( PlayState.Playing ) ONLY EVER CALLED ONCE for this type of playable. m_PlayState = PlayState.Playing; var res = session.BeginRecording(); #if UNITY_EDITOR RecorderAnalytics.SendStartEvent(session); if (!res) { RecorderAnalytics.SendStopEvent(session, true, false); } #endif }