Decompiled source of UK But enemies are invisible v1.0.0

UKbutEnemiesInvisible.dll

Decompiled 11 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("UKbutEnemiesInvisible")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UKbutEnemiesInvisible")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ab24d18b-a1c5-439e-ad70-17d5303c549d")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace UKbutEnemiesInvisible;

[BepInPlugin("swish.ultrakill.enemiesAreInvisible", "UK but enemies are invisible", "1.0.0")]
public class Main : BaseUnityPlugin
{
	public const string pluginGuid = "swish.ultrakill.enemiesAreInvisible";

	public const string pluginName = "UK but enemies are invisible";

	public const string pluginVersion = "1.0.0";

	public GameObject[] enemies;

	public void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"UkBEaI is started!");
	}

	public void Update()
	{
		MusicManager val = Object.FindObjectOfType<MusicManager>();
		if (val.IsInBattle())
		{
			FindAllEnemies();
			MakeEnemiesInvisible();
		}
	}

	public void FindAllEnemies()
	{
		enemies = GameObject.FindGameObjectsWithTag("Enemy");
	}

	public void MakeEnemiesInvisible()
	{
		GameObject[] array = enemies;
		foreach (GameObject val in array)
		{
			((Renderer)val.GetComponentInChildren<SkinnedMeshRenderer>()).enabled = false;
		}
	}

	public void MakeEnemiesVisible()
	{
		GameObject[] array = enemies;
		foreach (GameObject val in array)
		{
			((Renderer)val.GetComponentInChildren<SkinnedMeshRenderer>()).enabled = true;
		}
	}
}