using ADOFAIRenderer.Core; using HarmonyLib; using MelonLoader; using UnityEngine; using UnityEngine.UI; namespace ADOFAIRenderer.Patch.Game; [HarmonyPatch(typeof(scnEditor))] // ReSharper disable once InconsistentNaming public static class scnEditorPatch { [HarmonyPostfix] [HarmonyPatch("Start")] // ReSharper disable once InconsistentNaming public static void AddButtonRender(scnEditor __instance) { if (RenderMod.IsFeatureDisabled) return; if (!__instance || !__instance.buttonExit) { Melon.Logger.Msg("Cannot create render button in scnEditor."); return; } var cloneTarget = __instance.buttonExit!.gameObject; var buttonContainer = cloneTarget.transform.parent!; var buttonObj = Object.Instantiate(cloneTarget, buttonContainer)!; buttonObj.name = "buttonRender"; var button = buttonObj.GetComponent