using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("deleteHandholds")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("deleteHandholds")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8a86f051-e9b7-4b61-a9c3-30c9580ebd1d")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.example.no_handholds", "No handholds Mod", "1.0")]
public class RemoveAsset : BaseUnityPlugin
{
[HarmonyPatch(typeof(SceneManager), "Internal_SceneLoaded")]
private class SceneLoadPatch
{
private static void Postfix(Scene scene, LoadSceneMode mode)
{
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Expected O, but got Unknown
Debug.Log((object)("Scene loaded: " + ((Scene)(ref scene)).name));
if (((Scene)(ref scene)).name == "Game-Main" && !loopStarted)
{
loopStarted = true;
Log.LogInfo((object)"Handhold destroy loop started");
GameObject val = new GameObject("DestroyRunner");
Object.DontDestroyOnLoad((Object)(object)val);
MonoBehaviourRunner monoBehaviourRunner = val.AddComponent<MonoBehaviourRunner>();
((MonoBehaviour)monoBehaviourRunner).StartCoroutine(DestroyLoop());
}
}
}
[CompilerGenerated]
private sealed class <DestroyLoop>d__3 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
private GameObject[] <>s__1;
private int <>s__2;
private GameObject <obj>5__3;
private string <name>5__4;
private MeshRenderer <renderer>5__5;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <DestroyLoop>d__3(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>s__1 = null;
<obj>5__3 = null;
<name>5__4 = null;
<renderer>5__5 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
break;
case 1:
<>1__state = -1;
break;
}
<>s__1 = Object.FindObjectsOfType<GameObject>();
for (<>s__2 = 0; <>s__2 < <>s__1.Length; <>s__2++)
{
<obj>5__3 = <>s__1[<>s__2];
<name>5__4 = ((Object)<obj>5__3).name.ToLower();
<renderer>5__5 = <obj>5__3.GetComponent<MeshRenderer>();
if (<name>5__4.Contains("handhold") && !<name>5__4.StartsWith("item") && !<name>5__4.Contains("Elevator") && (Object)(object)<renderer>5__5 != (Object)null && ((Renderer)<renderer>5__5).enabled)
{
Object.Destroy((Object)(object)<obj>5__3);
}
<name>5__4 = null;
<renderer>5__5 = null;
<obj>5__3 = null;
}
<>s__1 = null;
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 1;
return true;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
internal static ManualLogSource Log;
private static bool loopStarted;
private void Awake()
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
Log = ((BaseUnityPlugin)this).Logger;
((BaseUnityPlugin)this).Logger.LogInfo((object)"RemoveAsset loaded");
Harmony val = new Harmony("com.example.removeasset");
val.PatchAll();
}
[IteratorStateMachine(typeof(<DestroyLoop>d__3))]
private static IEnumerator DestroyLoop()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <DestroyLoop>d__3(0);
}
}
public class MonoBehaviourRunner : MonoBehaviour
{
}