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.Logging;
using HarmonyLib;
using MaskToggle.Patches;
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: AssemblyCompany("MaskToggle")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Mask Toggle")]
[assembly: AssemblyTitle("MaskToggle")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.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 MaskToggle
{
[BepInPlugin("ro.wolftech.dogle.masktoggle", "Mask Toggle", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Logger;
private void Awake()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
new Harmony("ro.wolftech.dogle.masktoggle").PatchAll(typeof(MaskPatches));
Logger = ((BaseUnityPlugin)this).Logger;
Logger.LogInfo((object)"Plugin Mask Toggle is loaded!");
}
}
public static class PluginInformation
{
public const string GUID = "ro.wolftech.dogle.masktoggle";
public const string Name = "Mask Toggle";
public const string Version = "1.0.0";
}
}
namespace MaskToggle.Patches
{
public static class MaskPatches
{
private const float TimeForGoAway = 1f;
[HarmonyPatch(typeof(DEN_Mask), "Update")]
[HarmonyPostfix]
public static void UpdatePost(ref DEN_Mask __instance, ref float ___sightTime, ref float ___attackTimer, ref bool ___active)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
if (___attackTimer != 99999.99f)
{
___attackTimer = 99999.99f;
}
if (___sightTime > 1f)
{
if (___active)
{
___active = false;
}
MeshRenderer componentInChildren = ((Component)__instance).GetComponentInChildren<MeshRenderer>();
float num = Mathf.MoveTowards(((Renderer)componentInChildren).material.color.a, 0f, 1f * Time.deltaTime);
((Renderer)componentInChildren).material.color = new Color(1f, 1f, 1f, num);
if (num <= 0f)
{
Object.Destroy((Object)(object)((Component)__instance).gameObject);
}
}
}
}
}