Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Captain Foxy v0.1.4
CaptainFoxyMod.dll
Decompiled 5 days agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using Microsoft.CodeAnalysis; using ModelReplacement; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CaptainFoxyMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CaptainFoxyMod")] [assembly: AssemblyTitle("CaptainFoxyMod")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 CaptainFoxyMod { public class CaptainFoxyReplacement : BodyReplacementBase { private const string PREFAB_NAME = "CaptainFoxy"; protected override GameObject LoadAssetsAndReturnModel() { if ((Object)(object)Assets.Bundle == (Object)null) { Plugin.Log.LogError((object)"Bundle non chargé, pas de modèle de remplacement"); return null; } string[] allAssetNames = Assets.Bundle.GetAllAssetNames(); foreach (string text in allAssetNames) { Plugin.Log.LogInfo((object)("Asset dans le bundle : " + text)); } GameObject val = Assets.Bundle.LoadAsset<GameObject>("CaptainFoxy"); if ((Object)(object)val == (Object)null) { GameObject[] array = Assets.Bundle.LoadAllAssets<GameObject>(); if (array.Length != 0) { val = array[0]; } } if ((Object)(object)val == (Object)null) { Plugin.Log.LogError((object)"Aucun prefab trouvé dans le bundle (cherché : 'CaptainFoxy')"); return null; } Plugin.Log.LogInfo((object)("Prefab utilisé : " + ((Object)val).name)); Animator componentInChildren = val.GetComponentInChildren<Animator>(true); if ((Object)(object)componentInChildren == (Object)null) { Plugin.Log.LogError((object)"Le prefab n'a AUCUN composant Animator"); } else { Plugin.Log.LogInfo((object)string.Format("Animator trouvé, avatar = {0}, humanoïde = {1}", ((Object)(object)componentInChildren.avatar != (Object)null) ? ((Object)componentInChildren.avatar).name : "AUCUN", (Object)(object)componentInChildren.avatar != (Object)null && componentInChildren.avatar.isHuman)); } return val; } } [BepInPlugin("perso.captainfoxy", "Captain Foxy", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string GUID = "perso.captainfoxy"; public const string NAME = "Captain Foxy"; public const string VERSION = "0.1.0"; public static readonly string[] SUIT_NAMES = new string[1] { "CaptainFoxy" }; internal static ManualLogSource Log; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; EnsureSuitFile(); Assets.Load(); string[] sUIT_NAMES = SUIT_NAMES; for (int i = 0; i < sUIT_NAMES.Length; i++) { ModelReplacementAPI.RegisterSuitModelReplacement(sUIT_NAMES[i], typeof(CaptainFoxyReplacement)); } Log.LogInfo((object)"Captain Foxy 0.1.0 chargé"); } private static void EnsureSuitFile() { try { string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "moresuits"); Directory.CreateDirectory(text); string text2 = Path.Combine(text, "!less-suits.txt"); if (!File.Exists(text2)) { File.WriteAllText(text2, string.Empty); Log.LogInfo((object)("Fichier créé : " + text2)); } string text3 = Path.Combine(text, "CaptainFoxy.png"); if (File.Exists(text3)) { return; } using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("CaptainFoxy.png"); if (stream == null) { Log.LogWarning((object)"PNG de la combinaison non intégré dans la DLL"); return; } using (FileStream destination = File.Create(text3)) { stream.CopyTo(destination); } Log.LogInfo((object)("Combinaison créée : " + text3)); } catch (Exception ex) { Log.LogError((object)("Impossible de préparer le dossier moresuits : " + ex.Message)); } } } internal static class Assets { public const string BUNDLE_NAME = "captainfoxy"; public static AssetBundle Bundle; public static void Load() { if ((Object)(object)Bundle != (Object)null) { return; } Assembly executingAssembly = Assembly.GetExecutingAssembly(); using (Stream stream = executingAssembly.GetManifestResourceStream("captainfoxy")) { if (stream != null) { using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); Bundle = AssetBundle.LoadFromMemory(memoryStream.ToArray()); } } if ((Object)(object)Bundle == (Object)null) { string text = Path.Combine(Path.GetDirectoryName(executingAssembly.Location), "captainfoxy"); if (File.Exists(text)) { Bundle = AssetBundle.LoadFromFile(text); } } if ((Object)(object)Bundle == (Object)null) { Plugin.Log.LogError((object)"Impossible de charger l'asset bundle (ni intégré, ni fichier)"); } else { Plugin.Log.LogInfo((object)"Asset bundle chargé"); } } } }