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()
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 } ") ;
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments