Decompiled source of ThirdPerson v1.0.0

ThirdPerson.dll

Decompiled 5 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
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: AssemblyTitle("ThirdPerson")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ThirdPerson")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b946bf0c-1f7f-4f81-a67e-4c2565535448")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ThirdPerson;

[HarmonyPatch(typeof(NewMovement))]
internal class ThirdPatch
{
	[HarmonyPatch("Awake")]
	[HarmonyPostfix]
	private static void Postfix(NewMovement __instance)
	{
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		if (!(SceneHelper.CurrentScene == "Main Menu"))
		{
			GroundCheck componentInChildren = ((Component)__instance).GetComponentInChildren<GroundCheck>();
			PlayerAnimations componentInChildren2 = ((Component)componentInChildren).GetComponentInChildren<PlayerAnimations>();
			SkinnedMeshRenderer[] componentsInChildren = ((Component)componentInChildren2).GetComponentsInChildren<SkinnedMeshRenderer>(true);
			foreach (SkinnedMeshRenderer val in componentsInChildren)
			{
				((Component)val).gameObject.layer = 0;
			}
			CameraController instance = MonoSingleton<CameraController>.Instance;
			Transform val2 = ((Component)instance).transform.Find("Guns");
			((Behaviour)((Component)val2).GetComponent<WalkingBob>()).enabled = false;
			WeaponPos[] componentsInChildren2 = ((Component)val2).GetComponentsInChildren<WeaponPos>(true);
			foreach (WeaponPos val3 in componentsInChildren2)
			{
				((Component)val3).transform.position = new Vector3(-1000f, -1000f, -1000f);
			}
			Transform val4 = ((Component)instance).transform.Find("Punch");
			Punch[] componentsInChildren3 = ((Component)val4).GetComponentsInChildren<Punch>(true);
			foreach (Punch val5 in componentsInChildren3)
			{
				((Component)val5).transform.position = new Vector3(-1000f, -1000f, -1000f);
			}
		}
	}

	[HarmonyPatch("Update")]
	[HarmonyPostfix]
	private static void PostfixII(NewMovement __instance)
	{
		//IL_006b: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		if (!(SceneHelper.CurrentScene == "Main Menu"))
		{
			CameraController instance = MonoSingleton<CameraController>.Instance;
			Transform val = ((Component)instance).transform.Find("Guns");
			((Behaviour)((Component)val).GetComponent<WalkingBob>()).enabled = false;
			WeaponPos[] componentsInChildren = ((Component)val).GetComponentsInChildren<WeaponPos>(true);
			foreach (WeaponPos val2 in componentsInChildren)
			{
				((Component)val2).transform.position = new Vector3(-1000f, -1000f, -1000f);
			}
			Transform val3 = ((Component)instance).transform.Find("Punch");
			Punch[] componentsInChildren2 = ((Component)val3).GetComponentsInChildren<Punch>(true);
			foreach (Punch val4 in componentsInChildren2)
			{
				((Component)val4).transform.position = new Vector3(-1000f, -1000f, -1000f);
			}
			instance.originalPos = new Vector3(0f, 2.5f, -2.5f);
		}
	}
}
[BepInPlugin("com.d1g1tal.thirdperson", "ThirdPerson", "1.0.0")]
public class ThrPlugin : BaseUnityPlugin
{
	public void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("com.d1g1tal.thirdperson").PatchAll();
		Debug.Log((object)"Loaded third person mod");
	}
}