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.guttertankcolors", "Guttertank Color Mod", "1.2.0")]
public class GuttertankColorMod : BaseUnityPlugin
{
private static readonly List<Color> possibleColors = new List<Color>
{
Color.white,
new Color(0f, 0.4f, 0.8f),
Color.green,
new Color(0f, 1f, 1f)
};
private readonly HashSet<GameObject> coloredEnemies = new HashSet<GameObject>();
private void Start()
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"Guttertank Color Mod 1.2.0 załadowany!");
}
private void Update()
{
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
GameObject[] array = Object.FindObjectsOfType<GameObject>();
foreach (GameObject val in array)
{
if (((Object)val).name.Contains("Guttertank") && !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)$"Przeciwnik {((Object)val).name} ma kolor: R={val2.r:F2} G={val2.g:F2} B={val2.b:F2}");
}
}
}
}
}