@@ -40,7 +40,7 @@ public static IntPtr LoadLibrary(string libraryPath)
4040 if ( string . IsNullOrEmpty ( libraryPath ) )
4141 throw new ArgumentNullException ( nameof ( libraryPath ) ) ;
4242
43- #if ( ANDROID || IOS || VISIONOS ) || ( UNITY_ANDROID || UNITY_IOS || UNITY_VISIONOS )
43+ #if ( ANDROID || IOS || VISIONOS ) || ( ! UNITY_EDITOR && ( UNITY_ANDROID || UNITY_IOS || UNITY_VISIONOS ) )
4444 return Mobile . dlopen ( libraryPath ) ;
4545#else
4646 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
@@ -64,7 +64,7 @@ public static IntPtr GetSymbol(IntPtr library, string symbolName)
6464 if ( string . IsNullOrEmpty ( symbolName ) )
6565 throw new ArgumentNullException ( nameof ( symbolName ) ) ;
6666
67- #if ( ANDROID || IOS || VISIONOS ) || ( UNITY_ANDROID || UNITY_IOS || UNITY_VISIONOS )
67+ #if ( ANDROID || IOS || VISIONOS ) || ( ! UNITY_EDITOR && ( UNITY_ANDROID || UNITY_IOS || UNITY_VISIONOS ) )
6868 return Mobile . dlsym ( library , symbolName ) ;
6969#else
7070 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
@@ -86,7 +86,7 @@ public static void FreeLibrary(IntPtr library)
8686 if ( library == IntPtr . Zero )
8787 return ;
8888
89- #if ( ANDROID || IOS || VISIONOS ) || ( UNITY_ANDROID || UNITY_IOS || UNITY_VISIONOS )
89+ #if ( ANDROID || IOS || VISIONOS ) || ( ! UNITY_EDITOR && ( UNITY_ANDROID || UNITY_IOS || UNITY_VISIONOS ) )
9090 Mobile . dlclose ( library ) ;
9191#else
9292 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
@@ -192,7 +192,7 @@ private static class Mobile
192192 {
193193 public static IntPtr dlopen ( string path ) => dlopen ( path , 1 ) ;
194194
195- #if ( ANDROID || IOS || VISIONOS ) || ( UNITY_ANDROID || UNITY_IOS || UNITY_VISIONOS )
195+ #if ( ANDROID || IOS || VISIONOS ) || ( ! UNITY_EDITOR && ( UNITY_ANDROID || UNITY_IOS || UNITY_VISIONOS ) )
196196 [ DllImport ( "__Internal" ) ]
197197 public static extern IntPtr dlopen ( string filename , int flags ) ;
198198
0 commit comments