예제 #1
0
    void Update()
    {
#if UNITY_STANDALONE_WIN || UNITY_EDITOR
        DllTest.CheckExecuteResult();
#endif
#if !UNITY_EDITOR
        try
        {
#endif
        CehckEscape();
        long tick          = System.DateTime.Now.Ticks;
        System.TimeSpan ts = new System.TimeSpan(tick - m_LastTick);
        m_LastTick = tick;
        uint curTick = Utility.GetTickCount();
        m_Delta = Utility.TickToFloat(curTick - m_FrameTick);
        if ((ts.TotalSeconds > 5 || m_Delta >= 5.0f) && LogicManager.Instance.IsPlaying)
        {
            //LogMgr.Log("Refresh,delta:" + m_Delta + ",tick:" + ts.TotalSeconds+",Socket:" + NetServices.Instance.IsSocketConnected);
            SceneRuntime.RefreshScene();
        }
        m_FrameTick = curTick;

        if (BlockLogic.Instance.Update(m_Delta))
        {
            //如果当前没有阻塞
            LogicManager.Instance.Update(m_Delta);
        }

        if (ServerSetting.IS_TEST)
        {
            WndManager.Instance.Check();
            ComputeFPS(m_Delta);
        }
#if !UNITY_EDITOR
    }

    catch (System.Exception e)
    {
        //异常提交
        ReportException.Instance.AddException(e.ToString());
    }
#endif
    }