From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- Client/Assembly-CSharp/PingTracker.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Client/Assembly-CSharp/PingTracker.cs (limited to 'Client/Assembly-CSharp/PingTracker.cs') diff --git a/Client/Assembly-CSharp/PingTracker.cs b/Client/Assembly-CSharp/PingTracker.cs new file mode 100644 index 0000000..727d71c --- /dev/null +++ b/Client/Assembly-CSharp/PingTracker.cs @@ -0,0 +1,19 @@ +using System; +using UnityEngine; + +public class PingTracker : MonoBehaviour +{ + public TextRenderer text; + + private void Update() + { + if (AmongUsClient.Instance) + { + if (AmongUsClient.Instance.GameMode == GameModes.FreePlay) + { + base.gameObject.SetActive(false); + } + this.text.Text = string.Format("Ping: {0} ms", AmongUsClient.Instance.Ping); + } + } +} -- cgit v1.1-26-g67d0