Swapping to INI instead of XML config, including an AssetBundle for old (5.6.1) Unity versions.

This commit is contained in:
sinaioutlander
2020-11-25 16:40:36 +11:00
parent 687f56eac9
commit be635e46a0
9 changed files with 63 additions and 25 deletions

View File

@ -4,7 +4,6 @@ using UnityEngine.UI;
using UnityExplorer.Inspectors;
using UnityExplorer.UI.Modules;
using System.IO;
//using TMPro;
using System.Reflection;
using UnityExplorer.Helpers;
using UnityExplorer.UI.Shared;
@ -20,9 +19,11 @@ namespace UnityExplorer.UI
public static GameObject CanvasRoot { get; private set; }
public static EventSystem EventSys { get; private set; }
internal static Sprite ResizeCursor { get; private set; }
internal static Font ConsoleFont { get; private set; }
internal static Sprite ResizeCursor { get; private set; }
internal static Shader BackupShader { get; private set; }
public static void Init()
{
LoadBundle();
@ -100,11 +101,13 @@ namespace UnityExplorer.UI
{
var bundle = AssetBundle.LoadFromFile(bundlePath);
BackupShader = bundle.LoadAsset<Shader>("DefaultUI");
// Fix for games which don't ship with 'UI/Default' shader.
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");
Graphic.defaultGraphicMaterial.shader = BackupShader;
}
ResizeCursor = bundle.LoadAsset<Sprite>("cursor");