From 8123902c2e16f5804fa97dba0ea1ff62662beb80 Mon Sep 17 00:00:00 2001 From: miki Date: Fri, 16 Apr 2021 16:46:55 +0800 Subject: [PATCH 1/2] Fix issue the lrm inspector didn't set dirty while the value is changed --- .../Transport/LRM/Editor/LRMInspector.cs | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/Editor/LRMInspector.cs b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/Editor/LRMInspector.cs index b2f9a73..143d810 100644 --- a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/Editor/LRMInspector.cs +++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/Editor/LRMInspector.cs @@ -194,11 +194,11 @@ namespace LightReflectiveMirror // They have completed the "setup guide" Show them the main UI // Remove unused transports... - foreach(var transport in lrm.GetComponentsInChildren()) + foreach (var transport in lrm.GetComponentsInChildren()) { - if(!(transport is LightReflectiveMirrorTransport)) + if (!(transport is LightReflectiveMirrorTransport)) { - if(transport != lrm.clientToServerTransport && (directModule == null ? true : directModule.directConnectTransport != transport)) + if (transport != lrm.clientToServerTransport && (directModule == null ? true : directModule.directConnectTransport != transport)) { if (transport.gameObject == lrm.gameObject) DestroyImmediate(transport); @@ -223,25 +223,34 @@ namespace LightReflectiveMirror switch (currentTab) { case 0: - // They are in the LRM Settings tab. - if (lrm.useLoadBalancer) + using (var change = new EditorGUI.ChangeCheckScope()) { - EditorGUILayout.HelpBox("While using a Load Balancer, you don't set the LRM node IP or port.", MessageType.Info); - GUI.enabled = false; - } - lrm.serverIP = EditorGUILayout.TextField("LRM Node IP", lrm.serverIP); - lrm.serverPort = (ushort)Mathf.Clamp(EditorGUILayout.IntField("LRM Node Port", lrm.serverPort), ushort.MinValue, ushort.MaxValue); - lrm.endpointServerPort = (ushort)Mathf.Clamp(EditorGUILayout.IntField("Endpoint Port", lrm.endpointServerPort), ushort.MinValue, ushort.MaxValue); - if (lrm.useLoadBalancer) - { - GUI.enabled = true; - } - lrm.authenticationKey = EditorGUILayout.TextField("LRM Auth Key", lrm.authenticationKey); - lrm.heartBeatInterval = EditorGUILayout.Slider("Heartbeat Time", lrm.heartBeatInterval, 0.1f, 5f); - lrm.connectOnAwake = EditorGUILayout.Toggle("Connect on Awake", lrm.connectOnAwake); - lrm.clientToServerTransport = (Transport)EditorGUILayout.ObjectField("LRM Transport", lrm.clientToServerTransport, typeof(Transport), true); + // They are in the LRM Settings tab. + if (lrm.useLoadBalancer) + { + EditorGUILayout.HelpBox("While using a Load Balancer, you don't set the LRM node IP or port.", MessageType.Info); + GUI.enabled = false; + } + lrm.serverIP = EditorGUILayout.TextField("LRM Node IP", lrm.serverIP); + lrm.serverPort = (ushort)Mathf.Clamp(EditorGUILayout.IntField("LRM Node Port", lrm.serverPort), ushort.MinValue, ushort.MaxValue); + lrm.endpointServerPort = (ushort)Mathf.Clamp(EditorGUILayout.IntField("Endpoint Port", lrm.endpointServerPort), ushort.MinValue, ushort.MaxValue); + + if (lrm.useLoadBalancer) + { + GUI.enabled = true; + } + + lrm.authenticationKey = EditorGUILayout.TextField("LRM Auth Key", lrm.authenticationKey); + lrm.heartBeatInterval = EditorGUILayout.Slider("Heartbeat Time", lrm.heartBeatInterval, 0.1f, 5f); + lrm.connectOnAwake = EditorGUILayout.Toggle("Connect on Awake", lrm.connectOnAwake); + lrm.clientToServerTransport = (Transport)EditorGUILayout.ObjectField("LRM Transport", lrm.clientToServerTransport, typeof(Transport), true); + if (change.changed) + { + EditorUtility.SetDirty(lrm); + } + } break; case 1: // NAT punch tab. From 9fcb61656136932e5b5dc0556a765f3db40cf6e3 Mon Sep 17 00:00:00 2001 From: miki Date: Fri, 16 Apr 2021 16:48:19 +0800 Subject: [PATCH 2/2] add package.json --- .../Assets/Mirror/Runtime/Transport/LRM/package.json | 9 +++++++++ .../Mirror/Runtime/Transport/LRM/package.json.meta | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 UnityProject/Assets/Mirror/Runtime/Transport/LRM/package.json create mode 100644 UnityProject/Assets/Mirror/Runtime/Transport/LRM/package.json.meta diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/package.json b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/package.json new file mode 100644 index 0000000..b510c41 --- /dev/null +++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/package.json @@ -0,0 +1,9 @@ +{ + "name": "com.derek-r-s.lrm", + "version": "0.10.120", + "displayName": "Light-Reflective-Mirror", + "description": "Light Reflective Mirror is a transport for Mirror Networking which relays network traffic through your own servers.", + "unity": "2019.4", + "dependencies": {}, + "keywords": [] +} \ No newline at end of file diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/package.json.meta b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/package.json.meta new file mode 100644 index 0000000..83a4cdf --- /dev/null +++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 09ee2ee51265449fea67160707630572 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: