public override void ProcessFrame(Playable playable, FrameData info, object playerData) { if (!Application.isPlaying && !invokeAtEditTime) { return; } var recording = playerData as MethodRecording; if (recording == null) { return; } if (recording.mode != MethodRecording.Mode.Playback) { recording.EnterPlaybackMode(); } float prevTime = (float)playable.GetPreviousTime(); float nowTime = (float)playable.GetTime(); bool didSeek = _prevTime != playable.GetPreviousTime() || nowTime < prevTime; if (!didSeek) { recording.SweepTime(prevTime, nowTime); } _prevTime = playable.GetTime(); }
public override void ProcessFrame(Playable playable, FrameData info, object playerData) { Debug.Log(MethodInfo.GetCurrentMethod().Name + " Time=" + playable.GetTime()); double preTime = playable.GetPreviousTime(); double timeOnClip = playable.GetTime(); double deltaTime = timeOnClip - preTime; double durationTime = playable.GetDuration(); double rate = timeOnClip / durationTime; double rateAfter = (timeOnClip + deltaTime) / durationTime; double weight = info.weight; int inputCount = playable.GetInputCount(); int outputCount = playable.GetOutputCount(); Debug.Log(MethodInfo.GetCurrentMethod().Name + " InputCount=" + inputCount); // 文字列を設定 messageDialog.SetText(textString); // 表示する messageDialog.Show(); // ★次のフレームで完了する(クリップから抜ける)時 // ※クリップを抜けるとProcessFrameは呼ばれず、OnBehaviourPauseが呼ばれるので、 // ProcessFrame内で捕まえるタイミングは今しかない。 if (rate < 1.0f && 1.0f <= rateAfter) { OnBehaviourPreFinish(playable, info, playerData); } }
bool DetectOutOfSync(Playable playable) { double expectedTime = playable.GetTime(); if (playable.GetTime() >= m_AssetDuration) { if (director.extrapolationMode == DirectorWrapMode.None) { return(false); } else if (director.extrapolationMode == DirectorWrapMode.Hold) { expectedTime = m_AssetDuration; } else if (m_AssetDuration > float.Epsilon) // loop { expectedTime = expectedTime % m_AssetDuration; } } if (!Mathf.Approximately((float)expectedTime, (float)director.time)) { #if UNITY_EDITOR double lastDelta = playable.GetTime() - playable.GetPreviousTime(); if (UnityEditor.Unsupported.IsDeveloperBuild()) { Debug.LogWarningFormat("Internal Warning - Control track desync detected on {2} ({0:F10} vs {1:F10} with delta {3:F10}). Time will be resynchronized. Known to happen with nested control tracks", playable.GetTime(), director.time, director.name, lastDelta); } #endif return(true); } return(false); }
bool DetectDiscontinuity(Playable playable, FrameData info) { return(Math.Abs(playable.GetTime() - playable.GetPreviousTime() - info.m_DeltaTime * info.m_EffectiveSpeed) > DiscreteTime.tickValue); }
private bool DetectDiscontinuity(Playable playable, UnityEngine.Playables.FrameData info) { return(Math.Abs(playable.GetTime() - playable.GetPreviousTime() - info.deltaTime * (double)info.effectiveWeight) > 1E-12); }
private bool DetectDiscontinuity(Playable playable, FrameData info) { return(Math.Abs(playable.GetTime <Playable>() - playable.GetPreviousTime <Playable>() - info.m_DeltaTime) > DiscreteTime.tickValue); }