예제 #1
0
파일: FSPManager.cs 프로젝트: zj831007/SGF
        /// <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--;
                }
            }
        }
예제 #2
0
        /// <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);
                }
            }
        }
예제 #3
0
        /// <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);
                }
            }
        }