Decompiled source of GravityChanger v1.0.0

GravityChanger.dll

Decompiled 2 years ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
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("GravityChanger")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GravityChanger")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("729527f1-0a06-423b-97b8-704d7fcb90c9")]
[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")]
namespace GravityChanger;

[BepInPlugin("com.AquaEther.GravityChanger", "GravityChanger", "1.0.0")]
public class GravityChangerPlugin : BaseUnityPlugin
{
	private const string MyGUID = "com.AquaEther.GravityChanger";

	private const string PluginName = "GravityChanger";

	private const string VersionString = "1.0.0";

	public static ManualLogSource Log = new ManualLogSource("GravityChanger");

	public ConfigEntry<int> bodyMassConfig;

	public Rigidbody body;

	public GameObject player;

	public void Awake()
	{
		bodyMassConfig = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Player Mass", 100, "Put the mass lower to have less gravity");
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: GravityChanger, VersionString: 1.0.0 is loaded.");
		Log = ((BaseUnityPlugin)this).Logger;
		SceneManager.sceneLoaded -= OnSceneLoaded;
		SceneManager.sceneLoaded += OnSceneLoaded;
	}

	public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		if (((Scene)(ref scene)).name == "b3e7f2f8052488a45b35549efb98d902")
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"menu has no player");
			return;
		}
		player = GameObject.Find("Player");
		if ((Object)(object)player == (Object)null)
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"no player found");
			return;
		}
		body = player.GetComponent<Rigidbody>();
		body.mass = bodyMassConfig.Value;
	}

	private void Update()
	{
	}
}