Changed the variables used for icon offsets in NetworkInfo to have meaningful names.

This commit is contained in:
Karrar
2024-08-25 02:09:27 +03:00
parent d294f65bd7
commit b62d5d40e4
8 changed files with 8 additions and 8 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -24,7 +24,7 @@ namespace Netick.Samples
public string ServerIPAddress = "127.0.0.1";
[Header("Headless Server FPS")]
public bool Cap = true;
public bool Cap = true;
public int FPS = 450;
[Header("UI")]

View File

@@ -17,9 +17,9 @@ namespace Netick.Samples
public float MediumPacketLossThreshold = 1;
public float HighPacketLossThreshold = 10;
public Vector2 Icon1Offset = new Vector2(-80, 30);
public Vector2 Icon2Offset = new Vector2(-80, 70);
public Vector2 Icon3Offset = new Vector2(-80, 110);
public Vector2 PacketLossIconOffset = new Vector2(-80, 30);
public Vector2 LatencyIconOffset = new Vector2(-80, 70);
public Vector2 ServerLagIconOffset = new Vector2(-80, 110);
public float IconSize = 30;
private Texture _packetLossIcon;
@@ -62,9 +62,9 @@ namespace Netick.Samples
public void DrawIcons()
{
var pktLossIconPos = Icon1Offset + (Screen.width * Vector2.right);
var latencyIconPos = Icon2Offset + (Screen.width * Vector2.right);
var serverLagIconPos = Icon3Offset + (Screen.width * Vector2.right);
var pktLossIconPos = PacketLossIconOffset + (Screen.width * Vector2.right);
var latencyIconPos = LatencyIconOffset + (Screen.width * Vector2.right);
var serverLagIconPos = ServerLagIconOffset + (Screen.width * Vector2.right);
var pktLoss = Mathf.Max(Sandbox.InPacketLoss, Sandbox.OutPacketLoss) * 100; // multiplying by 100 to convert from a decimal to a percentage.
var rtt = Sandbox.RTT * 1000f; // multiplying by 1000 to convert from seconds to milliseconds.

View File

@@ -1,6 +1,6 @@
{
"name": "com.karrar.netick",
"version": "0.12.21",
"version": "0.12.22",
"displayName": "Netick",
"description": "A networking solution for Unity",
"unity": "2021.3",