This repository was archived by the owner on May 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -446,16 +446,17 @@ private static void LoadBundle()
446
446
447
447
AssetBundle LoadBundle ( string id )
448
448
{
449
- ExplorerCore . Log ( $ "Loading { id } bundle for Unity { Application . unityVersion } ") ;
450
-
451
- return AssetBundle . LoadFromMemory ( ReadFully ( typeof ( ExplorerCore )
449
+ var bundle = AssetBundle . LoadFromMemory ( ReadFully ( typeof ( ExplorerCore )
452
450
. Assembly
453
451
. GetManifestResourceStream ( $ "UnityExplorer.Resources.{ id } .bundle") ) ) ;
452
+ if ( bundle )
453
+ ExplorerCore . Log ( $ "Loaded { id } bundle for Unity { Application . unityVersion } ") ;
454
+ return bundle ;
454
455
}
455
456
456
457
if ( ExplorerBundle == null )
457
458
{
458
- ExplorerCore . LogWarning ( "Could not load the ExplorerUI Bundle!" ) ;
459
+ ExplorerCore . LogWarning ( "Could not load the UnityExplorer UI Bundle!" ) ;
459
460
DefaultFont = ConsoleFont = Resources . GetBuiltinResource < Font > ( "Arial.ttf" ) ;
460
461
return ;
461
462
}
@@ -505,6 +506,11 @@ private static void SetupAssetBundlePatches()
505
506
{
506
507
if ( TypeofAssetBundle . GetMethod ( "UnloadAllAssetBundles" , AccessTools . all ) is MethodInfo unloadAllBundles )
507
508
{
509
+ #if CPP
510
+ // if IL2CPP, ensure method wasn't stripped
511
+ if ( UnhollowerBaseLib . UnhollowerUtils . GetIl2CppMethodInfoPointerFieldForGeneratedMethod ( unloadAllBundles ) == null )
512
+ return ;
513
+ #endif
508
514
var processor = ExplorerCore . Harmony . CreateProcessor ( unloadAllBundles ) ;
509
515
var prefix = new HarmonyMethod ( typeof ( UIManager ) . GetMethod ( nameof ( Prefix_UnloadAllAssetBundles ) , AccessTools . all ) ) ;
510
516
processor . AddPrefix ( prefix ) ;
You can’t perform that action at this time.
0 commit comments