Decompiled source of SuperGlass v1.0.0

SuperGlass.dll

Decompiled 13 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using HarmonyLib;
using MelonLoader;
using SuperGlass;
using UnityEngine;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyTitle("SuperGlass")]
[assembly: AssemblyDescription("Make enemies transparent... like real glass")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SuperGlass")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: ComVisible(false)]
[assembly: Guid("6b6b8b3e-6f4a-4e2a-9d3f-2c9a1e6f7c11")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: MelonInfo(typeof(mainclass), "SuperGlass", "1.0.0", "BayTurtleKing", null)]
[assembly: MelonGame("SUPERHOT_Team", "SUPERHOT")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SuperGlass;

public class mainclass : MelonMod
{
	public static Material transparenttmattt;

	private static readonly int metaLlLlL = Shader.PropertyToID("_Metallic");

	private static readonly int glowglow = Shader.PropertyToID("_EmissionColor");

	private static readonly int shinyy = Shader.PropertyToID("_Glossiness");

	private static readonly int specccccccccc = Shader.PropertyToID("_SpecColor");

	public override void OnLateInitializeMelon()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Expected O, but got Unknown
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		transparenttmattt = new Material(Shader.Find("Standard"));
		transparenttmattt.color = new Color(1f, 1f, 1f, 0.22f);
		transparenttmattt.SetInt("_ZWrite", 0);
		transparenttmattt.DisableKeyword("_ALPHAPREMULTIPLY_ON");
		transparenttmattt.renderQueue = 3000;
		transparenttmattt.SetInt("_SrcBlend", 5);
		transparenttmattt.SetFloat(shinyy, 0.95f);
		transparenttmattt.SetFloat(metaLlLlL, 0.05f);
		transparenttmattt.EnableKeyword("_ALPHABLEND_ON");
		transparenttmattt.SetColor(specccccccccc, new Color(1f, 1f, 1f, 1f));
		transparenttmattt.DisableKeyword("_ALPHATEST_ON");
		transparenttmattt.EnableKeyword("_EMISSION");
		transparenttmattt.SetColor(glowglow, new Color(0.18f, 0.18f, 0.18f, 1f));
		transparenttmattt.SetInt("_DstBlend", 10);
	}

	public override void OnSceneWasInitialized(int buildindex, string scenename)
	{
		dodastuff();
		makedashatterorbloodidkwhite();
	}

	private static void makedashatterorbloodidkwhite()
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
		foreach (GameObject val in array)
		{
			if (((Object)val).name.Contains("Particles - geometry") || ((Object)val).name.Contains("Particles - enemyballs"))
			{
				ParticleSystem component = val.GetComponent<ParticleSystem>();
				ParticleSystemRenderer component2 = val.GetComponent<ParticleSystemRenderer>();
				if ((Object)(object)component != (Object)null)
				{
					MainModule main = component.main;
					((MainModule)(ref main)).startColor = new MinMaxGradient(Color.white);
				}
				if ((Object)(object)component2 != (Object)null)
				{
					((Renderer)component2).material = transparenttmattt;
				}
			}
		}
	}

	private static void dodastuff()
	{
		GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
		foreach (GameObject val in array)
		{
			if (((Object)val).name.Contains("Enemy") || ((Object)val).name.Contains("enemy"))
			{
				Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(true);
				for (int j = 0; j < componentsInChildren.Length; j++)
				{
					componentsInChildren[j].material = transparenttmattt;
				}
			}
		}
	}
}
[HarmonyPatch(typeof(MaterialDefinition), "InitDictionaries")]
public static class makeemglass
{
	private static readonly FieldInfo mat = typeof(MaterialDefinition).GetField("Material", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

	private static void Postfix(MaterialDefinition __instance)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		Material val = (Material)mat.GetValue(__instance);
		if ((Object)(object)val != (Object)null && ((Object)val).name == "MAIN RedCrystalNuEnemyMaterial")
		{
			MelonLogger.Msg("makin em glass: " + ((Object)val).name);
			mat.SetValue(__instance, mainclass.transparenttmattt);
		}
	}
}