private void _doLogicFrameEnd(RAL.LogicFrame frame) { if (onLogicFrameEnd != null) { onLogicFrameEnd(frame); } }
private void _process(ref RAL.LogicFrame frame, ref int physicsIndex, float cursor) { int nowIndex = (int)(cursor * FrameSync.LOGIC_PHYSICS_FPS); if (nowIndex >= frame.physicsFrames.Length) { for (int i = physicsIndex; i < m_currentFrame.physicsFrames.Length; ++i) { for (int j = 0; j < frame.physicsFrames[i].actions.Length; ++j) { _doRenderActionDone(frame.physicsFrames[i].actions[j]); } } physicsIndex = -1; _doLogicFrameEnd(frame); frame = null; } else { for (int i = physicsIndex; i < nowIndex; ++i) { for (int j = 0; j < frame.physicsFrames[i].actions.Length; ++j) { _doRenderActionDone(frame.physicsFrames[i].actions[j]); } } physicsIndex = nowIndex; var progress = cursor * FrameSync.LOGIC_PHYSICS_FPS - nowIndex; for (int i = 0; i < frame.physicsFrames[nowIndex].actions.Length; ++i) { _doRenderActionProgress(frame.physicsFrames[nowIndex].actions[i], progress); } } }
private void _doLogicFrameBegin(RAL.LogicFrame frame) { if (onLogicFrameBegin != null) { onLogicFrameBegin(frame); } }
private void _processNewFrame(RAL.LogicFrame frame, float cursor) { if (m_currentFrame != null) { for (int i = m_currentPhysicsIndex; i < m_currentFrame.physicsFrames.Length; ++i) { for (int j = 0; j < m_currentFrame.physicsFrames[i].actions.Length; ++j) { _doRenderActionDone(m_currentFrame.physicsFrames[i].actions[j]); } } _doLogicFrameEnd(m_currentFrame); m_currentFrame = null; m_currentPhysicsIndex = -1; } if (frame != null) { m_currentFrame = frame; m_currentPhysicsIndex = 0; _doLogicFrameBegin(frame); _process(ref m_currentFrame, ref m_currentPhysicsIndex, cursor); } }