using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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("Animaciones")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Animaciones")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a562d1ec-e166-4948-8d98-c8939d0ea56b")]
[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 Animaciones;
public class Anims : MonoBehaviour
{
[SerializeField]
private Animator animOrigin;
[SerializeField]
private Animator animMod;
private void Update()
{
animOrigin = GameObject.Find("Animation_System").GetComponent<Animator>();
animMod = GameObject.Find("Shrek").GetComponent<Animator>();
if ((Object)(object)animOrigin != (Object)null && (Object)(object)animMod != (Object)null)
{
animMod.SetBool("Idle", animOrigin.GetBool("Idle"));
if (animOrigin.GetBool("IdleTeeth"))
{
animMod.SetTrigger("IdleTeeth");
}
if (animOrigin.GetBool("IdleBite"))
{
animMod.SetTrigger("IdleBite");
}
animMod.SetBool("Chase", animOrigin.GetBool("Chase"));
animMod.SetBool("ChaseBegin", animOrigin.GetBool("ChaseBegin"));
if (animOrigin.GetBool("Despawn"))
{
animMod.SetTrigger("Despawn");
}
if (animOrigin.GetBool("Spawn"))
{
animMod.SetTrigger("Spawn");
}
if (animOrigin.GetBool("ChaseBite"))
{
animMod.SetTrigger("ChaseBite");
}
}
}
}
public class SpawnSpawnMod : MonoBehaviour
{
public EnemyDirector director;
public EnemySetup enemySetupOrigin;
public EnemySetup enemySetupMod;
public GameObject PrefMod;
private void Awake()
{
enemySetupOrigin = MiMod.enemySetupOrigin;
enemySetupMod = MiMod.enemySetupMod;
director = Object.FindAnyObjectByType<EnemyDirector>();
director.enemiesDifficulty3[0] = enemySetupMod;
}
private void Start()
{
Object.Destroy((Object)(object)((Component)this).gameObject, 1f);
}
}
[BepInPlugin("com.Shrek.Darwin", "Shrek", "1.0.0")]
public class MiMod : BaseUnityPlugin
{
public static MiMod instance;
public static EnemySetup enemySetupOrigin;
public static EnemySetup enemySetupMod;
private GameObject inst;
private void Awake()
{
SceneManager.sceneLoaded += OnSceneLoaded;
instance = this;
LoadAssets();
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
Object.Instantiate<GameObject>(inst.gameObject);
}
public AssetBundle LoadAssetBundle(string name)
{
AssetBundle val = null;
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), name);
if (File.Exists(text))
{
val = AssetBundle.LoadFromFile(text);
if ((Object)(object)val == (Object)null)
{
((BaseUnityPlugin)this).Logger.LogError((object)("No se pudo cargar el AssetBundle en " + text));
}
}
else
{
((BaseUnityPlugin)this).Logger.LogError((object)("No se encontró el AssetBundle en " + text));
}
return val;
}
private void LoadAssets()
{
AssetBundle val = LoadAssetBundle("Insta");
if ((Object)(object)val != (Object)null)
{
if (val.isStreamedSceneAssetBundle)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)"El AssetBundle contiene escenas, no objetos. Verifica el contenido.");
}
enemySetupOrigin = val.LoadAsset<EnemySetup>("Assets/REPO/Game/ScriptableObjects/EnemySetup/Enemy - Head.asset");
enemySetupMod = val.LoadAsset<EnemySetup>("Assets/mod/Enemy - Shrek.asset");
inst = val.LoadAsset<GameObject>("Assets/mod/Insta.prefab");
if ((Object)(object)inst != (Object)null)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"GameObject inst cargado.");
}
else
{
((BaseUnityPlugin)this).Logger.LogError((object)"No se pudo cargar el GameObject inst. Verifica el nombre y la ruta del asset.");
}
if ((Object)(object)enemySetupMod != (Object)null)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"enemySetupMod cargado.");
}
else
{
((BaseUnityPlugin)this).Logger.LogError((object)"No se pudo cargar el enemySetupMod. Verifica el nombre y la ruta del asset.");
}
if ((Object)(object)enemySetupOrigin != (Object)null)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"enemySetupOrigin cargado.");
}
else
{
((BaseUnityPlugin)this).Logger.LogError((object)"No se pudo cargar el enemySetupOrigin. Verifica el nombre y la ruta del asset.");
}
}
else
{
((BaseUnityPlugin)this).Logger.LogError((object)"La carga del AssetBundle falló.");
}
}
}