SHA256
50 lines
1.7 KiB
C#
50 lines
1.7 KiB
C#
using ADOFAIRenderer;
|
|
using ADOFAIRenderer.Core;
|
|
using ADOFAIRenderer.Util;
|
|
using MelonLoader;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
[assembly: MelonInfo(typeof(RenderMod), "ADOFAI Renderer", "0.0.6-BETA", "ADOFAI Editor Forum")]
|
|
[assembly: MelonGame("7th Beat Games", "A Dance of Fire and Ice")]
|
|
|
|
namespace ADOFAIRenderer
|
|
{
|
|
public class RenderMod : MelonMod
|
|
{
|
|
public static AssetBundle FontBundle = null!;
|
|
public static AssetBundle SceneBundle = null!;
|
|
public static string[] ModScenes = {};
|
|
|
|
public override void OnInitializeMelon()
|
|
{
|
|
var renderManagerObj = new GameObject("Render Manager");
|
|
var updateHookerObj = new GameObject("Update Hooker");
|
|
Object.DontDestroyOnLoad(renderManagerObj);
|
|
Object.DontDestroyOnLoad(updateHookerObj);
|
|
|
|
renderManagerObj.AddComponent<RenderManager>();
|
|
updateHookerObj.AddComponent<FirstUpdateHook>();
|
|
LoadBundles();
|
|
}
|
|
|
|
private static void LoadBundles()
|
|
{
|
|
FontBundle = BundleLoader.GetBundle("fonts");
|
|
SceneBundle = BundleLoader.GetBundle("scenes");
|
|
ModScenes = SceneBundle.GetAllScenePaths();
|
|
}
|
|
|
|
public static void FixEventSystem()
|
|
{
|
|
if (EventSystem.current == null) return;
|
|
var currentModule = EventSystem.current.currentInputModule;
|
|
|
|
if (currentModule != null) return;
|
|
Melon<RenderMod>.Logger.Msg("Unity 6 인풋 모듈 이식.");
|
|
|
|
var newModule = EventSystem.current.gameObject.AddComponent<StandaloneInputModule>();
|
|
newModule.enabled = true;
|
|
}
|
|
}
|
|
} |