Decompiled source of ExtendedFOV v1.0.0

ExtendedFOV.dll

Decompiled 4 months ago
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Il2CppSystem;
using MelonLoader;
using TestMod;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Mod for Testing")]
[assembly: AssemblyDescription("Mod for Testing")]
[assembly: AssemblyCompany(null)]
[assembly: AssemblyProduct("TestMod")]
[assembly: AssemblyCopyright("Created by TestAuthor")]
[assembly: AssemblyTrademark(null)]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: MelonInfo(typeof(global::TestMod.TestMod), "TestMod", "1.0.0", "TestAuthor", null)]
[assembly: MelonColor]
[assembly: MelonGame(null, null)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace TestMod;

public static class BuildInfo
{
	public const string Name = "TestMod";

	public const string Description = "Mod for Testing";

	public const string Author = "TestAuthor";

	public const string Company = null;

	public const string Version = "1.0.0";

	public const string DownloadLink = null;
}
public class TestMod : MelonMod
{
	public GameObject mainCam;

	public override void OnInitializeMelon()
	{
		MelonLogger.Msg("OnApplicationStart");
	}

	public override void OnLateInitializeMelon()
	{
		MelonLogger.Msg("OnApplicationLateStart");
	}

	public override void OnSceneWasLoaded(int buildindex, string sceneName)
	{
		MelonLogger.Msg("OnSceneWasLoaded: " + buildindex + " | " + sceneName);
	}

	public override void OnSceneWasInitialized(int buildindex, string sceneName)
	{
		MelonCoroutines.Start(FindHeadsetObject());
		mainCam = GameObject.Find("Headset");
		MelonLogger.Msg("OnSceneWasInitialized: " + buildindex + " | " + sceneName);
	}

	private IEnumerator FindHeadsetObject()
	{
		while (true)
		{
			mainCam = GameObject.Find("Headset");
			if ((Object)(object)mainCam != (Object)null)
			{
				break;
			}
			Debug.Log(Object.op_Implicit("Main cam is null, waiting for it..."));
			yield return mainCam;
		}
		Debug.Log(Object.op_Implicit("Main cam is not null, this is good."));
		Camera component = mainCam.GetComponent<Camera>();
		Scene activeScene = SceneManager.GetActiveScene();
		if (!(((Scene)(ref activeScene)).name == "Gym"))
		{
			activeScene = SceneManager.GetActiveScene();
			if (!(((Scene)(ref activeScene)).name == "Park"))
			{
				if ((Object)(object)component != (Object)null)
				{
					component.fieldOfView = 87.9547f;
					Debug.Log(Object.op_Implicit("FOV set to 87.9547 (defualt)"));
				}
				else
				{
					Debug.Log(Object.op_Implicit("Camera component not found on Main cam."));
				}
				yield break;
			}
		}
		if ((Object)(object)component != (Object)null)
		{
			component.fieldOfView = 120f;
			Debug.Log(Object.op_Implicit("FOV set to 120."));
		}
		else
		{
			Debug.Log(Object.op_Implicit("Camera component not found on Main cam."));
		}
	}

	public override void OnSceneWasUnloaded(int buildIndex, string sceneName)
	{
		MelonLogger.Msg("OnSceneWasUnloaded: " + buildIndex + " | " + sceneName);
	}

	public override void OnUpdate()
	{
	}

	public override void OnFixedUpdate()
	{
	}

	public override void OnLateUpdate()
	{
	}

	public override void OnGUI()
	{
	}

	public override void OnApplicationQuit()
	{
	}

	public override void OnPreferencesSaved()
	{
	}

	public override void OnPreferencesLoaded()
	{
	}
}