Decompiled source of ClearFirstPerson v1.0.1

ClearFirstPersonMod.dll

Decompiled 11 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ClearFirstPersonMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClearFirstPersonMod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("E148BF25-87F3-4345-85B3-141CE09952DD")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ClearFirstPersonMod;

[BepInPlugin("Mhz.clearfirstperson", "Clear First Person", "1.0.0")]
public class ClearFirstPersonPlugin : BaseUnityPlugin
{
	private GameObject _playerHUDHelmetModelObject;

	private void Awake()
	{
		SceneManager.sceneLoaded += OnSceneLoaded;
		((BaseUnityPlugin)this).Logger.LogInfo((object)"ClearFirstPersonPlugin loaded.");
	}

	private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		ExecuteClearFirstPersonLogic();
	}

	private void ExecuteClearFirstPersonLogic()
	{
		_playerHUDHelmetModelObject = GameObject.Find("Systems/Rendering/PlayerHUDHelmetModel");
		if ((Object)(object)_playerHUDHelmetModelObject != (Object)null)
		{
			_playerHUDHelmetModelObject.SetActive(false);
		}
		else
		{
			((BaseUnityPlugin)this).Logger.LogError((object)"PlayerHUDHelmetModel not found in the scene.");
		}
	}
}