Due to update 2.4.3, some mods may no longer function. FixedConfig may be necessary.
Decompiled source of SpawnPlatforms v1.0.0
SpawnPlatforms.dll
Decompiled 6 months agousing 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 BoplFixedMath; using Microsoft.CodeAnalysis; using PlatformApi; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")] [assembly: AssemblyCompany("MyFirstBoplPlugin")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("My first plugin")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MyFirstBoplPlugin")] [assembly: AssemblyTitle("MyFirstBoplPlugin")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 MyFirstBoplPlugin { [BepInPlugin("com.SashaAnt.SpawnPlatforms", "SpawnPlatforms", "1.0.0")] public class Plugin : BaseUnityPlugin { public static class PluginInfo { public const string PLUGIN_GUID = "SpawnPlatforms"; public const string PLUGIN_NAME = "SpawnPlatforms"; public const string PLUGIN_VERSION = "1.0.0"; } private GameObject uiTextObject = new GameObject("MyText"); private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin SpawnPlatforms is loaded!"); } private void Update() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (((ButtonControl)Keyboard.current[(Key)19]).wasPressedThisFrame) { Vector2 val = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); if (val.x >= 0f && val.x <= (float)Screen.width && val.y >= 0f && val.y <= (float)Screen.height) { SpawnPlatform(val); } } if (((ButtonControl)Keyboard.current[(Key)31]).wasPressedThisFrame) { Vector2 val2 = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); if (val2.x >= 0f && val2.x <= (float)Screen.width && val2.y >= 0f && val2.y <= (float)Screen.height) { SpawnBoulder(val2); } } } private void SpawnPlatform(Vector2 mousePos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) try { Vector3 val = Camera.current.ScreenToWorldPoint(Vector2.op_Implicit(mousePos)); val.z = 0f; Vector3 val2 = GameObject.Find("PlayerList").transform.InverseTransformPoint(val); Debug.Log((object)"Spawned a platform"); PlatformApi.SpawnPlatform((Fix)val2.x, (Fix)val2.y, (Fix)2L, (Fix)2L, (Fix)2L, (Fix)1.5708f, 0.05, (Vector4[])null, (PlatformType)5, false, (Sprite)null, (PathType)0, 1.0, (Vec2[])null, 1.0, 100.0, 100.0, (Vec2[])null, 1.0, 1.0, 1.0, 5.0, 1.0); } catch { } } private void SpawnBoulder(Vector2 mousePos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0049: 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_0054: 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) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) try { Vector3 val = Camera.current.ScreenToWorldPoint(Vector2.op_Implicit(mousePos)); val.z = 0f; Vector3 val2 = GameObject.Find("PlayerList").transform.InverseTransformPoint(val); Vec2 val3 = default(Vec2); val3.y = (Fix)val2.y; val3.x = (Fix)val2.x; Debug.Log((object)"Spawned a boulder"); PlatformApi.SpawnBoulder(val3, (Fix)1L, (PlatformType)5, Color.cyan, (Sprite)null); } catch { } } } public static class PluginInfo { public const string PLUGIN_GUID = "MyFirstBoplPlugin"; public const string PLUGIN_NAME = "MyFirstBoplPlugin"; public const string PLUGIN_VERSION = "1.0.0"; } }