Skip to content

Commit 5a89e34

Browse files
committed
Changed the variables used for icon offsets in NetworkInfo to have meaningful names.
1 parent f974d5e commit 5a89e34

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Netick/Editor/Netick.Unity.Editor.dll

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

Netick/Runtime/Netick.Unity.dll

0 Bytes
Binary file not shown.

Scripts/GameStarter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class GameStarter : NetworkEventsListener
2424
public string ServerIPAddress = "127.0.0.1";
2525

2626
[Header("Headless Server FPS")]
27-
public bool Cap = true;
27+
public bool Cap = true;
2828
public int FPS = 450;
2929

3030
[Header("UI")]

Scripts/NetworkInfo.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public class NetworkInfo : NetworkEventsListener
1717
public float MediumPacketLossThreshold = 1;
1818
public float HighPacketLossThreshold = 10;
1919

20-
public Vector2 Icon1Offset = new Vector2(-80, 30);
21-
public Vector2 Icon2Offset = new Vector2(-80, 70);
22-
public Vector2 Icon3Offset = new Vector2(-80, 110);
20+
public Vector2 PacketLossIconOffset = new Vector2(-80, 30);
21+
public Vector2 LatencyIconOffset = new Vector2(-80, 70);
22+
public Vector2 ServerLagIconOffset = new Vector2(-80, 110);
2323
public float IconSize = 30;
2424

2525
private Texture _packetLossIcon;
@@ -62,9 +62,9 @@ private void DrawText(int offset, string title, string content, string unit)
6262

6363
public void DrawIcons()
6464
{
65-
var pktLossIconPos = Icon1Offset + (Screen.width * Vector2.right);
66-
var latencyIconPos = Icon2Offset + (Screen.width * Vector2.right);
67-
var serverLagIconPos = Icon3Offset + (Screen.width * Vector2.right);
65+
var pktLossIconPos = PacketLossIconOffset + (Screen.width * Vector2.right);
66+
var latencyIconPos = LatencyIconOffset + (Screen.width * Vector2.right);
67+
var serverLagIconPos = ServerLagIconOffset + (Screen.width * Vector2.right);
6868

6969
var pktLoss = Mathf.Max(Sandbox.InPacketLoss, Sandbox.OutPacketLoss) * 100; // multiplying by 100 to convert from a decimal to a percentage.
7070
var rtt = Sandbox.RTT * 1000f; // multiplying by 1000 to convert from seconds to milliseconds.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.karrar.netick",
3-
"version": "0.12.21",
3+
"version": "0.12.22",
44
"displayName": "Netick",
55
"description": "A networking solution for Unity",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)