static void Postfix()
        {
            if (!GameplayManager.ShowHud || !RearView.Enabled)
            {
                return;
            }

            if (RearView.rearTex == null || RearView.rearCam == null || RearView.rearCam.gameObject == null)
            {
                RearView.Init();
            }

            if (GameManager.m_local_player.m_hitpoints <= 0)
            {
                RearView.Pause();
                return;
            }

            RearView.rearCam.enabled = true;
            var pos     = new Vector2(288f, 288f);
            var posTile = new Vector2(pos.x, pos.y - 0.01f);
            var size    = 100f;

            UIManager.DrawQuadUI(pos, size, size, UIManager.m_col_ui0, 1, 11);
            UIManager.SetTexture(RearView.rearTex);
            UIManager.PauseMainDrawing();
            UIManager.StartDrawing(UIManager.url[1], false, 750f);
            UIManager.DrawTile(posTile, size * 0.93f, size * 0.93f, new Color(0.8f, 0.8f, 0.8f, 1.0f), 1, 0, 0, 1, 1);
            UIManager.ResumeMainDrawing();
        }
示例#2
0
 static void Prefix(GameplayState new_state)
 {
     if (new_state != GameplayState.PLAYING)
     {
         RearView.Pause();
     }
     else if (new_state == GameplayState.PLAYING)
     {
         bool want = !NetworkManager.IsHeadless() && RearView.MPNetworkMatchEnabled &&
                     NetworkMatch.m_client_server_location != null && NetworkMatch.m_client_server_location.StartsWith("OLMOD ") &&
                     !GameManager.m_local_player.m_spectator;
         if (want != RearView.Enabled)
         {
             RearView.Enabled = want;
             if (RearView.Enabled)
             {
                 RearView.Init();
             }
             else
             {
                 RearView.Pause();
             }
         }
     }
 }
 static void Prefix(GameplayState new_state)
 {
     if (new_state != GameplayState.PLAYING)
     {
         RearView.Pause();
     }
     else if (new_state == GameplayState.PLAYING)
     {
         if (RearView.Enabled)
         {
             RearView.Init();
         }
         else
         {
             RearView.Pause();
         }
     }
 }