示例#1
0
    private void Update()
    {
#if UNITY_EDITOR
        if (m_InEditorSpoof != null)
        {
            var textToSpoof = m_InEditorSpoof.Update();
            if (textToSpoof != null)
            {
                MessageListener(textToSpoof);
            }
        }
        if (Input.GetKeyDown(KeyCode.P))
        {
            if (Input.GetKey(KeyCode.RightShift))
            {
                m_Receiver.ParsePause(null);
            }
            else
            {
                m_Receiver.ParseRun(null);
            }
        }
#endif
        m_Receiver.Process();

        if (m_Client != null && !m_Client.isConnectedToServer)
        {
            if (m_InitialFailTime <= 0)
            {
                m_InitialFailTime = Time.realtimeSinceStartup;
            }
            else if (Time.realtimeSinceStartup > m_InitialFailTime + m_TimeBeforeRetry)
            {
                m_Client.ReConnect();
                m_InitialFailTime = -1f;
            }
        }
        else
        {
            m_InitialFailTime = -1f;
        }
    }