#if STANDALONE
using HarmonyLib;
using System;
using System.IO;
using System.Reflection;
using UnityEngine;
using UnityExplorer.Core.Config;
using UnityExplorer.Loader.STANDALONE;
using UnityEngine.EventSystems;
using UnityExplorer.Core.Input;
using UnityExplorer.Core;
#if CPP
using UnhollowerRuntimeLib;
#endif
namespace UnityExplorer
{
public class ExplorerStandalone : IExplorerLoader
{
///
/// Call this to initialize UnityExplorer without adding a log listener.
///
/// The new (or active, if one exists) instance of ExplorerStandalone.
public static ExplorerStandalone CreateInstance() => CreateInstance(null);
///
/// Call this to initialize UnityExplorer and add a listener for UnityExplorer's log messages.
///
/// Your log listener to handle UnityExplorer logs.
/// The new (or active, if one exists) instance of ExplorerStandalone.
public static ExplorerStandalone CreateInstance(Action logListener)
{
if (Instance != null)
return Instance;
if (logListener != null)
OnLog += logListener;
var instance = new ExplorerStandalone();
instance.Init();
return instance;
}
public static ExplorerStandalone Instance { get; private set; }
///
/// Invoked whenever Explorer logs something. Subscribe to this to handle logging.
///
public static event Action OnLog;
public ConfigHandler ConfigHandler => _configHandler;
private StandaloneConfigHandler _configHandler;
public string ExplorerFolder
{
get
{
CheckExplorerFolder();
return s_explorerFolder;
}
}
private static string s_explorerFolder;
Action