Decompiled source of Tolian Moons v2.5.2

DLL/AmbientToggle.dll

Decompiled a month 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!");
			}
		}
	}
}

DLL/LavaEmissionMove.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
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;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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;
		}
	}
}
namespace TextureMove
{
	[BepInPlugin("com.tolian.lavaemissionmove", "LavaEmissionMove", "1.0.0")]
	public class LavaEmissionMove : BaseUnityPlugin
	{
	}
	[DisallowMultipleComponent]
	public class LavaEmissionScroller : MonoBehaviour
	{
		private sealed class LavaMaterial
		{
			public Material material;

			public int propertyId;
		}

		[Tooltip("Horizontal speed of the emission texture scroll (UV units per second).")]
		[SerializeField]
		private float speedX = 0.02f;

		[Tooltip("Vertical speed of the emission texture scroll (UV units per second).")]
		[SerializeField]
		private float speedY = 0.008f;

		private readonly List<LavaMaterial> materials = new List<LavaMaterial>();

		private bool initialized;

		private static readonly string[] EmissionTextureNames = new string[2] { "_EmissionMap", "_EmissiveColorMap" };

		private void Awake()
		{
			CollectMaterials();
			initialized = true;
		}

		private void CollectMaterials()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			materials.Clear();
			Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<Renderer>(true);
			foreach (Renderer val in componentsInChildren)
			{
				Material[] array = val.materials;
				bool flag = false;
				for (int j = 0; j < array.Length; j++)
				{
					Material val2 = array[j];
					if (!((Object)(object)val2 == (Object)null))
					{
						int num = FindEmissionTextureId(val2);
						if (num != 0)
						{
							Material material = (array[j] = new Material(val2));
							flag = true;
							materials.Add(new LavaMaterial
							{
								material = material,
								propertyId = num
							});
						}
					}
				}
				if (flag)
				{
					val.materials = array;
				}
			}
			if (materials.Count == 0)
			{
				Debug.LogWarning((object)"LavaEmissionScroller: no emission texture found on this object. Assign an emission map to the material.");
			}
		}

		private static int FindEmissionTextureId(Material material)
		{
			string[] emissionTextureNames = EmissionTextureNames;
			for (int i = 0; i < emissionTextureNames.Length; i++)
			{
				int num = Shader.PropertyToID(emissionTextureNames[i]);
				if ((Object)(object)material.GetTexture(num) != (Object)null)
				{
					return num;
				}
			}
			return 0;
		}

		private void Update()
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			if (initialized && materials.Count != 0)
			{
				float deltaTime = Time.deltaTime;
				float num = speedX * deltaTime;
				float num2 = speedY * deltaTime;
				for (int i = 0; i < materials.Count; i++)
				{
					Material material = materials[i].material;
					int propertyId = materials[i].propertyId;
					Vector2 textureOffset = material.GetTextureOffset(propertyId);
					textureOffset.x = Mathf.Repeat(textureOffset.x + num, 1f);
					textureOffset.y = Mathf.Repeat(textureOffset.y + num2, 1f);
					material.SetTextureOffset(propertyId, textureOffset);
				}
			}
		}

		private void OnDestroy()
		{
			foreach (LavaMaterial material in materials)
			{
				if ((Object)(object)material.material != (Object)null)
				{
					Object.Destroy((Object)(object)material.material);
				}
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "com.tolian.lavaemissionmove";

		public const string PLUGIN_NAME = "LavaEmissionMove";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}