mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-01 11:12:49 +08:00
Attempt fix at bundle unloading
This commit is contained in:
@ -158,6 +158,10 @@ namespace UnityExplorer.UI
|
|||||||
if (!ShowMenu)
|
if (!ShowMenu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// In case the bundle has been unloaded, reload it.
|
||||||
|
if (!DefaultFont)
|
||||||
|
LoadBundle();
|
||||||
|
|
||||||
// Check forceUnlockMouse toggle
|
// Check forceUnlockMouse toggle
|
||||||
if (InputManager.GetKeyDown(ConfigManager.Force_Unlock_Toggle.Value))
|
if (InputManager.GetKeyDown(ConfigManager.Force_Unlock_Toggle.Value))
|
||||||
CursorUnlocker.Unlock = !CursorUnlocker.Unlock;
|
CursorUnlocker.Unlock = !CursorUnlocker.Unlock;
|
||||||
@ -454,14 +458,19 @@ namespace UnityExplorer.UI
|
|||||||
if (bundle == null)
|
if (bundle == null)
|
||||||
{
|
{
|
||||||
ExplorerCore.LogWarning("Could not load the ExplorerUI Bundle!");
|
ExplorerCore.LogWarning("Could not load the ExplorerUI Bundle!");
|
||||||
ConsoleFont = Resources.GetBuiltinResource<Font>("Arial.ttf");
|
DefaultFont = ConsoleFont = Resources.GetBuiltinResource<Font>("Arial.ttf");
|
||||||
DefaultFont = ConsoleFont;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bundle loaded
|
// Bundle loaded
|
||||||
|
|
||||||
ConsoleFont = bundle.LoadAsset<Font>("CONSOLA");
|
ConsoleFont = bundle.LoadAsset<Font>("CONSOLA");
|
||||||
|
ConsoleFont.hideFlags = HideFlags.HideAndDontSave;
|
||||||
|
UnityEngine.Object.DontDestroyOnLoad(ConsoleFont);
|
||||||
|
|
||||||
DefaultFont = bundle.LoadAsset<Font>("arial");
|
DefaultFont = bundle.LoadAsset<Font>("arial");
|
||||||
|
DefaultFont.hideFlags = HideFlags.HideAndDontSave;
|
||||||
|
UnityEngine.Object.DontDestroyOnLoad(DefaultFont);
|
||||||
|
|
||||||
BackupShader = bundle.LoadAsset<Shader>("DefaultUI");
|
BackupShader = bundle.LoadAsset<Shader>("DefaultUI");
|
||||||
// Fix for games which don't ship with 'UI/Default' shader.
|
// Fix for games which don't ship with 'UI/Default' shader.
|
||||||
|
Reference in New Issue
Block a user