Skip to content
This repository was archived by the owner on Sep 5, 2022. It is now read-only.

Commit 09b652b

Browse files
authored
Merge pull request #16 from sableangle/main
Add package.json and fix issue on LRM inspector
2 parents da2928e + 9fcb616 commit 09b652b

File tree

3 files changed

+44
-19
lines changed

3 files changed

+44
-19
lines changed

UnityProject/Assets/Mirror/Runtime/Transport/LRM/Editor/LRMInspector.cs

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ public override void OnInspectorGUI()
194194
// They have completed the "setup guide" Show them the main UI
195195

196196
// Remove unused transports...
197-
foreach(var transport in lrm.GetComponentsInChildren<Transport>())
197+
foreach (var transport in lrm.GetComponentsInChildren<Transport>())
198198
{
199-
if(!(transport is LightReflectiveMirrorTransport))
199+
if (!(transport is LightReflectiveMirrorTransport))
200200
{
201-
if(transport != lrm.clientToServerTransport && (directModule == null ? true : directModule.directConnectTransport != transport))
201+
if (transport != lrm.clientToServerTransport && (directModule == null ? true : directModule.directConnectTransport != transport))
202202
{
203203
if (transport.gameObject == lrm.gameObject)
204204
DestroyImmediate(transport);
@@ -223,25 +223,34 @@ public override void OnInspectorGUI()
223223
switch (currentTab)
224224
{
225225
case 0:
226-
// They are in the LRM Settings tab.
227-
if (lrm.useLoadBalancer)
226+
using (var change = new EditorGUI.ChangeCheckScope())
228227
{
229-
EditorGUILayout.HelpBox("While using a Load Balancer, you don't set the LRM node IP or port.", MessageType.Info);
230-
GUI.enabled = false;
231-
}
232-
lrm.serverIP = EditorGUILayout.TextField("LRM Node IP", lrm.serverIP);
233-
lrm.serverPort = (ushort)Mathf.Clamp(EditorGUILayout.IntField("LRM Node Port", lrm.serverPort), ushort.MinValue, ushort.MaxValue);
234-
lrm.endpointServerPort = (ushort)Mathf.Clamp(EditorGUILayout.IntField("Endpoint Port", lrm.endpointServerPort), ushort.MinValue, ushort.MaxValue);
235228

236-
if (lrm.useLoadBalancer)
237-
{
238-
GUI.enabled = true;
239-
}
240229

241-
lrm.authenticationKey = EditorGUILayout.TextField("LRM Auth Key", lrm.authenticationKey);
242-
lrm.heartBeatInterval = EditorGUILayout.Slider("Heartbeat Time", lrm.heartBeatInterval, 0.1f, 5f);
243-
lrm.connectOnAwake = EditorGUILayout.Toggle("Connect on Awake", lrm.connectOnAwake);
244-
lrm.clientToServerTransport = (Transport)EditorGUILayout.ObjectField("LRM Transport", lrm.clientToServerTransport, typeof(Transport), true);
230+
// They are in the LRM Settings tab.
231+
if (lrm.useLoadBalancer)
232+
{
233+
EditorGUILayout.HelpBox("While using a Load Balancer, you don't set the LRM node IP or port.", MessageType.Info);
234+
GUI.enabled = false;
235+
}
236+
lrm.serverIP = EditorGUILayout.TextField("LRM Node IP", lrm.serverIP);
237+
lrm.serverPort = (ushort)Mathf.Clamp(EditorGUILayout.IntField("LRM Node Port", lrm.serverPort), ushort.MinValue, ushort.MaxValue);
238+
lrm.endpointServerPort = (ushort)Mathf.Clamp(EditorGUILayout.IntField("Endpoint Port", lrm.endpointServerPort), ushort.MinValue, ushort.MaxValue);
239+
240+
if (lrm.useLoadBalancer)
241+
{
242+
GUI.enabled = true;
243+
}
244+
245+
lrm.authenticationKey = EditorGUILayout.TextField("LRM Auth Key", lrm.authenticationKey);
246+
lrm.heartBeatInterval = EditorGUILayout.Slider("Heartbeat Time", lrm.heartBeatInterval, 0.1f, 5f);
247+
lrm.connectOnAwake = EditorGUILayout.Toggle("Connect on Awake", lrm.connectOnAwake);
248+
lrm.clientToServerTransport = (Transport)EditorGUILayout.ObjectField("LRM Transport", lrm.clientToServerTransport, typeof(Transport), true);
249+
if (change.changed)
250+
{
251+
EditorUtility.SetDirty(lrm);
252+
}
253+
}
245254
break;
246255
case 1:
247256
// NAT punch tab.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "com.derek-r-s.lrm",
3+
"version": "0.10.120",
4+
"displayName": "Light-Reflective-Mirror",
5+
"description": "Light Reflective Mirror is a transport for Mirror Networking which relays network traffic through your own servers.",
6+
"unity": "2019.4",
7+
"dependencies": {},
8+
"keywords": []
9+
}

UnityProject/Assets/Mirror/Runtime/Transport/LRM/package.json.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)