Decompiled source of Peachs Castle Level Mod v0.3.0
SkyDynamicPlatforms.dll
Decompiled 3 months agousing 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 Photon.Pun; 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("SkyDynamicPlatforms")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SkyDynamicPlatforms")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("74eb5aae-2b80-4e14-b616-24649964c125")] [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("com.skydynamicplatforms", "Sky-DynamicPlatforms", "1.0.0")] public class SkyDynamicPlatformsPlugin : BaseUnityPlugin { internal static ManualLogSource log; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown log = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("com.skyshrinkplatform"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Sky Shrink Platform Mod loaded."); } } public class SkyDynamicPlatform : MonoBehaviourPun { [CompilerGenerated] private sealed class <MoveSegment>d__28 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Vector3 from; public Vector3 to; public float speed; public int arrivedIndex; public SkyDynamicPlatform <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <MoveSegment>d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (Vector3.Distance(((Component)<>4__this).transform.position, to) > 0.01f) { ((Component)<>4__this).transform.position = Vector3.MoveTowards(((Component)<>4__this).transform.position, to, speed * Time.deltaTime); <>2__current = null; <>1__state = 1; return true; } ((Component)<>4__this).transform.position = to; <>4__this.currentIndex = arrivedIndex; if (GameManager.instance.gameMode == 0) { <>4__this.OnArrivedAtWaypoint_SP(); } else if (PhotonNetwork.IsMasterClient) { <>4__this.OnArrivedAtWaypoint_Master(); } 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(); } } [CompilerGenerated] private sealed class <RotateRoutine>d__29 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public SkyDynamicPlatform <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RotateRoutine>d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } ((Component)<>4__this).transform.Rotate(<>4__this.rotationAxis, <>4__this.rotationSpeed * Time.deltaTime, (Space)1); <>2__current = null; <>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(); } } [Header("Waypoints (optional children)")] public List<Transform> waypoints = new List<Transform>(); [Header("Movement")] public bool enableMovement = true; public float moveSpeed = 2f; public bool waitForPlayer = true; [Header("Rotation")] public bool enableRotation = false; public Vector3 rotationAxis = Vector3.up; public float rotationSpeed = 45f; private readonly List<Vector3> points = new List<Vector3>(); private int currentIndex = 0; private int dir = 1; private bool playerOnPlatform = false; private bool isMoving = false; private bool mustReturnHome = false; private Coroutine moveRoutine; private Coroutine rotateRoutine; private void Start() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) points.Clear(); points.Add(((Component)this).transform.position); foreach (Transform waypoint in waypoints) { if ((Object)(object)waypoint != (Object)null) { points.Add(waypoint.position); ((Component)waypoint).gameObject.SetActive(false); } } if (enableMovement && points.Count < 2) { Debug.LogWarning((object)("[" + ((Object)this).name + "] Not enough waypoints to move. Need at least 1 waypoint plus start.")); enableMovement = false; } if (GameManager.instance.gameMode == 0) { if (enableMovement && !waitForPlayer) { StartNextLegLocal(); } if (enableRotation && !waitForPlayer) { StartRotationLocal(); } } else if (PhotonNetwork.IsMasterClient) { if (enableMovement && !waitForPlayer) { ((MonoBehaviourPun)this).photonView.RPC("StartNextLegRPC", (RpcTarget)0, new object[4] { currentIndex, currentIndex + dir, moveSpeed, dir }); } if (enableRotation && !waitForPlayer) { ((MonoBehaviourPun)this).photonView.RPC("StartRotationRPC", (RpcTarget)0, new object[2] { rotationSpeed, rotationAxis }); } } } private void OnTriggerEnter(Collider other) { if (!((Component)other).CompareTag("Player")) { return; } if (GameManager.instance.gameMode == 0) { playerOnPlatform = true; if (enableMovement && waitForPlayer && !isMoving) { StartNextLegLocal(); } if (enableRotation && rotateRoutine == null) { StartRotationLocal(); } } else { ((MonoBehaviourPun)this).photonView.RPC("SetPlayerOnPlatformRPC", (RpcTarget)2, new object[1] { true }); } } private void OnTriggerExit(Collider other) { if (!((Component)other).CompareTag("Player")) { return; } if (GameManager.instance.gameMode == 0) { playerOnPlatform = false; if (enableMovement && waitForPlayer) { mustReturnHome = true; } } else { ((MonoBehaviourPun)this).photonView.RPC("SetPlayerOnPlatformRPC", (RpcTarget)2, new object[1] { false }); } } [PunRPC] private void SetPlayerOnPlatformRPC(bool isOn) { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } playerOnPlatform = isOn; if (!enableMovement) { return; } if (isOn) { if (waitForPlayer && !isMoving) { ((MonoBehaviourPun)this).photonView.RPC("StartNextLegRPC", (RpcTarget)0, new object[4] { currentIndex, currentIndex + dir, moveSpeed, dir }); } if (enableRotation && rotateRoutine == null) { ((MonoBehaviourPun)this).photonView.RPC("StartRotationRPC", (RpcTarget)0, new object[2] { rotationSpeed, rotationAxis }); } } else if (waitForPlayer) { mustReturnHome = true; } } [PunRPC] private void StartNextLegRPC(int fromIndex, int toIndex, float speed, int direction) { dir = direction; StartNextLegLocal(fromIndex, toIndex, speed); } [PunRPC] private void StopMovementRPC() { StopMovementLocal(); } [PunRPC] private void StartRotationRPC(float speed, Vector3 axis) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) rotationSpeed = speed; rotationAxis = axis; StartRotationLocal(); } [PunRPC] private void StopRotationRPC() { StopRotationLocal(); } private void StartNextLegLocal() { StartNextLegLocal(currentIndex, currentIndex + dir, moveSpeed); } private void StartNextLegLocal(int fromIndex, int toIndex, float speed) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (enableMovement && fromIndex >= 0 && fromIndex < points.Count && toIndex >= 0 && toIndex < points.Count) { if (moveRoutine != null) { ((MonoBehaviour)this).StopCoroutine(moveRoutine); } moveRoutine = ((MonoBehaviour)this).StartCoroutine(MoveSegment(points[fromIndex], points[toIndex], speed, toIndex)); isMoving = true; } } private void StopMovementLocal() { if (moveRoutine != null) { ((MonoBehaviour)this).StopCoroutine(moveRoutine); moveRoutine = null; } isMoving = false; } private void StartRotationLocal() { if (enableRotation && rotateRoutine == null) { rotateRoutine = ((MonoBehaviour)this).StartCoroutine(RotateRoutine()); } } private void StopRotationLocal() { if (rotateRoutine != null) { ((MonoBehaviour)this).StopCoroutine(rotateRoutine); rotateRoutine = null; } } [IteratorStateMachine(typeof(<MoveSegment>d__28))] private IEnumerator MoveSegment(Vector3 from, Vector3 to, float speed, int arrivedIndex) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <MoveSegment>d__28(0) { <>4__this = this, from = from, to = to, speed = speed, arrivedIndex = arrivedIndex }; } [IteratorStateMachine(typeof(<RotateRoutine>d__29))] private IEnumerator RotateRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RotateRoutine>d__29(0) { <>4__this = this }; } private void OnArrivedAtWaypoint_SP() { if (currentIndex == points.Count - 1) { dir = -1; } else if (currentIndex == 0) { dir = 1; } if (waitForPlayer && currentIndex == 0 && !playerOnPlatform) { mustReturnHome = false; StopMovementLocal(); StopRotationLocal(); } else if (waitForPlayer && !playerOnPlatform && mustReturnHome && currentIndex == 0) { mustReturnHome = false; StopMovementLocal(); StopRotationLocal(); } else { StartNextLegLocal(currentIndex, currentIndex + dir, moveSpeed); } } private void OnArrivedAtWaypoint_Master() { //IL_0181: Unknown result type (might be due to invalid IL or missing references) if (currentIndex == points.Count - 1) { dir = -1; } else if (currentIndex == 0) { dir = 1; } if (waitForPlayer && currentIndex == 0 && !playerOnPlatform) { mustReturnHome = false; ((MonoBehaviourPun)this).photonView.RPC("StopMovementRPC", (RpcTarget)0, Array.Empty<object>()); ((MonoBehaviourPun)this).photonView.RPC("StopRotationRPC", (RpcTarget)0, Array.Empty<object>()); return; } if (waitForPlayer && !playerOnPlatform && mustReturnHome && currentIndex == 0) { mustReturnHome = false; ((MonoBehaviourPun)this).photonView.RPC("StopMovementRPC", (RpcTarget)0, Array.Empty<object>()); ((MonoBehaviourPun)this).photonView.RPC("StopRotationRPC", (RpcTarget)0, Array.Empty<object>()); return; } ((MonoBehaviourPun)this).photonView.RPC("StartNextLegRPC", (RpcTarget)0, new object[4] { currentIndex, currentIndex + dir, moveSpeed, dir }); if (enableRotation) { ((MonoBehaviourPun)this).photonView.RPC("StartRotationRPC", (RpcTarget)0, new object[2] { rotationSpeed, rotationAxis }); } } }
SkyFlipPanelWatcher.dll
Decompiled 3 months agousing 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 Photon.Pun; 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("SkyFlipPanelWatcher")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SkyFlipPanelWatcher")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("74eb5aae-2b80-4e14-b616-24649964c125")] [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("com.skyflippanelwatcher", "Sky-FlipPanelWatcher", "1.1.0")] public class SkyFlipPanelWatcherPlugin : BaseUnityPlugin { internal static ManualLogSource log; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown log = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("com.skyflippanelwatcher"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Sky FlipPanelWatcher Mod loaded."); } } public class FlipPanelWatcher : MonoBehaviourPun { [CompilerGenerated] private sealed class <ResetSwitching>d__11 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public FlipPanel panel; public FlipPanelWatcher <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ResetSwitching>d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.375f); <>1__state = 1; return true; case 1: <>1__state = -1; panel.isSwitching = false; 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 List<FlipPanel> allPanels = new List<FlipPanel>(); public GameObject spawnSuccess; public AudioSource audioSource; public void Start() { if (GameManager.instance.gameMode == 0) { RegisterPanel(); } else if (PhotonNetwork.IsMasterClient) { ((MonoBehaviourPun)this).photonView.RPC("RegisterPanelRPC", (RpcTarget)0, Array.Empty<object>()); } } [PunRPC] public void RegisterPanelRPC() { RegisterPanel(); } public void RegisterPanel() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown foreach (Transform item in ((Component)this).transform) { Transform val = item; FlipPanel component = ((Component)val).GetComponent<FlipPanel>(); if ((Object)(object)component != (Object)null && !allPanels.Contains(component)) { allPanels.Add(component); UpdateVisuals(); } } spawnSuccess.SetActive(false); } public void CheckAllPanels() { if (PhotonNetwork.IsMasterClient) { ((MonoBehaviourPun)this).photonView.RPC("UpdateVisualsRPC", (RpcTarget)0, Array.Empty<object>()); } else if (GameManager.instance.gameMode == 0) { UpdateVisuals(); } foreach (FlipPanel allPanel in allPanels) { if (allPanel.CurrentState != FlipPanel.PanelState.Yellow) { return; } } if (PhotonNetwork.IsMasterClient) { ((MonoBehaviourPun)this).photonView.RPC("UpdateVisualsToGreenRPC", (RpcTarget)0, Array.Empty<object>()); ((MonoBehaviourPun)this).photonView.RPC("PlaySoundRPC", (RpcTarget)0, Array.Empty<object>()); } else if (GameManager.instance.gameMode == 0) { UpdateVisualsToGreen(); PlaySound(); } } [PunRPC] public void UpdateVisualsToGreenRPC() { UpdateVisualsToGreen(); } public void UpdateVisualsToGreen() { foreach (FlipPanel allPanel in allPanels) { allPanel.blueModel.SetActive(false); allPanel.yellowModel.SetActive(false); allPanel.greenModel.SetActive(true); } } [PunRPC] public void UpdateVisualsRPC() { UpdateVisuals(); } public void UpdateVisuals() { foreach (FlipPanel allPanel in allPanels) { if ((Object)(object)allPanel.blueModel != (Object)null) { allPanel.blueModel.SetActive(allPanel.CurrentState == FlipPanel.PanelState.Blue); } if ((Object)(object)allPanel.yellowModel != (Object)null) { allPanel.yellowModel.SetActive(allPanel.CurrentState == FlipPanel.PanelState.Yellow); } if ((Object)(object)allPanel.greenModel != (Object)null) { allPanel.greenModel.SetActive(allPanel.CurrentState == FlipPanel.PanelState.Green); } ((MonoBehaviour)this).StartCoroutine(ResetSwitching(allPanel)); } } [IteratorStateMachine(typeof(<ResetSwitching>d__11))] private IEnumerator ResetSwitching(FlipPanel panel) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ResetSwitching>d__11(0) { <>4__this = this, panel = panel }; } [PunRPC] public void PlaySoundRPC() { PlaySound(); } private void PlaySound() { if ((Object)(object)spawnSuccess != (Object)null) { spawnSuccess.SetActive(true); } audioSource.PlayOneShot(audioSource.clip); foreach (FlipPanel allPanel in allPanels) { Object.Destroy((Object)(object)allPanel); } Object.Destroy((Object)(object)this); } } public class FlipPanel : MonoBehaviourPun { public enum PanelState { Blue, Yellow, Green } public FlipPanelWatcher flipPanelWatcher; [HideInInspector] public PanelState CurrentState = PanelState.Blue; public GameObject blueModel; public GameObject yellowModel; public GameObject greenModel; public AudioSource audioSource; public bool isSwitching = false; public bool hasEnteredTrigger = false; private void OnTriggerEnter(Collider other) { if (((Component)other).CompareTag("Player") && !isSwitching && !hasEnteredTrigger) { hasEnteredTrigger = true; isSwitching = true; if (PhotonNetwork.IsMasterClient) { PlaySoundEffect(); SwitchPanelState(); ((MonoBehaviourPun)this).photonView.RPC("SyncStateRPC", (RpcTarget)1, new object[1] { (int)CurrentState }); flipPanelWatcher.CheckAllPanels(); } else if (GameManager.instance.gameMode == 0) { PlaySoundEffect(); SwitchPanelState(); flipPanelWatcher.CheckAllPanels(); } } } private void OnTriggerExit(Collider other) { hasEnteredTrigger = false; } [PunRPC] private void SyncStateRPC(int state) { CurrentState = (PanelState)state; } private void SwitchPanelState() { if (CurrentState != PanelState.Green) { if (CurrentState == PanelState.Blue) { CurrentState = PanelState.Yellow; } else if (CurrentState == PanelState.Yellow) { CurrentState = PanelState.Blue; } } } public void PlaySoundEffect() { if (GameManager.instance.gameMode == 0) { PlaySound(); } else if (PhotonNetwork.IsMasterClient) { ((MonoBehaviourPun)this).photonView.RPC("PlaySoundRPC", (RpcTarget)0, Array.Empty<object>()); } } [PunRPC] public void PlaySoundRPC() { PlaySound(); } private void PlaySound() { audioSource.PlayOneShot(audioSource.clip); } }
SkyOnOffSwitches.dll
Decompiled 3 months agousing System; 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 Photon.Pun; 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("SkyOnOffSwitches")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SkyOnOffSwitches")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("74eb5aae-2b80-4e14-b616-24649964c125")] [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("com.skyonoffswitches", "Sky-On-Off-Switches", "1.2.0")] public class SkyOnOffSwitchesPlugin : BaseUnityPlugin { internal static ManualLogSource log; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown log = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("com.skylevelcooldown"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Sky OnOff Switches Mod loaded."); } } public class SkyOnOffManager : MonoBehaviour { public List<GameObject> OnBlocks = new List<GameObject>(); public List<GameObject> OffBlocks = new List<GameObject>(); public List<GameObject> OnPlatforms = new List<GameObject>(); public List<GameObject> OffPlatforms = new List<GameObject>(); public List<GameObject> OnPlatformsEmpty = new List<GameObject>(); public List<GameObject> OffPlatformsEmpty = new List<GameObject>(); public bool CompletedListSetUp = false; public bool SkyIsInteractingOnOff = false; public bool SkyIsOnBlock = true; public PhotonView photonView; public static SkyOnOffManager Instance { get; private set; } private void Awake() { Instance = this; photonView = ((Component)this).GetComponent<PhotonView>(); } private void OnDestroy() { if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } } [PunRPC] public void RequestSwitchRPC(PhotonMessageInfo info) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) ManualLogSource log = SkyOnOffSwitchesPlugin.log; if (log != null) { log.LogInfo((object)("RequestSwitchRPC received from " + info.Sender.NickName)); } if (PhotonNetwork.IsMasterClient) { photonView.RPC("SwitchBlocksRPC", (RpcTarget)0, Array.Empty<object>()); } } [PunRPC] public void SwitchBlocksRPC() { ManualLogSource log = SkyOnOffSwitchesPlugin.log; if (log != null) { log.LogInfo((object)("[RPC] SwitchBlocksRPC on " + PhotonNetwork.NickName)); } SwitchBlocksLogic(); } public void SwitchBlocksLogic() { SkyIsInteractingOnOff = true; if (SkyIsOnBlock) { foreach (GameObject onBlock in OnBlocks) { onBlock.SetActive(false); } foreach (GameObject offBlock in OffBlocks) { offBlock.SetActive(true); } } else { foreach (GameObject offBlock2 in OffBlocks) { offBlock2.SetActive(false); } foreach (GameObject onBlock2 in OnBlocks) { onBlock2.SetActive(true); } } ChangePlatforms(); SkyIsOnBlock = !SkyIsOnBlock; SkyIsInteractingOnOff = false; ManualLogSource log = SkyOnOffSwitchesPlugin.log; if (log != null) { log.LogInfo((object)("Blocks switched, new state: " + (SkyIsOnBlock ? "On" : "Off"))); } } private void Update() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 if (!CompletedListSetUp && (int)LevelGenerator.Instance.State == 15 && ((Object)((Component)this).gameObject).name == "SkyOnOffManager") { CompletedListSetUp = true; if (PhotonNetwork.IsMasterClient) { photonView.RPC("SetupBlockListsRPC", (RpcTarget)0, Array.Empty<object>()); } else if (GameManager.instance.gameMode == 0) { SetupBlockLists(); } } } [PunRPC] private void SetupBlockListsRPC() { ManualLogSource log = SkyOnOffSwitchesPlugin.log; if (log != null) { log.LogInfo((object)("SetupBlockListsRPC executed on " + PhotonNetwork.NickName)); } SetupBlockLists(); } private void SetupBlockLists() { OnBlocks.Clear(); OffBlocks.Clear(); OnPlatforms.Clear(); OffPlatforms.Clear(); OnPlatformsEmpty.Clear(); OffPlatformsEmpty.Clear(); GameObject[] array = Object.FindObjectsOfType<GameObject>(); GameObject[] array2 = array; foreach (GameObject val in array2) { if (((Object)val).name == "OnBlock") { OnBlocks.Add(val); if ((Object)(object)val.GetComponent<SkyOnOffSwitches>() == (Object)null) { val.AddComponent<SkyOnOffSwitches>(); } val.SetActive(false); val.SetActive(true); } else if (((Object)val).name == "OffBlock") { OffBlocks.Add(val); if ((Object)(object)val.GetComponent<SkyOnOffSwitches>() == (Object)null) { val.AddComponent<SkyOnOffSwitches>(); } val.SetActive(false); } else if (((Object)val).name == "OnPlatform") { OnPlatforms.Add(val); } else if (((Object)val).name == "OffPlatform") { OffPlatforms.Add(val); val.SetActive(false); } else if (((Object)val).name == "OnPlatformEmpty") { OnPlatformsEmpty.Add(val); val.SetActive(false); } else if (((Object)val).name == "OffPlatformEmpty") { OffPlatformsEmpty.Add(val); val.SetActive(true); } } CompletedListSetUp = true; } private void ChangePlatforms() { if (SkyIsOnBlock) { foreach (GameObject onPlatform in OnPlatforms) { onPlatform.SetActive(false); } foreach (GameObject item in OnPlatformsEmpty) { item.SetActive(true); } foreach (GameObject offPlatform in OffPlatforms) { offPlatform.SetActive(true); } { foreach (GameObject item2 in OffPlatformsEmpty) { item2.SetActive(false); } return; } } foreach (GameObject onPlatform2 in OnPlatforms) { onPlatform2.SetActive(true); } foreach (GameObject item3 in OnPlatformsEmpty) { item3.SetActive(false); } foreach (GameObject offPlatform2 in OffPlatforms) { offPlatform2.SetActive(false); } foreach (GameObject item4 in OffPlatformsEmpty) { item4.SetActive(true); } } } public class SkyOnOffSwitches : MonoBehaviourPun { private PhysGrabObject physGrabObject; private bool requestSent = false; private AudioSource audioSource; private void Start() { physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); Transform val = ((Component)this).transform.parent.Find("Audio"); if ((Object)(object)val != (Object)null) { audioSource = ((Component)val).GetComponent<AudioSource>(); } } public void PlaySoundEffect() { if (GameManager.instance.gameMode == 0) { PlaySound(); } else if (PhotonNetwork.IsMasterClient) { ((MonoBehaviourPun)this).photonView.RPC("PlaySoundRPC", (RpcTarget)0, Array.Empty<object>()); } } [PunRPC] public void PlaySoundRPC() { PlaySound(); } private void PlaySound() { audioSource.PlayOneShot(audioSource.clip); } private void Update() { SkyOnOffManager instance = SkyOnOffManager.Instance; if ((Object)(object)instance == (Object)null || !instance.CompletedListSetUp) { return; } if (GameManager.instance.gameMode == 0) { if ((Object)(object)physGrabObject != (Object)null && physGrabObject.grabbed && !instance.SkyIsInteractingOnOff && !requestSent) { PlaySoundEffect(); instance.SwitchBlocksLogic(); requestSent = true; } else if (!physGrabObject.grabbed) { requestSent = false; } } else if ((Object)(object)physGrabObject != (Object)null && physGrabObject.grabbed && !instance.SkyIsInteractingOnOff && !requestSent) { PlaySoundEffect(); instance.photonView.RPC("RequestSwitchRPC", (RpcTarget)2, Array.Empty<object>()); requestSent = true; } else if (!physGrabObject.grabbed) { requestSent = false; } } }
SkyShrinkPlatform.dll
Decompiled 3 months agousing 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 Photon.Pun; 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("SkyShrinkPlatform")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SkyShrinkPlatform")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("74eb5aae-2b80-4e14-b616-24649964c125")] [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("com.skyshrinkplatform", "Sky-ShrinkPlatforms", "1.1.0")] public class SkyShrinkPlatformPlugin : BaseUnityPlugin { internal static ManualLogSource log; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown log = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("com.skyshrinkplatform"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Sky Shrink Platform Mod loaded."); } } public class ShrinkPlatform : MonoBehaviourPun { [CompilerGenerated] private sealed class <RespawnAfterDelay>d__14 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public ShrinkPlatform <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RespawnAfterDelay>d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.waitTime); <>1__state = 1; return true; case 1: <>1__state = -1; ((Component)<>4__this.meshCollider).gameObject.SetActive(true); ((Component)<>4__this.innerPart).gameObject.SetActive(true); <>4__this.innerPart.localScale = <>4__this.originalScale; <>4__this.isShrinking = false; 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(); } } [CompilerGenerated] private sealed class <ShrinkCoroutine>d__12 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public ShrinkPlatform <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ShrinkCoroutine>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_0084; case 1: <>1__state = -1; goto IL_0084; case 2: { <>1__state = -1; ((MonoBehaviourPun)<>4__this).photonView.RPC("RespawnPlatformRPC", (RpcTarget)0, Array.Empty<object>()); break; } IL_0084: if (<>4__this.innerPart.localScale.x > 0.01f) { Transform innerPart = <>4__this.innerPart; innerPart.localScale -= Vector3.one * <>4__this.shrinkSpeed * Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } ((Component)<>4__this.innerPart).gameObject.SetActive(false); ((Component)<>4__this.meshCollider).gameObject.SetActive(false); if (<>4__this.respawn && PhotonNetwork.IsMasterClient) { <>2__current = (object)new WaitForSeconds(<>4__this.respawnTime); <>1__state = 2; return true; } if (<>4__this.respawn && GameManager.instance.gameMode == 0) { ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.RespawnAfterDelay()); } else if (!<>4__this.respawn) { Object.Destroy((Object)(object)((Component)<>4__this.innerPart).gameObject); } break; } 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(); } } public Transform innerPart; public Transform meshCollider; public float shrinkSpeed = 1f; public bool respawn = true; public float respawnTime = 5f; public float waitTime = 2f; private bool isShrinking = false; private Vector3 originalScale; private AudioSource audioSource; private void Start() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)innerPart == (Object)null)) { Transform val = ((Component)this).transform.Find("Audio"); if ((Object)(object)val != (Object)null) { audioSource = ((Component)val).GetComponent<AudioSource>(); } originalScale = innerPart.localScale; } } private void OnTriggerEnter(Collider other) { if (!((Component)other).CompareTag("Player") || isShrinking) { return; } if (PhotonNetwork.IsMasterClient) { if (!isShrinking) { PlaySoundEffect(); ((MonoBehaviourPun)this).photonView.RPC("StartShrinkRPC", (RpcTarget)0, Array.Empty<object>()); } } else if (GameManager.instance.gameMode == 0 && !isShrinking) { PlaySoundEffect(); isShrinking = true; ((MonoBehaviour)this).StartCoroutine(ShrinkCoroutine()); } } [PunRPC] private void StartShrinkRPC() { if (!isShrinking) { isShrinking = true; ((MonoBehaviour)this).StartCoroutine(ShrinkCoroutine()); } } [IteratorStateMachine(typeof(<ShrinkCoroutine>d__12))] private IEnumerator ShrinkCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ShrinkCoroutine>d__12(0) { <>4__this = this }; } [PunRPC] private void RespawnPlatformRPC() { ((MonoBehaviour)this).StartCoroutine(RespawnAfterDelay()); } [IteratorStateMachine(typeof(<RespawnAfterDelay>d__14))] private IEnumerator RespawnAfterDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RespawnAfterDelay>d__14(0) { <>4__this = this }; } public void PlaySoundEffect() { if (GameManager.instance.gameMode == 0) { PlaySound(); } else if (PhotonNetwork.IsMasterClient) { ((MonoBehaviourPun)this).photonView.RPC("PlaySoundRPC", (RpcTarget)0, Array.Empty<object>()); } } [PunRPC] public void PlaySoundRPC() { PlaySound(); } private void PlaySound() { audioSource.PlayOneShot(audioSource.clip); } }