Decompiled source of Tolian Moons v2.3.7

DLL/AmbientToggle.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using Microsoft.CodeAnalysis;
using UnityEngine;

[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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("AmbientToggle")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("A template for Lethal Company")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+19c58dffe9f226e5cd691ef891e2cd722416e3b6")]
[assembly: AssemblyProduct("AmbientToggle")]
[assembly: AssemblyTitle("AmbientToggle")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public static class AmbientToggleConfig
{
	public static ConfigEntry<bool> AmbientEnabled;

	public static void Init(ConfigFile config)
	{
		AmbientEnabled = config.Bind<bool>("Ambient Settings", "AmbientEnabled", true, "Toggle for enabling/disabling the ambient on the PsychSanctum");
	}
}
namespace AmbientToggle
{
	[BepInPlugin("com.Toliann.AmbientToggle", "AmbientToggle", "0.0.1")]
	public class AmbientToggleInfo : BaseUnityPlugin
	{
		public const string GUID = "com.Toliann.AmbientToggle";

		public const string NAME = "AmbientToggle";

		public const string VERSION = "0.0.1";
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "AmbientToggle";

		public const string PLUGIN_NAME = "AmbientToggle";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace AmbientToggleMod
{
	[BepInPlugin("com.Toliann.AmbientToggle", "Ambient Toggle Mod", "0.0.1")]
	public class AmbientToggleMod : BaseUnityPlugin
	{
		public GameObject targetObject;

		private void Awake()
		{
			AmbientToggleConfig.Init(((BaseUnityPlugin)this).Config);
			if ((Object)(object)targetObject == (Object)null)
			{
				targetObject = GameObject.Find("AmbientObject");
			}
			if ((Object)(object)targetObject != (Object)null)
			{
				targetObject.SetActive(AmbientToggleConfig.AmbientEnabled.Value);
				((BaseUnityPlugin)this).Logger.LogInfo((object)("AmbientToggleMod: Object '" + ((Object)targetObject).name + "' is now " + (AmbientToggleConfig.AmbientEnabled.Value ? "active" : "inactive") + "."));
			}
			else
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)"AmbientToggleMod: Target object not found!");
			}
		}
	}
}

SfDesat/NightSky.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NightSky")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Test")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NightSky")]
[assembly: AssemblyTitle("NightSky")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
[BepInPlugin("NightSkyPlugin", "Night Sky Plugin", "1.0.0")]
public class NightSkyPlugin : BaseUnityPlugin
{
	private NightSkyController nightSkyController;

	private void Awake()
	{
		Debug.Log((object)"Nightsky loaded");
	}
}
public class NightSkyController : MonoBehaviour
{
	[Header("On Planet Settings")]
	public float starBrightness = 6f;

	[Header("In Space Settings")]
	public bool movePlanetOnly;

	public bool inSpace;

	public Vector3 sunRotateVector = new Vector3(0.002f, 0f, 0f);

	public Vector3 moonRotateVector = new Vector3(0.002f, 0f, 0f);

	public Vector3 planetRotateVector = new Vector3(0f, 0f, -0.002f);

	[Space]
	public float orbitHeight = 80000f;

	public float planetRadius = 6378100f;

	public Cubemap planetTexture;

	[Header("References")]
	public GameObject sun;

	public GameObject moon;

	[Space]
	public Volume stormySkyVolume;

	public Volume eclipsedSkyVolume;

	public Volume clearSkyVolume;

	private PhysicallyBasedSky sky;

	public void Awake()
	{
		SetSettings();
	}

	private void OnValidate()
	{
		SetSettings();
	}

	private void FixedUpdate()
	{
		if (inSpace)
		{
			SpaceSimulation();
		}
		else if (!inSpace)
		{
			((VolumeParameter<float>)(object)sky.spaceEmissionMultiplier).value = starBrightness;
		}
	}

	public void Update()
	{
	}

	public void SetSettings()
	{
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)clearSkyVolume != (Object)null)
		{
			clearSkyVolume.profile.TryGet<PhysicallyBasedSky>(ref sky);
		}
		else if ((Object)(object)stormySkyVolume != (Object)null)
		{
			stormySkyVolume.profile.TryGet<PhysicallyBasedSky>(ref sky);
		}
		else if ((Object)(object)stormySkyVolume != (Object)null)
		{
			eclipsedSkyVolume.profile.TryGet<PhysicallyBasedSky>(ref sky);
		}
		else
		{
			Debug.LogError((object)"[Night Sky] No Volumes where found");
		}
		if (inSpace)
		{
			((VolumeParameter<Texture>)(object)sky.groundColorTexture).value = (Texture)(object)planetTexture;
			((VolumeParameter<Texture>)(object)sky.groundEmissionTexture).value = (Texture)(object)planetTexture;
			((VolumeParameter<float>)(object)sky.planetaryRadius).value = planetRadius;
			((VolumeParameter<Vector3>)(object)sky.planetCenterPosition).value = new Vector3(0f, 0f - (((VolumeParameter<float>)(object)sky.planetaryRadius).value + orbitHeight), 0f);
		}
	}

	private void SpaceSimulation()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		Vector3Parameter planetRotation = sky.planetRotation;
		((VolumeParameter<Vector3>)(object)planetRotation).value = ((VolumeParameter<Vector3>)(object)planetRotation).value + planetRotateVector;
		if (!movePlanetOnly)
		{
			if ((Object)(object)moon != (Object)null)
			{
				moon.transform.Rotate(moonRotateVector);
			}
			sun.transform.Rotate(sunRotateVector);
			Vector3Parameter spaceRotation = sky.spaceRotation;
			((VolumeParameter<Vector3>)(object)spaceRotation).value = ((VolumeParameter<Vector3>)(object)spaceRotation).value + planetRotateVector;
		}
	}
}