using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
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: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("GuttertankColorMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GuttertankColorMod")]
[assembly: AssemblyTitle("GuttertankColorMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.antek.colorfulenemies", "Colorful Enemies Mod", "2.1.0")]
public class ColorfulEnemiesMod : BaseUnityPlugin
{
private static readonly string[] targetEnemies = new string[1] { "gutterman" };
private static readonly List<Color> possibleColors = new List<Color>
{
Color.red,
Color.blue,
Color.green,
Color.yellow,
Color.cyan,
Color.magenta,
new Color(1f, 0.5f, 0f),
new Color(0.5f, 0f, 1f),
new Color(1f, 0.2f, 0.6f),
Color.white,
new Color(0.5f, 1f, 0f),
new Color(0f, 0.4f, 0.8f),
new Color(0.2f, 0.8f, 0.6f)
};
private readonly HashSet<GameObject> coloredEnemies = new HashSet<GameObject>();
private void Start()
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"Colorful Enemies Mod 2.1.0 załadowany!");
}
private void Update()
{
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
GameObject[] array = Object.FindObjectsOfType<GameObject>();
foreach (GameObject val in array)
{
string text = ((Object)val).name.ToLower();
string[] array2 = targetEnemies;
foreach (string text2 in array2)
{
if (text.Contains(text2) && !coloredEnemies.Contains(val))
{
Renderer componentInChildren = val.GetComponentInChildren<Renderer>();
if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.material != (Object)null)
{
Color val2 = possibleColors[Random.Range(0, possibleColors.Count)];
componentInChildren.material.color = val2;
coloredEnemies.Add(val);
((BaseUnityPlugin)this).Logger.LogInfo((object)$"[{text2}] {((Object)val).name} pokolorowany na RGB({val2.r:F2}, {val2.g:F2}, {val2.b:F2})");
}
}
}
}
}
}