Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of REPOCartDecorations v1.0.1
REPO Cart Decorations.dll
Decompiled a year agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using REPO_Cart_Decorations.Patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("REPO Cart Decorations")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("REPO Cart Decorations")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c2c4132e-3771-472d-a673-2d97a3bd837d")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace REPO_Cart_Decorations { public class CartXMasLightController : MonoBehaviour { [CompilerGenerated] private sealed class <BlinkLight>d__6 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public int index; public CartXMasLightController <>4__this; private float <blinkTime>5__1; private bool <isOn>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BlinkLight>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } <blinkTime>5__1 = Random.Range(<>4__this.minBlinkTime, <>4__this.maxBlinkTime); <isOn>5__2 = Random.value > 0.5f; if ((Object)(object)<>4__this.materials[index] != (Object)null) { if (<isOn>5__2) { <>4__this.materials[index].EnableKeyword("_EMISSION"); } else { <>4__this.materials[index].DisableKeyword("_EMISSION"); } } <>2__current = (object)new WaitForSeconds(<blinkTime>5__1); <>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(); } } public List<GameObject> lights = new List<GameObject>(); public float minBlinkTime = 0.3f; public float maxBlinkTime = 1.5f; private Material[] materials; public bool hasTriggered = false; public void SetUp() { Debug.Log((object)"Got here"); if (hasTriggered) { return; } for (int i = 0; i < ((Component)this).transform.childCount; i++) { lights.Add(((Component)((Component)this).transform.GetChild(i)).gameObject); } materials = (Material[])(object)new Material[lights.Count]; for (int j = 0; j < lights.Count; j++) { Renderer component = lights[j].GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { materials[j] = component.material; } ((MonoBehaviour)this).StartCoroutine(BlinkLight(j)); hasTriggered = true; } } [IteratorStateMachine(typeof(<BlinkLight>d__6))] private IEnumerator BlinkLight(int index) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BlinkLight>d__6(0) { <>4__this = this, index = index }; } } [BepInPlugin("REPOCartDecos.Core", "REPO Cart Decos", "1.0.0")] public class REPOCartDecorations : BaseUnityPlugin { private const string modGUID = "REPOCartDecos.Core"; private const string modName = "REPO Cart Decos"; private const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("REPOCartDecos.Core"); private static REPOCartDecorations instance; private void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"REPO Cart Decos was awaken"); try { harmony.PatchAll(typeof(REPOCartDecorations)); harmony.PatchAll(typeof(PhysGrabCartBPatch)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Patching successful!"); } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Harmony patching failed: {arg}"); } } } } namespace REPO_Cart_Decorations.Patches { [HarmonyPatch(typeof(PhysGrabCart), "Start")] internal class PhysGrabCartBPatch { public static bool foundCart; public static bool spawnedDeco; public static AssetBundle bundle; [HarmonyPatch("Start")] [HarmonyPostfix] private static void PatchCart() { //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) if (foundCart && spawnedDeco) { return; } string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string text = Path.Combine(directoryName, "repocartdecorations"); Debug.Log((object)("[REPOCartDecoLogger] Looking for AssetBundle at: " + text)); if (!File.Exists(text)) { Debug.LogError((object)("[REPOCartDecoLogger] AssetBundle NOT FOUND at path: " + text)); return; } bundle = AssetBundle.LoadFromFile(text); if ((Object)(object)bundle == (Object)null) { Debug.LogError((object)"[REPOCartDecoLogger] Failed to load AssetBundle!"); return; } GameObject val = bundle.LoadAsset<GameObject>("Cart XMas Lights"); if ((Object)(object)val == (Object)null) { Debug.LogError((object)"[REPOCartDecoLogger] Cart prefab was NOT loaded! Check asset name."); return; } Debug.Log((object)"[REPOCartDecoLogger] Cart prefab successfully loaded!"); GameObject val2 = GameObject.Find("Item Cart Medium(Clone)"); if ((Object)(object)val2 == (Object)null) { Debug.LogError((object)"[REPOCartDecoLogger] GameObject 'Item Cart Medium(Clone)' NOT found in scene!"); return; } foundCart = true; if (!spawnedDeco) { GameObject val3 = Object.Instantiate<GameObject>(val); val3.transform.SetParent(val2.transform, false); val3.transform.localPosition = new Vector3(0f, 0.033f, 0f); val3.transform.localRotation = Quaternion.identity; CartXMasLightController cartXMasLightController = val3.AddComponent<CartXMasLightController>(); if ((Object)(object)cartXMasLightController == (Object)null) { Debug.LogError((object)"The Light Controller component is null!"); } if ((Object)(object)cartXMasLightController != (Object)null) { Debug.Log((object)"Cart controller found!"); cartXMasLightController.SetUp(); } else { Debug.LogError((object)"Cart controller NOT found!"); } Debug.Log((object)"[REPOCartDecoLogger] Custom object instantiated and parented."); spawnedDeco = true; } } } }