using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UltraDopamine.Helpers;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.ResourceLocators;
using UnityEngine.ResourceManagement.ResourceLocations;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[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: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.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;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class ExtensionMarkerAttribute : Attribute
{
private readonly string <Name>k__BackingField;
public string Name => <Name>k__BackingField;
public ExtensionMarkerAttribute(string name)
{
<Name>k__BackingField = name;
}
}
}
namespace UltraDopamine
{
public class Dozer : MonoBehaviour
{
public Image img;
public void Start()
{
img = ((Component)this).GetComponent<Image>();
((Behaviour)img).enabled = false;
}
public void Update()
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
if (Plugin.lastHit <= 0f && ((Behaviour)img).enabled)
{
if (Random.Range(0, 5) != 0)
{
Plugin.lastHit = 0.2f;
}
((Graphic)img).rectTransform.anchoredPosition = new Vector2(Random.Range(400f, 1500f), Random.Range(-400f, -800f));
}
((Behaviour)img).enabled = Plugin.lastHit > 0f;
}
}
public class Fire : MonoBehaviour
{
public float alpha = 1f;
public float speed = 200f;
public float tilt = 100f;
private Image img;
public void Start()
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
img = ((Component)this).GetComponent<Image>();
((Graphic)img).color = new Color(Random.Range(0.5f, 1f), Random.Range(0.5f, 1f), Random.Range(0.5f, 1f), 1f);
}
public void Update()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
RectTransform obj = Extensions.get_rectTransform(((Component)this).gameObject);
obj.anchoredPosition += new Vector2(Random.Range(0f - tilt, tilt), speed) * Time.unscaledDeltaTime;
((Graphic)img).color = new Color(((Graphic)img).color.r, ((Graphic)img).color.g, ((Graphic)img).color.b, ((Graphic)img).color.a - 1f * Time.deltaTime);
if (((Graphic)img).color.a < 0f)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
public class ImageAnimation : MonoBehaviour
{
public List<Sprite> images = new List<Sprite>();
public int index;
public float timer = 0f;
public void Start()
{
images.Add(BundleLoader.bundle.LoadAsset<Sprite>("IHateYou"));
images.Add(BundleLoader.bundle.LoadAsset<Sprite>("IHateYou2"));
images.Add(BundleLoader.bundle.LoadAsset<Sprite>("IHateYou3"));
}
public void Update()
{
timer -= Time.unscaledDeltaTime;
if (timer <= 0f)
{
timer = Random.Range(0.2f, 0.4f);
index++;
if (index >= images.Count)
{
index = 0;
}
((Component)this).GetComponent<Image>().sprite = images[index];
}
}
}
[BepInPlugin("duviz.UltraDopamine", "UltraDopamine", "0.1.0")]
public class Plugin : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static CameraCallback <>9__15_1;
public static CameraCallback <>9__15_2;
internal void <Start>b__15_1(Camera cam)
{
GL.wireframe = bugTime > 0f;
}
internal void <Start>b__15_2(Camera cam)
{
GL.wireframe = false;
}
}
[CompilerGenerated]
private sealed class <WaitForLoad>d__20 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <WaitForLoad>d__20(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
config.Reload();
break;
case 1:
<>1__state = -1;
break;
}
if (SceneHelper.PendingScene != null)
{
<>2__current = null;
<>1__state = 1;
return true;
}
MakeTexturesShit();
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public static Plugin instance;
public static ConfigFile config;
public static ConfigEntry<bool> textureConfig;
public static float bugTime = 0f;
public static float bugInterval = 5f;
public static float _bugInterval = 5f;
public static float bugDuration = 0.4f;
public static float lastHit = 0f;
public GameObject overlay;
public Image eye;
public GameObject scar1;
public GameObject scar2;
public GameObject scar3;
public GameObject fire;
public void Awake()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
instance = this;
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
config = ((BaseUnityPlugin)this).Config;
new Harmony("duviz.UltraDopamine").PatchAll();
BundleLoader.LoadBundle("dopamine.bundle");
textureConfig = config.Bind<bool>("General", "Resize textures", true, "Warning: Increases loading times by a LOT");
}
public void Start()
{
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Expected O, but got Unknown
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Expected O, but got Unknown
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01a9: Expected O, but got Unknown
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Expected O, but got Unknown
MakeAudioShit();
MakeTexturesShit();
SceneManager.sceneLoaded += delegate
{
((MonoBehaviour)this).StartCoroutine(WaitForLoad());
};
overlay = Object.Instantiate<GameObject>(BundleLoader.bundle.LoadAsset<GameObject>("OverlayCanvas"));
Object.DontDestroyOnLoad((Object)(object)overlay);
((Component)overlay.transform.GetChild(0).GetChild(0)).gameObject.AddComponent<ImageAnimation>();
((Component)overlay.transform.GetChild(1)).gameObject.AddComponent<ImageAnimation>();
eye = ((Component)overlay.transform.Find("Eye")).GetComponent<Image>();
scar1 = ((Component)overlay.transform.Find("Scar1")).gameObject;
scar2 = ((Component)overlay.transform.Find("Scar2")).gameObject;
scar3 = ((Component)overlay.transform.Find("Scar3")).gameObject;
fire = ((Component)overlay.transform.Find("Fire")).gameObject;
((Component)overlay.transform.Find("Dozer")).gameObject.AddComponent<Dozer>();
CameraCallback onPreRender = Camera.onPreRender;
object obj = <>c.<>9__15_1;
if (obj == null)
{
CameraCallback val = delegate
{
GL.wireframe = bugTime > 0f;
};
<>c.<>9__15_1 = val;
obj = (object)val;
}
Camera.onPreRender = (CameraCallback)Delegate.Combine((Delegate?)(object)onPreRender, (Delegate?)obj);
CameraCallback onPostRender = Camera.onPostRender;
object obj2 = <>c.<>9__15_2;
if (obj2 == null)
{
CameraCallback val2 = delegate
{
GL.wireframe = false;
};
<>c.<>9__15_2 = val2;
obj2 = (object)val2;
}
Camera.onPostRender = (CameraCallback)Delegate.Combine((Delegate?)(object)onPostRender, (Delegate?)obj2);
}
public void Update()
{
bugTime -= Time.unscaledDeltaTime;
lastHit -= Time.unscaledDeltaTime;
((Behaviour)eye).enabled = bugTime > 0f;
if (bugTime < 0f - _bugInterval)
{
bugTime = bugDuration + Random.Range(-0.3f, 0.3f);
_bugInterval = bugInterval + Random.Range(-1f, 8f);
}
if (Object.op_Implicit((Object)(object)MonoSingleton<NewMovement>.Instance))
{
scar1.SetActive(MonoSingleton<NewMovement>.Instance.hp <= 75);
scar2.SetActive(MonoSingleton<NewMovement>.Instance.hp <= 50);
scar3.SetActive(MonoSingleton<NewMovement>.Instance.hp <= 25);
}
}
public static void MakeAudioShit()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
AudioConfiguration configuration = AudioSettings.GetConfiguration();
configuration.numRealVoices = 512;
configuration.numVirtualVoices = 512;
configuration.sampleRate = 22050;
AudioSettings.Reset(configuration);
}
public static void MakeTexturesShit()
{
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
if (!textureConfig.Value)
{
return;
}
Texture[] array = Resources.FindObjectsOfTypeAll<Texture>();
Sprite[] array2 = Resources.FindObjectsOfTypeAll<Sprite>();
Texture[] array3 = array;
foreach (Texture val in array3)
{
try
{
Texture2D val2 = (Texture2D)(object)((val is Texture2D) ? val : null);
if (val2 == null)
{
continue;
}
((Texture)val2).filterMode = (FilterMode)0;
if (!((Texture)val2).isReadable)
{
continue;
}
Texture2D mainTexture = ResizeTexture(val2, 32, 32);
Material[] array4 = Resources.FindObjectsOfTypeAll<Material>();
Material[] array5 = array4;
foreach (Material val3 in array5)
{
if ((Object)(object)val3.mainTexture == (Object)(object)val2)
{
val3.mainTexture = (Texture)(object)mainTexture;
}
}
}
catch
{
}
}
Sprite[] array6 = array2;
foreach (Sprite val4 in array6)
{
try
{
Texture2D texture = val4.texture;
if ((Object)(object)texture == (Object)null || !((Texture)texture).isReadable)
{
continue;
}
Texture2D val5 = ResizeTexture(texture, 32, 32);
Sprite sprite = Sprite.Create(val5, val4.rect, new Vector2(0.5f, 0.5f), val4.pixelsPerUnit);
SpriteRenderer[] array7 = Resources.FindObjectsOfTypeAll<SpriteRenderer>();
SpriteRenderer[] array8 = array7;
foreach (SpriteRenderer val6 in array8)
{
if ((Object)(object)val6.sprite == (Object)(object)val4)
{
val6.sprite = sprite;
}
}
}
catch
{
}
}
}
private static Texture2D ResizeTexture(Texture2D source, int width, int height)
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
RenderTexture temporary = RenderTexture.GetTemporary(width, height);
Graphics.Blit((Texture)(object)source, temporary);
RenderTexture active = RenderTexture.active;
RenderTexture.active = temporary;
Texture2D val = new Texture2D(width, height, (TextureFormat)4, false);
val.ReadPixels(new Rect(0f, 0f, (float)width, (float)height), 0, 0);
val.Apply();
RenderTexture.active = active;
RenderTexture.ReleaseTemporary(temporary);
((Texture)val).filterMode = (FilterMode)0;
return val;
}
[IteratorStateMachine(typeof(<WaitForLoad>d__20))]
private IEnumerator WaitForLoad()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <WaitForLoad>d__20(0)
{
<>4__this = this
};
}
public void CreateFire()
{
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>(fire, overlay.transform);
Extensions.get_rectTransform(val).anchoredPosition = new Vector2((float)Random.Range(-900, 900), (float)Random.Range(0, -550));
val.AddComponent<Fire>();
val.SetActive(true);
}
public static T Ass<T>(string path)
{
return AssHelper.Ass<T>(path);
}
public static void LogInfo(object msg)
{
((BaseUnityPlugin)instance).Logger.LogInfo(msg);
}
public static void LogWarning(object msg)
{
((BaseUnityPlugin)instance).Logger.LogWarning(msg);
}
public static void LogError(object msg)
{
((BaseUnityPlugin)instance).Logger.LogError(msg);
}
}
public class PluginInfo
{
public const string GUID = "duviz.UltraDopamine";
public const string Name = "UltraDopamine";
public const string Version = "0.1.0";
}
public class RandomScale : MonoBehaviour
{
public void Update()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
Transform transform = ((Component)this).transform;
transform.localScale *= 1f + Random.Range(-1f, 1f) / 100f;
}
}
}
namespace UltraDopamine.Patches
{
[HarmonyPatch]
public class FlashImagePatch
{
[HarmonyPatch(typeof(FlashImage), "OnEnable")]
public static void Prefix(FlashImage __instance)
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
if (!__instance.flashed)
{
((Graphic)__instance.img).color = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), ((Graphic)__instance.img).color.a);
}
}
}
[HarmonyPatch]
public class SpriteControllerPatch
{
[HarmonyPatch(typeof(SpriteController), "Awake")]
public static void Postfix(SpriteController __instance)
{
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
__instance.spr.color = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), __instance.spr.color.a);
}
}
[HarmonyPatch]
public class RevolverBeamPatch
{
[HarmonyPatch(typeof(RevolverBeam), "Start")]
public static void Postfix(RevolverBeam __instance)
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
__instance.lr.startColor = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1f);
__instance.lr.endColor = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1f);
}
}
[HarmonyPatch]
public class LookAtCameraPatch
{
[HarmonyPatch(typeof(AlwaysLookAtCamera), "Start")]
public static void Prefix(AlwaysLookAtCamera __instance)
{
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)((Component)__instance).transform.parent) || !((Object)((Component)((Component)__instance).transform.parent).gameObject).name.StartsWith("Fire"))
{
return;
}
Object.Destroy((Object)(object)((Component)((Component)__instance).transform.GetChild(0)).GetComponent<AnimationSpeedRandomizer>());
Object.Destroy((Object)(object)((Component)((Component)__instance).transform.GetChild(0)).GetComponent<Animator>());
if (Object.op_Implicit((Object)(object)((Component)((Component)__instance).transform.parent).GetComponent<Light>()))
{
((Component)((Component)__instance).transform.parent).GetComponent<Light>().color = Color.white;
}
((Component)((Component)__instance).transform.GetChild(0)).GetComponent<SpriteRenderer>().color = Color.white;
if (((Component)__instance).transform.childCount >= 3)
{
SpriteRenderer component = ((Component)((Component)__instance).transform.GetChild(2)).GetComponent<SpriteRenderer>();
if (component != null)
{
component.color = new Color(1f, 1f, 1f, 0.1f);
}
}
((Component)((Component)__instance).transform.GetChild(0)).GetComponent<SpriteRenderer>().sprite = BundleLoader.bundle.LoadAsset<Sprite>("fire");
}
}
[HarmonyPatch]
public class MeshRendererPatch
{
[HarmonyPatch(typeof(EnemyIdentifierIdentifier), "Awake")]
public static void Postfix(EnemyIdentifierIdentifier __instance)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
((Component)__instance).gameObject.AddComponent<RandomScale>();
if (Random.Range(0, 100) >= 95)
{
Transform transform = ((Component)__instance).transform;
transform.localScale *= 0.001f;
for (int i = 0; i < ((Component)__instance).transform.childCount; i++)
{
Transform child = ((Component)__instance).transform.GetChild(i);
child.localScale *= 1000f;
}
}
}
}
[HarmonyPatch]
public class NewMovementPatch
{
[HarmonyPatch(typeof(NewMovement), "GetHurt")]
public static void Postfix(NewMovement __instance)
{
Plugin.lastHit = 0.2f;
if (__instance.dead)
{
Plugin.lastHit = 0f;
}
}
[HarmonyPatch(typeof(CameraController), "Start")]
[HarmonyPostfix]
public static void Postfix2(CameraController __instance)
{
ScreenDistortionField val = ((Component)__instance).gameObject.AddComponent<ScreenDistortionField>();
val.strength = 0.2f;
val.distance = 5f;
GameObject val2 = Object.Instantiate<GameObject>(BundleLoader.bundle.LoadAsset<GameObject>("Heat"));
((Renderer)val2.GetComponent<ParticleSystemRenderer>()).material = Plugin.Ass<Material>("Assets/Materials/Dev/M_HeatWave.mat");
val2.transform.SetParent(((Component)__instance).transform, false);
}
}
[HarmonyPatch]
public static class PostProcessPatch
{
[HarmonyPatch(typeof(PostProcessV2_Handler), "Fooled")]
[HarmonyPrefix]
public static bool OnFooled(PostProcessV2_Handler __instance)
{
Shader.EnableKeyword("Fooled");
Shader.EnableKeyword("FOOLED");
return false;
}
[HarmonyPatch(typeof(PostProcessV2_Handler), "SetPixelization")]
[HarmonyPrefix]
public static bool OnSetPixelation(PostProcessV2_Handler __instance)
{
Shader.SetGlobalFloat("_ResY", 240f);
__instance.downscaleResolution = 240f;
return false;
}
[HarmonyPatch(typeof(PostProcessV2_Handler), "LateUpdate")]
[HarmonyPostfix]
public static void OnLateUpdate(PostProcessV2_Handler __instance)
{
__instance.postProcessV2_VSRM.EnableKeyword("UNDERWATER");
}
}
[HarmonyPatch]
public class StylePatch
{
[HarmonyPatch(typeof(StyleHUD), "AddPoints")]
public static void Postfix()
{
Plugin.instance.CreateFire();
}
}
}
namespace UltraDopamine.Helpers
{
public static class AssHelper
{
[SpecialName]
public sealed class <G>$34505F560D9EACF86A87F3ED1F85E448
{
[SpecialName]
public static class <M>$69FE22D2D9367C6033D7C9FA04F1ABE9
{
}
[ExtensionMarker("<M>$69FE22D2D9367C6033D7C9FA04F1ABE9")]
public int Occurrences(char lookUp)
{
throw new NotSupportedException();
}
[ExtensionMarker("<M>$69FE22D2D9367C6033D7C9FA04F1ABE9")]
public IEnumerable<int> Occurences(char lookUp)
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <Occurences>d__9 : IEnumerable<int>, IEnumerable, IEnumerator<int>, IEnumerator, IDisposable
{
private int <>1__state;
private int <>2__current;
private int <>l__initialThreadId;
private string str;
public string <>3__str;
private char lookUp;
public char <>3__lookUp;
private int <i>5__1;
int IEnumerator<int>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <Occurences>d__9(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
if (num != 0)
{
if (num != 1)
{
return false;
}
<>1__state = -1;
goto IL_0062;
}
<>1__state = -1;
<i>5__1 = 0;
goto IL_0072;
IL_0062:
<i>5__1++;
goto IL_0072;
IL_0072:
if (<i>5__1 < str.Length)
{
if (str[<i>5__1] == lookUp)
{
<>2__current = <i>5__1;
<>1__state = 1;
return true;
}
goto IL_0062;
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<int> IEnumerable<int>.GetEnumerator()
{
<Occurences>d__9 <Occurences>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<Occurences>d__ = this;
}
else
{
<Occurences>d__ = new <Occurences>d__9(0);
}
<Occurences>d__.str = <>3__str;
<Occurences>d__.lookUp = <>3__lookUp;
return <Occurences>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<int>)this).GetEnumerator();
}
}
private static List<string> cache_PrefabKeys = null;
public static Dictionary<string, object> CachedAddressableAssets = new Dictionary<string, object>();
public static IResourceLocator MainAddressablesLocator => Addressables.ResourceLocators.FirstOrDefault((Func<IResourceLocator, bool>)((IResourceLocator loc) => loc.LocatorId == "AddressablesMainContentCatalog"));
public static IEnumerable<object> GetAddressableKeys()
{
IResourceLocator mainAddressablesLocator = MainAddressablesLocator;
return ((mainAddressablesLocator != null) ? mainAddressablesLocator.Keys : null) ?? Array.Empty<object>();
}
public static List<string> GetPrefabAddressableKeys(Func<string, bool> Search = null)
{
if (cache_PrefabKeys != null)
{
return cache_PrefabKeys.Where(Search).ToList();
}
List<string> list = new List<string>();
IList<IResourceLocation> list2 = default(IList<IResourceLocation>);
foreach (object addressableKey in GetAddressableKeys())
{
if (MainAddressablesLocator.Locate(addressableKey, typeof(GameObject), ref list2) && !list.Contains(list2[0].PrimaryKey))
{
list.Add(list2[0].PrimaryKey);
}
}
list.Sort();
cache_PrefabKeys = list;
return list.Where(Search).ToList();
}
public static T Ass<T>(string key)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (CachedAddressableAssets.TryGetValue(key + typeof(T).Name, out var value))
{
return (T)value;
}
T val = Addressables.LoadAssetAsync<T>((object)key).WaitForCompletion();
if (val != null)
{
CachedAddressableAssets.Add(key + typeof(T).Name, val);
}
else
{
Plugin.LogError("Failed to load asset: " + key);
}
return val;
}
public static int Occurrences(this string str, char lookUp)
{
int num = 0;
foreach (char c in str)
{
if (c == lookUp)
{
num++;
}
}
return num;
}
[IteratorStateMachine(typeof(<Occurences>d__9))]
public static IEnumerable<int> Occurences(this string str, char lookUp)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <Occurences>d__9(-2)
{
<>3__str = str,
<>3__lookUp = lookUp
};
}
}
public static class BundleLoader
{
public static AssetBundle bundle { get; private set; }
public static void LoadBundle(string path)
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
string text = path ?? "";
using Stream stream = executingAssembly.GetManifestResourceStream(text);
if (stream == null)
{
Plugin.LogError("Bundle not found: " + text);
return;
}
using MemoryStream memoryStream = new MemoryStream();
stream.CopyTo(memoryStream);
UnloadBundle();
bundle = AssetBundle.LoadFromMemory(memoryStream.ToArray());
}
public static void UnloadBundle()
{
AssetBundle obj = bundle;
if (obj != null)
{
obj.Unload(false);
}
}
}
public static class Extensions
{
[SpecialName]
public sealed class <G>$D50C47355EFA71DA0F6DB3230FE5D4AD
{
[SpecialName]
public static class <M>$D68147830E85447C80ED888358DB7BFB
{
}
[ExtensionMarker("<M>$D68147830E85447C80ED888358DB7BFB")]
public void ApplyDefaults()
{
throw new NotSupportedException();
}
}
[SpecialName]
public sealed class <G>$5E80EE1F91F68F4C0C8D9D82C38C5E67
{
[SpecialName]
public static class <M>$24BC8566157842FEB6EA2D06D7BBA5FC
{
}
[ExtensionMarker("<M>$24BC8566157842FEB6EA2D06D7BBA5FC")]
public RectTransform rectTransform
{
[ExtensionMarker("<M>$24BC8566157842FEB6EA2D06D7BBA5FC")]
get
{
throw new NotSupportedException();
}
}
}
public static void ApplyDefaults(this RectTransform rect)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
rect.anchorMin = new Vector2(0f, 1f);
rect.anchorMax = new Vector2(0f, 1f);
rect.pivot = new Vector2(0f, 1f);
}
public static RectTransform get_rectTransform(GameObject obj)
{
return obj.GetComponent<RectTransform>();
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
internal IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}