Decompiled source of Sit Down Animation v0.0.1

SitEmoteMod.dll

Decompiled a month ago
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EmotesAPI;
using LethalEmotesAPI.ImportV2;
using Microsoft.CodeAnalysis;
using SitEmoteMod.Properties;
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("Lethal Company CustomEmotesAPI Template Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lethal Company CustomEmotesAPI Template Mod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("199912ba-43b6-4276-b420-7bfaa3eedbe5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[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 SitEmoteMod.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					ResourceManager resourceManager = new ResourceManager("SitEmoteMod.Properties.Resources", typeof(Resources).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal static byte[] kylieanim
		{
			get
			{
				object @object = ResourceManager.GetObject("kylieanim", resourceCulture);
				return (byte[])@object;
			}
		}

		internal Resources()
		{
		}
	}
}
namespace Lethal_Company_CustomEmotesAPI_Template_Mod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Kylie", "SitAnimation", "1.0.0")]
	public class ExampleEmoteMod : BaseUnityPlugin
	{
		public const string PluginGUID = "Kylie";

		public const string PluginName = "SitAnimation";

		public const string PluginVersion = "1.0.0";

		internal static AssetBundle Bundle;

		public static ExampleEmoteMod instance;

		public static PluginInfo PInfo { get; private set; }

		public void Awake()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			instance = this;
			PInfo = ((BaseUnityPlugin)this).Info;
			Bundle = AssetBundle.LoadFromMemory(Resources.kylieanim);
			AnimationClipParams val = new AnimationClipParams();
			ImportAnimation((AnimationClip[])(object)new AnimationClip[1] { Bundle.LoadAsset<AnimationClip>("Sit_Start") }, (AnimationClip[])(object)new AnimationClip[1] { Bundle.LoadAsset<AnimationClip>("Sit_Loop") }, looping: true, null, sync: false, "Sit", dmca: false, cantMove: true, thirdPerson: false);
			CustomEmotesAPI.animChanged += new AnimationChanged(CustomEmotesAPI_animChanged);
		}

		private void CustomEmotesAPI_animChanged(string newAnimation, BoneMapper mapper)
		{
			if (newAnimation.StartsWith("Kylie"))
			{
				newAnimation = newAnimation.Split("__")[1];
			}
		}

		public void ImportAnimation(AnimationClip[] primaryClips, AnimationClip[] secondaryClips, bool looping, AudioClip[] primaryAudioClips, bool sync, string customName, bool dmca, bool cantMove, bool thirdPerson)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			CustomEmoteParams val = new CustomEmoteParams();
			val.primaryAnimationClips = primaryClips;
			val.secondaryAnimationClips = secondaryClips;
			val.audioLoops = looping;
			val.primaryAudioClips = primaryAudioClips;
			val.secondaryAudioClips = null;
			val.primaryDMCAFreeAudioClips = null;
			val.secondaryDMCAFreeAudioClips = null;
			val.visible = true;
			val.syncAnim = sync;
			val.syncAudio = sync;
			val.startPref = -1;
			val.joinPref = -1;
			val.joinSpots = null;
			val.internalName = "";
			val.lockType = (LockType)1;
			val.willGetClaimedByDMCA = dmca;
			val.audioLevel = 0.3f;
			val.rootBonesToIgnore = null;
			val.soloBonesToIgnore = null;
			val.stopWhenMove = cantMove;
			val.thirdPerson = thirdPerson;
			val.displayName = customName;
			EmoteImporter.ImportEmote(val);
		}
	}
}