Decompiled source of FunnyCosmetics v2.0.3

CosmeticStuff.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using GameNetcodeStuff;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("CosmeticStuff")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+ca12068bde3bdf94a84a8ded3e81bdaefded2f21")]
[assembly: AssemblyProduct("CosmeticStuff")]
[assembly: AssemblyTitle("CosmeticStuff")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace CosmeticStuff
{
	[BepInPlugin("MagicWesley.Cosmeticstuff", "Cosmeticstuff", "0.0.1")]
	public class Cosmetic : BaseUnityPlugin
	{
		private void Awake()
		{
		}
	}
}
namespace CosmeticStuff.CosmeticStuff
{
	internal class ProstheticArm : MonoBehaviour
	{
		[Header("Prosthetic cosmetic pieces")]
		[SerializeField]
		private GameObject P_shoulder_L;

		[SerializeField]
		private GameObject P_arm_L_upper;

		[SerializeField]
		private GameObject P_arm_L_lower;

		[SerializeField]
		private GameObject P_hand_L;

		[SerializeField]
		private GameObject P_finger1_L;

		[SerializeField]
		private GameObject P_finger1_L_001;

		[SerializeField]
		private GameObject P_finger2_L;

		[SerializeField]
		private GameObject P_finger2_L_001;

		[SerializeField]
		private GameObject P_finger3_L;

		[SerializeField]
		private GameObject P_finger3_L_001;

		[SerializeField]
		private GameObject P_finger4_L;

		[SerializeField]
		private GameObject P_finger4_L_001;

		[SerializeField]
		private GameObject P_finger5_L;

		[SerializeField]
		private GameObject P_finger5_L_001;

		private void Awake()
		{
			InstantiateCosmeticList();
		}

		private void InstantiateCosmeticList()
		{
			GameObject gameObject = ((Component)((Component)this).transform.parent).gameObject;
			Debug.Log((object)((Object)gameObject).name);
			GameObject gameObject2 = ((Component)gameObject.transform.Find("shoulder_L")).gameObject;
			GameObject gameObject3 = ((Component)gameObject2.transform.Find("arm_L_upper")).gameObject;
			GameObject gameObject4 = ((Component)gameObject3.transform.Find("arm_L_lower")).gameObject;
			GameObject gameObject5 = ((Component)gameObject4.transform.Find("hand_L")).gameObject;
			GameObject gameObject6 = ((Component)gameObject5.transform.Find("finger1_L")).gameObject;
			GameObject gameObject7 = ((Component)gameObject6.transform.Find("finger1_L_001")).gameObject;
			GameObject gameObject8 = ((Component)gameObject5.transform.Find("finger2_L")).gameObject;
			GameObject gameObject9 = ((Component)gameObject8.transform.Find("finger2_L_001")).gameObject;
			GameObject gameObject10 = ((Component)gameObject5.transform.Find("finger3_L")).gameObject;
			GameObject gameObject11 = ((Component)gameObject10.transform.Find("finger3_L_001")).gameObject;
			GameObject gameObject12 = ((Component)gameObject5.transform.Find("finger4_L")).gameObject;
			GameObject gameObject13 = ((Component)gameObject12.transform.Find("finger4_L_001")).gameObject;
			GameObject gameObject14 = ((Component)gameObject5.transform.Find("finger5_L")).gameObject;
			GameObject gameObject15 = ((Component)gameObject14.transform.Find("finger5_L_001")).gameObject;
			InstantiateCosmeticPiece(gameObject2, P_shoulder_L);
			InstantiateCosmeticPiece(gameObject3, P_arm_L_upper);
			InstantiateCosmeticPiece(gameObject4, P_arm_L_lower);
			InstantiateCosmeticPiece(gameObject5, P_hand_L);
			InstantiateCosmeticPiece(gameObject6, P_finger1_L);
			InstantiateCosmeticPiece(gameObject7, P_finger1_L_001);
			InstantiateCosmeticPiece(gameObject8, P_finger2_L);
			InstantiateCosmeticPiece(gameObject9, P_finger2_L_001);
			InstantiateCosmeticPiece(gameObject10, P_finger3_L);
			InstantiateCosmeticPiece(gameObject11, P_finger3_L_001);
			InstantiateCosmeticPiece(gameObject12, P_finger4_L);
			InstantiateCosmeticPiece(gameObject13, P_finger4_L_001);
			InstantiateCosmeticPiece(gameObject14, P_finger5_L);
			InstantiateCosmeticPiece(gameObject15, P_finger5_L_001);
		}

		private void InstantiateCosmeticPiece(GameObject bone, GameObject cosmetic)
		{
			if ((Object)(object)cosmetic != (Object)null)
			{
				Object.Instantiate<GameObject>(cosmetic, bone.transform);
			}
		}
	}
	public class WebleyLegsAnimationController : MonoBehaviour
	{
		public Animator LegsAnimator;

		private PlayerControllerB player;

		private void Awake()
		{
			player = ((Component)this).GetComponentInParent<PlayerControllerB>();
		}

		private void Update()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player == (Object)null)
			{
				player = ((Component)this).GetComponentInParent<PlayerControllerB>();
				return;
			}
			AnimatorStateInfo currentAnimatorStateInfo = player.playerBodyAnimator.GetCurrentAnimatorStateInfo(0);
			AnimatorStateInfo currentAnimatorStateInfo2 = player.playerBodyAnimator.GetCurrentAnimatorStateInfo(1);
			bool value = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("CrouchWalk") || ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("CrouchIdle") || ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("CrouchDown");
			bool value2 = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Sprint");
			bool value3 = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Jump") || ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("FallNoJump");
			bool value4 = ((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).IsName("Dance2") && player.performingEmote;
			bool value5 = ((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).IsName("Dance1") && player.performingEmote;
			UpdateAnimBool("crouched", value);
			UpdateAnimBool("running", value2);
			UpdateAnimBool("jumping", value3);
			UpdateAnimBool("pointing", value4);
			UpdateAnimBool("dancing", value5);
		}

		private void UpdateAnimBool(string boolName, bool value)
		{
			if (LegsAnimator.GetBool(boolName) != value)
			{
				LegsAnimator.SetBool(boolName, value);
			}
		}
	}
}