Decompiled source of DampDepths v1.0.0

DampDepths.dll

Decompiled 9 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using RoR2;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Rendering.PostProcessing;
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: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("DampDepths")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DampDepths")]
[assembly: AssemblyTitle("DampDepths")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DampDepths;

[BepInPlugin("com.RiskOfBrainrot.DampDepths", "DampDepths", "1.0.0")]
public class DampDepthsPlugin : BaseUnityPlugin
{
	public const string guid = "com.RiskOfBrainrot.DampDepths";

	public const string teamName = "RiskOfBrainrot";

	public const string modName = "DampDepths";

	public const string version = "1.0.0";

	public static PluginInfo PInfo { get; private set; }

	public void Awake()
	{
		PInfo = ((BaseUnityPlugin)this).Info;
		SceneManager.activeSceneChanged += OnSceneChanged;
	}

	private void OnSceneChanged(Scene oldScene, Scene newScene)
	{
		//IL_00fe: 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_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		if (!(((Scene)(ref newScene)).name.ToLower() == "dampcavesimple"))
		{
			return;
		}
		GameObject[] rootGameObjects = ((Scene)(ref newScene)).GetRootGameObjects();
		GameObject val = Array.Find(rootGameObjects, (GameObject x) => ((Object)x).name == "HOLDER: Lighting, PP, Wind, Misc");
		if (Object.op_Implicit((Object)(object)val))
		{
			Transform val2 = val.transform.Find("DCPPInTunnels");
			PostProcessVolume val3 = default(PostProcessVolume);
			if ((Object)(object)val2 != (Object)null && ((Component)val2).TryGetComponent<PostProcessVolume>(ref val3))
			{
				val3.sharedProfile = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/ppSceneDampcave.asset").WaitForCompletion();
				RampFog val4 = default(RampFog);
				if (val3.profile.TryGetSettings<RampFog>(ref val4))
				{
					((ParameterOverride<float>)(object)val4.fogPower).Override(0.49f);
					((ParameterOverride<float>)(object)val4.fogOne).Override(0.154f);
				}
			}
		}
		PostProcessVolume val5 = default(PostProcessVolume);
		if (((Component)SceneInfo.instance).TryGetComponent<PostProcessVolume>(ref val5))
		{
			val5.sharedProfile = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/ppSceneDampcave.asset").WaitForCompletion();
			RampFog val6 = default(RampFog);
			if (val5.profile.TryGetSettings<RampFog>(ref val6))
			{
				((ParameterOverride<float>)(object)val6.fogPower).Override(1f);
				((ParameterOverride<float>)(object)val6.fogOne).Override(0.3f);
			}
		}
	}
}