NetworkManagerHUD.showGUI obsoleted (#2596)

This commit is contained in:
vis2k 2021-02-25 09:55:14 +08:00 committed by GitHub
parent 62b99ed9a7
commit 1f0d9e73e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,7 @@
// vis2k: GUILayout instead of spacey += ...; removed Update hotkeys to avoid // vis2k: GUILayout instead of spacey += ...; removed Update hotkeys to avoid
// confusion if someone accidentally presses one. // confusion if someone accidentally presses one.
using System;
using UnityEngine; using UnityEngine;
namespace Mirror namespace Mirror
@ -19,6 +21,7 @@ public class NetworkManagerHUD : MonoBehaviour
/// <summary> /// <summary>
/// Whether to show the default control HUD at runtime. /// Whether to show the default control HUD at runtime.
/// </summary> /// </summary>
[Obsolete("showGUI will be removed unless someone has a valid use case. Simply use or don't use the HUD component.")]
public bool showGUI = true; public bool showGUI = true;
/// <summary> /// <summary>
@ -38,8 +41,9 @@ void Awake()
void OnGUI() void OnGUI()
{ {
if (!showGUI) #pragma warning disable 618
return; if (!showGUI) return;
#pragma warning restore 618
GUILayout.BeginArea(new Rect(10 + offsetX, 40 + offsetY, 215, 9999)); GUILayout.BeginArea(new Rect(10 + offsetX, 40 + offsetY, 215, 9999));
if (!NetworkClient.isConnected && !NetworkServer.active) if (!NetworkClient.isConnected && !NetworkServer.active)