Decompiled source of PortalGrind v1.0.0

PortalGrind.dll

Decompiled 2 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using ULTRAKILL.Portal;
using ULTRAKILL.Portal.Geometry;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ThundergunRevised")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ThundergunRevised")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5711e2a0-d5a7-4ddf-b8d4-00f355fe9397")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("en-FI")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace UltraInterloper;

[BepInPlugin("plonk.mod", "MOD", "1.0.0")]
public class MainCode : BaseUnityPlugin
{
	public GameObject follower;

	public void Awake()
	{
		SceneManager.sceneLoaded += OnSceneChange;
	}

	public void Start()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("plonk.mod").PatchAll();
	}

	public void OnSceneChange(Scene scene, LoadSceneMode mode)
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		if (!(SceneHelper.CurrentScene == "Endless") || !((Object)(object)follower == (Object)null))
		{
			return;
		}
		follower = new GameObject("PortalFollower");
		Follow obj = follower.AddComponent<Follow>();
		obj.followY = true;
		obj.followX = false;
		obj.followZ = false;
		obj.mimicPosition = true;
		obj.mimicRotation = false;
		while (follower.transform.childCount != 2)
		{
			Transform transform = new GameObject("Portal", new Type[1] { typeof(Portal) }).transform;
			transform.parent = follower.transform;
			if (follower.transform.childCount == 1)
			{
				((Component)transform).transform.localPosition = new Vector3(0f, 0f, 22.5f);
				((Component)transform).transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
			}
			else
			{
				((Component)transform).transform.localPosition = new Vector3(-40f, 0f, 62.5f);
				((Component)transform).transform.localRotation = Quaternion.Euler(0f, 270f, 0f);
			}
			Transform transform2 = new GameObject("PortalExit").transform;
			transform2.parent = transform;
			((Component)transform2).transform.localPosition = new Vector3(0f, 0f, -80f);
			((Component)transform2).transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
			Portal component = ((Component)transform).GetComponent<Portal>();
			component.shape = (IPortalShape)(object)new PlaneShape
			{
				width = 80f,
				height = 80f
			};
			component.entry = transform;
			component.exit = transform2;
			component.entryTravelFlags = (PortalTravellerFlags)62;
			component.exitTravelFlags = (PortalTravellerFlags)62;
			component.renderSettings = (PortalSideFlags)6;
			component.appearsInRecursions = true;
			component.maxRecursions = 1;
			component.canSeeItself = true;
			component.canHearAudio = true;
			component.canSeePortalLayer = true;
		}
	}

	public void Update()
	{
	}
}