Decompiled source of Lethal Lava Land DS v1.0.1

BRC_Fog1.1.dll

Decompiled 19 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using MapStation.Common.Runtime;
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("BRC_Fog")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BRC_Fog")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("36192a4e-536c-4874-9bf7-3d058aaaf0b0")]
[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")]
[BepInPlugin("ooo.FogToggler", "FogToggler", "1.1.0")]
public class FogToggler : BaseUnityPlugin
{
	[CompilerGenerated]
	private sealed class <OnFooogScene>d__3 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public FogToggler <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <OnFooogScene>d__3(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = null;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				RenderSettings.fog = Object.op_Implicit((Object)(object)GameObject.Find("FooogOption"));
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private bool fooog = false;

	private void Awake()
	{
		MapOptions.OnMapOptionsChanged = (Action)Delegate.Combine(MapOptions.OnMapOptionsChanged, new Action(OnMapOptionsChanged));
		SceneManager.sceneLoaded += OnSceneLoaded;
	}

	private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		fooog = false;
		if (Object.op_Implicit((Object)(object)GameObject.Find("FooogOption")))
		{
			fooog = true;
			((MonoBehaviour)this).StartCoroutine(OnFooogScene());
		}
	}

	[IteratorStateMachine(typeof(<OnFooogScene>d__3))]
	private IEnumerator OnFooogScene()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <OnFooogScene>d__3(0)
		{
			<>4__this = this
		};
	}

	private void OnMapOptionsChanged()
	{
		if (fooog)
		{
			RenderSettings.fog = Object.op_Implicit((Object)(object)GameObject.Find("FooogOption"));
		}
	}
}