DebugConsole save log on quit, some work on CacheObjects, fix missing-material issue on games without default UI Shader

This commit is contained in:
sinaioutlander
2020-11-12 20:31:08 +11:00
parent 668c8f7c3f
commit dc449d4a1e
17 changed files with 336 additions and 248 deletions

View File

@ -32,7 +32,11 @@ namespace UnityExplorer.UI
var bundle = AssetBundle.LoadFromFile(bundlePath);
// Fix for games which don't ship with 'UI/Default' shader.
Graphic.defaultGraphicMaterial.shader = bundle.LoadAsset<Shader>("DefaultUI");
if (Graphic.defaultGraphicMaterial.shader?.name != "UI/Default")
{
ExplorerCore.Log("This game does not ship with the 'UI/Default' shader, using manual Default Shader...");
Graphic.defaultGraphicMaterial.shader = bundle.LoadAsset<Shader>("DefaultUI");
}
ResizeCursor = bundle.LoadAsset<Sprite>("cursor");