Mods/Bald.dll

Decompiled 4 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Bald;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.Players;
using Il2CppRUMBLE.Utilities;
using Il2CppSystem.Collections.Generic;
using MelonLoader;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Class1), "Bald", "1.0.0", "PeppaStone", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 255, 51, 238)]
[assembly: AssemblyTitle("Bald")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Bald")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6c4be426-7d07-4026-b460-30e4efaf893a")]
[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 Bald;

public class Class1 : MelonMod
{
	private string currentScene = "";

	private bool init = true;

	private int timer = 0;

	private int playerAmount = 0;

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		currentScene = sceneName;
		if (sceneName != "Loader")
		{
			timer = 0;
			init = false;
		}
	}

	public override void OnFixedUpdate()
	{
		if (!init)
		{
			if (timer >= 10)
			{
				playerAmount = Singleton<PlayerManager>.instance.AllPlayers.Count;
				RemoveHair();
				init = true;
			}
			else
			{
				timer++;
			}
		}
		else if (currentScene == "Park" && playerAmount != Singleton<PlayerManager>.instance.AllPlayers.Count)
		{
			RemoveHair();
			playerAmount = Singleton<PlayerManager>.instance.AllPlayers.Count;
		}
	}

	public void RemoveHair()
	{
		List<Player> allPlayers = Singleton<PlayerManager>.instance.AllPlayers;
		for (int i = 1; i < allPlayers.Count; i++)
		{
			((Component)((Component)allPlayers[i].Controller).transform.GetChild(6).GetChild(3)).gameObject.active = false;
		}
	}
}