protected virtual void Update() { #if UNITY_EDITOR if (EditorApplication.isCompiling) { EditorApplication.isPlaying = false; Debug.LogWarning("Unity hot reloading not currently supported. Stopping Editor Playback."); return; } #endif _fixedOffset.Update(Time.time - Time.fixedTime, Time.deltaTime); if (_useInterpolation) { Int64 unityTime = (Int64)(Time.time * 1e6); Int64 unityOffsetTime = unityTime - _interpolationDelay * 1000; Int64 leapFrameTime = clockCorrelator.ExternalClockToLeapTime(unityOffsetTime); _untransformedUpdateFrame = leap_controller_.GetInterpolatedFrame(leapFrameTime) ?? _untransformedUpdateFrame; } else { _untransformedUpdateFrame = leap_controller_.Frame(); } //Null out transformed frame because it is now stale //It will be recalculated if it is needed _transformedUpdateFrame = null; }
protected virtual void Update() { #if UNITY_EDITOR if (EditorApplication.isCompiling) { EditorApplication.isPlaying = false; Debug.LogWarning("Unity hot reloading not currently supported. Stopping Editor Playback."); return; } #endif _fixedOffset.Update(Time.time - Time.fixedTime, Time.deltaTime); if (_useInterpolation) { Int64 unityTime = (Int64)(Time.time * 1e6); Int64 unityOffsetTime = unityTime - _interpolationDelay * 1000; Int64 leapFrameTime = clockCorrelator.ExternalClockToLeapTime(unityOffsetTime); leap_controller_.GetInterpolatedFrame(_untransformedUpdateFrame, leapFrameTime); } else { leap_controller_.Frame(_untransformedUpdateFrame); } if (_untransformedUpdateFrame != null) { transformFrame(_untransformedUpdateFrame, _transformedUpdateFrame); DispatchUpdateFrameEvent(_transformedUpdateFrame); } }
protected virtual void Update() { #if UNITY_EDITOR if (EditorApplication.isCompiling) { EditorApplication.isPlaying = false; Debug.LogWarning("Unity hot reloading not currently supported. Stopping Editor Playback."); } #endif Int64 unityTime = (Int64)(Time.time); clockCorrelator.UpdateRebaseEstimate(unityTime); Int64 unityFrameTime = (Int64)(CurrentFrame.Timestamp - _initialFrameOffset); Int64 LeapFrameTime = clockCorrelator.ExternalClockToLeapTime(unityFrameTime); if (_perFrameFixedUpdateOffset > 0) { _smoothedFixedUpdateOffset.Update(_perFrameFixedUpdateOffset, Time.deltaTime); _perFrameFixedUpdateOffset = -1; } }