Decompiled source of F1TrashNuker v1.0.0

F1TrashNuker.dll

Decompiled a month ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using MelonLoader;
using ScheduleOne.Trash;
using TrashCleanupMod;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Main), "Trash Cleanup (F1)", "1.1", "Flaco", null)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace TrashCleanupMod;

public class Main : MelonMod
{
	public override void OnUpdate()
	{
		if (!Input.GetKeyDown((KeyCode)282))
		{
			return;
		}
		TrashItem[] array = Object.FindObjectsOfType<TrashItem>();
		int num = 0;
		TrashItem[] array2 = array;
		foreach (TrashItem val in array2)
		{
			if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).gameObject != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)val).gameObject);
				num++;
			}
		}
		MelonLogger.Msg($"\ud83d\udca5 TRASH CLEARED — {num} trash objects destroyed.");
		Debug.Log((object)"\ud83d\udca5 TRASH CLEARED");
	}
}