Decompiled source of RGB Flashlight KM v1.0.0

repo new mode.dll

Decompiled 7 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("repo new mode")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("repo new mode")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("20542cfe-95ab-41a2-bf4f-c86be5adb762")]
[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("com.yassine.lightrgb", "Flashlight RGB", "1.0.0")]
public class RGBController : BaseUnityPlugin
{
	private bool isRGBActive = false;

	private float colorSpeed = 2f;

	private void Update()
	{
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)282))
		{
			isRGBActive = !isRGBActive;
			((BaseUnityPlugin)this).Logger.LogInfo((object)("Light RGB Status: " + isRGBActive));
		}
		if (isRGBActive)
		{
			float num = Time.time * colorSpeed % 1f;
			Color val = Color.HSVToRGB(num, 1f, 1f);
			Light[] array = Object.FindObjectsOfType<Light>();
			Light[] array2 = array;
			foreach (Light val2 in array2)
			{
				if (((Object)val2).name.ToLower().Contains("flashlight") || ((Object)val2).name.ToLower().Contains("player"))
				{
					val2.color = val;
					val2.intensity = 2f;
				}
			}
			RenderSettings.ambientLight = val * 0.2f;
		}
		else
		{
			RenderSettings.ambientLight = Color.black;
		}
	}
}