Decompiled source of NoMoreSpooders v0.0.2

plugins/NoMoreSpooder.dll

Decompiled 8 months ago
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NoMoreSpooder")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NoMoreSpooder")]
[assembly: AssemblyTitle("NoMoreSpooder")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NoMoreSpooder;

[BepInPlugin("koala.contentwarning.nomorespooders", "No More Spooders", "0.0.2")]
public class NMS : BaseUnityPlugin
{
	private const string ModID = "koala.contentwarning.nomorespooders";

	private const string ModName = "No More Spooders";

	private const string Version = "0.0.2";

	internal static AssetBundle Assets;

	public static NMS Instance { get; private set; }

	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("koala.contentwarning.nomorespooders");
		val.PatchAll();
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		else
		{
			Object.Destroy((Object)(object)this);
		}
		string name = typeof(NMS).Assembly.GetManifestResourceNames().Single((string str) => str.EndsWith("nospooders"));
		Stream manifestResourceStream = typeof(NMS).Assembly.GetManifestResourceStream(name);
		Assets = AssetBundle.LoadFromStream(manifestResourceStream);
	}

	public void Update()
	{
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		Object[] array = Object.FindObjectsOfType(typeof(SpiderContentProvider));
		foreach (Object val in array)
		{
			SpiderContentProvider val2 = (SpiderContentProvider)(object)((val is SpiderContentProvider) ? val : null);
			if ((Object)(object)((Component)((Component)val2).transform.GetChild(2).GetChild(0).GetChild(2)).GetComponent<SkinnedMeshRenderer>().sharedMesh != (Object)(object)Assets.LoadAsset<GameObject>("NewSpider").GetComponent<SkinnedMeshRenderer>().sharedMesh)
			{
				((Component)((Component)((Component)val2).transform.GetChild(2).GetChild(0).GetChild(2)).GetComponent<SkinnedMeshRenderer>().rootBone).transform.localScale = Vector3.one * 25f;
				((Component)((Component)val2).transform.GetChild(2).GetChild(0).GetChild(2)).GetComponent<SkinnedMeshRenderer>().sharedMesh = Assets.LoadAsset<GameObject>("NewSpider").GetComponent<SkinnedMeshRenderer>().sharedMesh;
			}
		}
	}
}