/// <summary> /// 由外界驱动 /// </summary> public void Tick() { if (!m_IsRunning) { return; } if (m_Param.useLocal) { if (m_LockedFrameIndex == 0 || m_LockedFrameIndex > m_CurrentFrameIndex) { m_CurrentFrameIndex++; var frame = m_FrameBuffer[m_CurrentFrameIndex]; ExecuteFrame(m_CurrentFrameIndex, frame); } } else { m_Client.Tick(); int speed = m_FrameCtrl.GetFrameSpeed(m_CurrentFrameIndex); while (speed > 0) { if (m_CurrentFrameIndex < m_LockedFrameIndex) { m_CurrentFrameIndex++; var frame = m_FrameBuffer[m_CurrentFrameIndex]; ExecuteFrame(m_CurrentFrameIndex, frame); } speed--; } } }
/// <summary> /// invoked by external /// </summary> public void EnterFrame() { if (!mIsRunning) { return; } if (!mParam.useLocal) { mClient.EnterFrame(); int speed = mFrameCtrl.GetFrameSpeed(mCurrentFrameIndex); while (speed > 0) { if (mCurrentFrameIndex < mClientLockedFrame) { mCurrentFrameIndex++; FSPFrame frame = mFrameBuffer[mCurrentFrameIndex]; ExecuteFrame(mCurrentFrameIndex, frame); } speed--; } //add pre effect here } else { if (mClientLockedFrame == 0 || mCurrentFrameIndex < mClientLockedFrame) { mCurrentFrameIndex++; FSPFrame frame = mFrameBuffer[mCurrentFrameIndex]; ExecuteFrame(mCurrentFrameIndex, frame); } } }
/// <summary> /// 由外界驱动 /// </summary> public void EnterFrame() { if (!m_IsRunning) { return; } if (!m_Param.useLocal) { m_Client.EnterFrame(); int speed = m_FrameCtrl.GetFrameSpeed(m_CurrentFrameIndex); while (speed > 0) { if (m_CurrentFrameIndex < m_ClientLockedFrame) { m_CurrentFrameIndex++; FSPFrame frame = m_FrameBuffer[m_CurrentFrameIndex]; ExecuteFrame(m_CurrentFrameIndex, frame); } speed--; } //这里可能加预表现 } else { if (m_ClientLockedFrame == 0 || m_CurrentFrameIndex < m_ClientLockedFrame) { m_CurrentFrameIndex++; FSPFrame frame = m_FrameBuffer[m_CurrentFrameIndex]; ExecuteFrame(m_CurrentFrameIndex, frame); } } }