Decompiled source of SustainScanPentagonFix v0.0.1

plugins/SustainScanPentagonFix.dll

Decompiled a day ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Unity.IL2CPP;
using ChainedPuzzles;
using GTFO.API;
using HarmonyLib;
using LevelGeneration;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("SustainScanPentagonFix")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SustainScanPentagonFix")]
[assembly: AssemblyTitle("SustainScanPentagonFix")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SustainScanPentagonFix;

[BepInPlugin("Ribbit.SustainScanPentagonFix", "SustainScanPentagonFix", "1.0.0")]
public class Plugin : BasePlugin
{
	public override void Load()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("SustainScanFix").PatchAll();
		EventAPI.OnExpeditionStarted += SustainScanFix;
	}

	public static void SustainScanFix()
	{
		int num = 0;
		foreach (CP_Bioscan_Graphics componentsInChild in ((Component)Builder.CurrentFloor).GetComponentsInChildren<CP_Bioscan_Graphics>(true))
		{
			foreach (Transform componentsInChild2 in ((Component)componentsInChild).GetComponentsInChildren<Transform>(true))
			{
				if (((Object)componentsInChild2).name.ToLower().Contains("zone") && (Object)(object)((Component)componentsInChild2).GetComponent<MeshRenderer>() != (Object)null && ((Object)((Renderer)((Component)componentsInChild2).GetComponent<MeshRenderer>()).material).name.ToLower().Contains("pentagon"))
				{
					num++;
					((Renderer)((Component)componentsInChild2).GetComponent<MeshRenderer>()).material.SetTexture("_Mask", (Texture)(object)Texture2D.whiteTexture);
				}
			}
		}
	}
}