From c585467471812ccb2d17ba40f444cb5ab96d1fd1 Mon Sep 17 00:00:00 2001 From: Derek S <44935661+Derek-R-S@users.noreply.github.com> Date: Wed, 7 Apr 2021 13:50:28 -0500 Subject: [PATCH] Added inspector UI to show invalid api compatibility level --- .../Runtime/Transport/LRM/Editor/LRMInspector.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/Editor/LRMInspector.cs b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/Editor/LRMInspector.cs index feb6f91..92cd7ef 100644 --- a/UnityProject/Assets/Mirror/Runtime/Transport/LRM/Editor/LRMInspector.cs +++ b/UnityProject/Assets/Mirror/Runtime/Transport/LRM/Editor/LRMInspector.cs @@ -191,9 +191,19 @@ namespace LightReflectiveMirror { // They have completed the "setup guide" Show them the main UI +#if !NET_4_6 + EditorGUILayout.BeginVertical("Box"); + EditorGUILayout.HelpBox("For LRM to function properly, it needs the API Compatibility to be at 4.x", MessageType.Error); + if (GUILayout.Button("Change to 4.x")) + PlayerSettings.SetApiCompatibilityLevel(BuildTargetGroup.Standalone, ApiCompatibilityLevel.NET_4_6); + EditorGUILayout.EndVertical(); + EditorGUILayout.Space(); +#endif + currentTab = GUILayout.Toolbar(currentTab, tabs); EditorGUILayout.Space(); + EditorGUILayout.BeginVertical("Box"); switch (currentTab) { case 0: @@ -261,6 +271,7 @@ namespace LightReflectiveMirror EditorGUILayout.PropertyField(serializedObject.FindProperty("serverListUpdated")); break; } + EditorGUILayout.EndVertical(); } } }