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 MapStation.Common.Runtime;
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("BRC_BigShellOOO")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BRC_BigShellOOO")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("2384fb7a-62f7-4ea9-a34f-8a97d6dc9122")]
[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("ooo.BigShellOptionsOOO", "BigShellOptionsOOO", "1.0.0")]
public class BigShellOptionsOOO : BaseUnityPlugin
{
[CompilerGenerated]
private sealed class <OnBScene>d__8 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public BigShellOptionsOOO <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <OnBScene>d__8(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<>4__this.model = GameObject.Find("BS");
<>4__this.model2 = GameObject.Find("BS2");
<>4__this.meshes = ((Component)<>4__this.model.transform).GetComponentsInChildren<MeshRenderer>();
<>4__this.meshes2 = ((Component)<>4__this.model2.transform).GetComponentsInChildren<MeshRenderer>();
<>4__this.UpdateShaders();
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private const string TARGET_SCENE = "Scene.ooo.bigshell";
private bool isOnBS;
private GameObject model;
private GameObject model2;
private MeshRenderer[] meshes;
private MeshRenderer[] meshes2;
private void Awake()
{
MapOptions.OnMapOptionsChanged = (Action)Delegate.Combine(MapOptions.OnMapOptionsChanged, new Action(OnMapOptionsChanged));
SceneManager.sceneLoaded += OnSceneLoaded;
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
isOnBS = false;
if (((Scene)(ref scene)).name == "Scene.ooo.bigshell")
{
Debug.Log((object)"BigShell Scene Loadedddd");
isOnBS = true;
((MonoBehaviour)this).StartCoroutine(OnBScene());
}
}
[IteratorStateMachine(typeof(<OnBScene>d__8))]
private IEnumerator OnBScene()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <OnBScene>d__8(0)
{
<>4__this = this
};
}
private void OnMapOptionsChanged()
{
if (isOnBS)
{
UpdateShaders();
}
}
private void UpdateShaders()
{
meshes = ((Component)model.transform).GetComponentsInChildren<MeshRenderer>();
meshes2 = ((Component)model2.transform).GetComponentsInChildren<MeshRenderer>();
Shader val = null;
Shader val2 = null;
if (Object.op_Implicit((Object)(object)GameObject.Find("ShaderSwapByooo")))
{
val = ((Renderer)GameObject.Find("Shader1").GetComponent<MeshRenderer>()).material.shader;
val2 = ((Renderer)GameObject.Find("Shader2").GetComponent<MeshRenderer>()).material.shader;
}
else
{
val = ((Renderer)GameObject.Find("Shader3").GetComponent<MeshRenderer>()).material.shader;
val2 = ((Renderer)GameObject.Find("Shader4").GetComponent<MeshRenderer>()).material.shader;
}
for (int i = 0; i < meshes.Length; i++)
{
((Renderer)meshes[i]).material.shader = val;
}
for (int j = 0; j < meshes2.Length; j++)
{
((Renderer)meshes2[j]).material.shader = val2;
}
}
}