Skip to content

Commit 2fb43f5

Browse files
committed
Fix warnings
1 parent 87c3584 commit 2fb43f5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Assets/Plugins/WebGL/WebBridge/CommonCommands.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ public void LogInitializationTime()
192192
[WebCommand(Description = "Find GameObject by name and log its components")]
193193
public void FindGameObjectByName(string name)
194194
{
195+
#if UNITY_6000_0_OR_NEWER
196+
var gameObjects = GameObject.FindObjectsByType<GameObject>(FindObjectsSortMode.None).Where(go => go.name == name).ToArray();
197+
#else
195198
var gameObjects = GameObject.FindObjectsOfType<GameObject>().Where(go => go.name == name).ToArray();
199+
#endif
196200
if (gameObjects.Length == 0)
197201
{
198202
Debug.Log($"No GameObject found with the name: {name}");

Assets/Plugins/WebGL/WebBridge/WebBridge.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ private static void AddAllWebCommands()
7070
private static void SetGlobalVariables()
7171
{
7272
var graphicsDevice = SystemInfo.graphicsDeviceType;
73-
string webGraphics = string.Empty;
73+
string webGraphics;
7474
switch (graphicsDevice)
7575
{
76+
#if !UNITY_2023_1_OR_NEWER
7677
case GraphicsDeviceType.OpenGLES2:
7778
webGraphics = "WebGL 1";
7879
break;
80+
#endif
7981
case GraphicsDeviceType.OpenGLES3:
8082
webGraphics = "WebGL 2";
8183
break;

0 commit comments

Comments
 (0)