File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Assets/Plugins/WebGL/WebBridge Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,11 @@ public void LogInitializationTime()
192
192
[ WebCommand ( Description = "Find GameObject by name and log its components" ) ]
193
193
public void FindGameObjectByName ( string name )
194
194
{
195
+ #if UNITY_6000_0_OR_NEWER
196
+ var gameObjects = GameObject . FindObjectsByType < GameObject > ( FindObjectsSortMode . None ) . Where ( go => go . name == name ) . ToArray ( ) ;
197
+ #else
195
198
var gameObjects = GameObject . FindObjectsOfType < GameObject > ( ) . Where ( go => go . name == name ) . ToArray ( ) ;
199
+ #endif
196
200
if ( gameObjects . Length == 0 )
197
201
{
198
202
Debug . Log ( $ "No GameObject found with the name: { name } ") ;
Original file line number Diff line number Diff line change @@ -70,12 +70,14 @@ private static void AddAllWebCommands()
70
70
private static void SetGlobalVariables ( )
71
71
{
72
72
var graphicsDevice = SystemInfo . graphicsDeviceType ;
73
- string webGraphics = string . Empty ;
73
+ string webGraphics ;
74
74
switch ( graphicsDevice )
75
75
{
76
+ #if ! UNITY_2023_1_OR_NEWER
76
77
case GraphicsDeviceType . OpenGLES2:
77
78
webGraphics = "WebGL 1" ;
78
79
break ;
80
+ #endif
79
81
case GraphicsDeviceType . OpenGLES3:
80
82
webGraphics = "WebGL 2" ;
81
83
break ;
You can’t perform that action at this time.
0 commit comments