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 HBMF;
using HBMF.AudioImporter;
using HBMF.AudioImporter.Internal;
using HBMF.GameResources.Internal;
using HBMF.ModMenu;
using HBMF.ModMenu.Internal;
using HBMF.SpawnGun.Internal;
using HBMF.Utilities;
using HarmonyLib;
using Il2Cpp;
using Il2CppFMOD;
using Il2CppFMODUnity;
using Il2CppFirearmSystem;
using Il2CppGameSettings;
using Il2CppHardBullet.UI;
using Il2CppHardBullet.UI.WindowSystem.Data;
using Il2CppHardBullet.UI.WindowsSystem;
using Il2CppHardBullet.UI.WindowsSystem.Data;
using Il2CppHardBullet.UI.WindowsSystem.Windows;
using Il2CppHurricaneVR.Framework.ControllerInput;
using Il2CppInteractionSystem;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Attributes;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using MelonLoader;
using UnityEngine;
using UnityEngine.Events;
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: MelonInfo(typeof(Mod), "HBMF", "1.5.2", "HBMF", null)]
[assembly: MelonGame("GexagonVR", "Hard Bullet")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("HBMF")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+709e1ec2f3f43c67bcdcd781c3c3bf97d7a2ca87")]
[assembly: AssemblyProduct("HBMF")]
[assembly: AssemblyTitle("HBMF")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HBMF
{
public class Mod : MelonMod
{
private bool loadedAssets = false;
public override void OnInitializeMelon()
{
SpawnerManager.Setup(Menu.CreateCategory("HBMF"));
}
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
GameResourcesManager.GetResources();
MenuManager.Setup();
if (loadedAssets)
{
return;
}
SpawnerManager.pool = new GameObject().transform;
Object.DontDestroyOnLoad((Object)(object)((Component)SpawnerManager.pool).gameObject);
((Component)SpawnerManager.pool).gameObject.SetActive(false);
foreach (Object item in (Il2CppArrayBase<Object>)(object)Resources.FindObjectsOfTypeAll(Il2CppType.Of<GameObject>()))
{
GameObject val = ((Il2CppObjectBase)item).Cast<GameObject>();
if ((Object)(object)val.transform.parent == (Object)null)
{
Scene scene = val.scene;
if (!((Scene)(ref scene)).IsValid() && ((Object)val).name == "M1911")
{
SpawnerManager.m1911 = val;
}
}
}
loadedAssets = true;
}
}
}
namespace HBMF.Utilities
{
public class Utils
{
public static byte[] GetResource(Assembly assembly, string name)
{
MemoryStream memoryStream = new MemoryStream();
Stream manifestResourceStream = assembly.GetManifestResourceStream(name);
manifestResourceStream.CopyTo(memoryStream);
manifestResourceStream.Close();
byte[] result = memoryStream.ToArray();
memoryStream.Close();
return result;
}
}
}
namespace HBMF.SpawnGun
{
public static class Spawnables
{
public static void AddSpawnable(string name, GameObject spawnable)
{
SpawnerManager.spawnables.Add(new KeyValuePair<string, GameObject>(name, Object.Instantiate<GameObject>(spawnable, SpawnerManager.pool)));
}
}
}
namespace HBMF.SpawnGun.Internal
{
internal class SpawnerManager
{
internal static GameObject m1911;
internal static List<KeyValuePair<string, GameObject>> spawnables = new List<KeyValuePair<string, GameObject>>();
internal static Transform pool;
internal static void Setup(Category category)
{
AudioClip changeClip = Audio.Import(Utils.GetResource(Assembly.GetExecutingAssembly(), "HBMF.SpawnGunChange.wav"));
AudioClip shootClip = Audio.Import(Utils.GetResource(Assembly.GetExecutingAssembly(), "HBMF.SpawnGunShoot.wav"));
category.CreateAction("SPAWN GUN", "SPAWN", delegate
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: 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)
//IL_0154: 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_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0258: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_027f: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0299: Unknown result type (might be due to invalid IL or missing references)
Transform transform = Object.Instantiate<GameObject>(m1911).transform;
transform.position = GameObject.Find("[HARD BULLET PLAYER](Clone)/HexaBody/LeftArm/Hand").transform.position;
((Behaviour)((Component)transform.Find("Firearm")).GetComponent<Firearm>()).enabled = false;
Transform shootPosition = transform.Find("Firearm/Chambers/Chamber/ProjectileInstantiatePosition");
Transform transform2 = GameObject.CreatePrimitive((PrimitiveType)4).transform;
transform2.SetParent(transform);
transform2.localPosition = new Vector3(0f, 0.1f, -0.01f);
transform2.localEulerAngles = new Vector3(-45f, 0f, 0f);
transform2.localScale = Vector3.one * 0.01f;
((Renderer)((Component)transform2).GetComponent<MeshRenderer>()).material.shader = Shader.Find("Universal Render Pipeline/Lit");
CanvasScaler val = new GameObject().AddComponent<CanvasScaler>();
((Component)val).transform.SetParent(transform2);
((Component)val).transform.localPosition = new Vector3(0f, 0.1f, 0f);
((Component)val).transform.localEulerAngles = new Vector3(90f, 0f, 0f);
((Component)val).transform.localScale = Vector3.one;
val.dynamicPixelsPerUnit = 100f;
RectTransform component = ((Component)val).GetComponent<RectTransform>();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.zero;
component.offsetMin = new Vector2(-5f, -4.9f);
component.offsetMax = new Vector2(5f, 5.1f);
Text text = new GameObject().AddComponent<Text>();
((Component)text).transform.SetParent(((Component)component).transform);
((Component)text).transform.localPosition = Vector3.zero;
((Component)text).transform.localEulerAngles = Vector3.zero;
((Component)text).transform.localScale = Vector3.one;
text.alignment = (TextAnchor)4;
text.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
text.resizeTextForBestFit = true;
text.resizeTextMinSize = 0;
text.text = "None";
((Graphic)text).color = Color.black;
RectTransform component2 = ((Component)text).GetComponent<RectTransform>();
component2.anchorMin = Vector2.zero;
component2.anchorMax = Vector2.one;
component2.offsetMin = Vector2.zero;
component2.offsetMax = Vector2.zero;
int spawnable = 0;
AudioSource changeSound = ((Component)transform.Find("Audio/HandleAudioSource")).gameObject.AddComponent<AudioSource>();
changeSound.clip = changeClip;
AudioSource shootSound = ((Component)transform.Find("Audio/ShotAudioSource")).gameObject.AddComponent<AudioSource>();
shootSound.clip = shootClip;
Usable component3 = ((Component)transform).GetComponent<Usable>();
component3.OnDropClipButtonPressed += Action<Usable>.op_Implicit((Action<Usable>)delegate
{
if (spawnables.Count > 0)
{
spawnable++;
if (spawnable >= spawnables.Count)
{
spawnable = 0;
}
text.text = spawnables[spawnable].Key;
}
changeSound.Play();
});
component3.OnUsed += Action<Usable>.op_Implicit((Action<Usable>)delegate
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: 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)
if (spawnables.Count > 0)
{
RaycastHit val2 = default(RaycastHit);
Physics.Raycast(shootPosition.position, shootPosition.forward, ref val2);
Object.Instantiate<GameObject>(spawnables[spawnable].Value, ((RaycastHit)(ref val2)).point, Quaternion.identity);
shootSound.Play();
}
});
if (spawnables.Count > 0)
{
text.text = spawnables[spawnable].Key;
}
});
}
}
}
namespace HBMF.GameResources
{
public class GameResources
{
public static Action ResourcesReady { get; set; }
public static Transform HexaBody { get; internal set; }
public static Rigidbody Locoball { get; internal set; }
public static Transform Head { get; internal set; }
public static Transform Camera { get; internal set; }
public static Grabber LeftGrabber { get; internal set; }
public static Grabber RightGrabber { get; internal set; }
public static Transform TrueLeftHand { get; internal set; }
public static Transform TrueRightHand { get; internal set; }
public static HVRInputManager InputManager { get; internal set; }
public static Transform Enemies { get; internal set; }
}
}
namespace HBMF.GameResources.Internal
{
[HarmonyPatch]
internal class GameResourcesManager
{
internal static void GetResources()
{
GameResources.Enemies = ((AbstractPool<EnemyRoot>)(object)Object.FindObjectOfType<EnemyPool>())._activeRoot;
CheckForEvent();
}
[HarmonyPatch(typeof(PlayerRoot), "Awake")]
[HarmonyPostfix]
public static void GetHexaBody(PlayerRoot __instance)
{
GameResources.HexaBody = ((Component)__instance).transform.Find("HexaBody");
GameResources.Locoball = ((Component)((Component)__instance).transform.Find("HexaBody/LocoBall")).GetComponent<Rigidbody>();
GameResources.Head = ((Component)__instance).transform.Find("HexaBody/Head");
GameResources.Camera = ((Component)__instance).transform.Find("HexaBody/Pelvis/CameraRig/FloorOffset/Scaler/Camera");
GameResources.TrueLeftHand = ((Component)__instance).transform.Find("HexaBody/Pelvis/CameraRig/FloorOffset/Scaler/LeftController");
GameResources.LeftGrabber = ((Component)((Component)__instance).transform.Find("HexaBody/LeftArm/Hand")).GetComponent<Grabber>();
GameResources.TrueRightHand = ((Component)__instance).transform.Find("HexaBody/Pelvis/CameraRig/FloorOffset/Scaler/RightController");
GameResources.RightGrabber = ((Component)((Component)__instance).transform.Find("HexaBody/RightArm/Hand")).GetComponent<Grabber>();
CheckForEvent();
}
[HarmonyPatch(typeof(HVRInputManager), "Awake")]
[HarmonyPostfix]
public static void GetInputs(HVRInputManager __instance)
{
GameResources.InputManager = __instance;
CheckForEvent();
}
private static void CheckForEvent()
{
if ((Object)(object)GameResources.Enemies != (Object)null && (Object)(object)GameResources.HexaBody != (Object)null && (Object)(object)GameResources.InputManager != (Object)null)
{
GameResources.ResourcesReady();
}
}
}
}
namespace HBMF.ModMenu
{
public class Category
{
internal List<KeyValuePair<string, object>> options = new List<KeyValuePair<string, object>>();
public string Name { get; internal set; }
public Category CreateAction(string name, string buttonText, Action action)
{
options.Add(new KeyValuePair<string, object>(name, new ActionInfo(buttonText, action)));
return this;
}
public Category CreateBool(string name, bool state, Action<bool> onChanged)
{
options.Add(new KeyValuePair<string, object>(name, new BoolInfo(state, onChanged)));
return this;
}
public Category CreateInt(string name, int state, int min, int max, int step, string units, Action<int> onChanged)
{
options.Add(new KeyValuePair<string, object>(name, new IntInfo(state, min, max, step, units, onChanged)));
return this;
}
public Category CreateFloat(string name, float state, float min, float max, float step, string units, Action<float> onChanged)
{
options.Add(new KeyValuePair<string, object>(name, new FloatInfo(state, min, max, step, units, onChanged)));
return this;
}
public Category CreateEnum(string name, int state, string[] states, Action<int> onChanged)
{
options.Add(new KeyValuePair<string, object>(name, new EnumInfo(state, states, onChanged)));
return this;
}
public Category CreateSlider(string name, float state, float min, float max, int steps, string units, Action<float> onChanged)
{
options.Add(new KeyValuePair<string, object>(name, new SliderInfo((state - min) / (max - min), min, max, steps + 1, units, onChanged)));
return this;
}
}
public class Menu
{
public static Category CreateCategory(string name)
{
Category category = new Category
{
Name = name
};
MenuManager.categories.Add(category);
return category;
}
}
}
namespace HBMF.ModMenu.Internal
{
internal class MenuManager
{
private static bool createdNormal = false;
private static bool createdRide = false;
internal static WindowsManager manager;
internal static readonly List<Category> categories = new List<Category>();
internal static readonly Dictionary<string, object> properties = new Dictionary<string, object>();
internal static void Setup()
{
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Invalid comparison between Unknown and I4
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Invalid comparison between Unknown and I4
//IL_0b3e: Unknown result type (might be due to invalid IL or missing references)
//IL_0b43: Unknown result type (might be due to invalid IL or missing references)
//IL_0b4c: Unknown result type (might be due to invalid IL or missing references)
//IL_0b59: Expected O, but got Unknown
//IL_0a8c: Unknown result type (might be due to invalid IL or missing references)
//IL_0a93: Expected O, but got Unknown
manager = GameObject.Find("[REQUIRED COMPONENTS]/WindowsManager").GetComponent<WindowsManager>();
if ((!(((Object)manager._data).name == "PopUpWindowsData") || createdNormal) && (!(((Object)manager._data).name == "PopUpWindowsRideData") || createdRide))
{
return;
}
Transform val = null;
foreach (WindowData item in (Il2CppArrayBase<WindowData>)(object)manager._data.Windows)
{
if ((int)item.WindowType == 0)
{
Transform val2 = Object.Instantiate<Transform>(((Component)item.Window).transform.Find("Canvas/PauseMenuPanel/PauseButtons/Button[ReturnToGame]"));
val2.SetParent(((Component)item.Window).transform.Find("Canvas/PauseMenuPanel/PauseButtons"), false);
Object.Destroy((Object)(object)((Component)val2).GetComponent<UITextFieldLocalisator>());
((Component)val2.Find("Text[Standart]")).GetComponent<Text>().text = "HBMF";
((Component)val2.Find("Text[Hovered]")).GetComponent<Text>().text = "HBMF";
((Component)val2).gameObject.AddComponent<HBMFButton>();
}
if ((int)item.WindowType == 1)
{
val = ((Component)item.Window).transform;
}
}
SettingsWindow component = ((Component)Object.Instantiate<Transform>(val)).GetComponent<SettingsWindow>();
((Component)component).gameObject.SetActive(false);
Object.DontDestroyOnLoad((Object)(object)((Component)component).gameObject);
Transform val3 = ((Component)component).transform.Find("Conatainer/Panels");
for (int i = 0; i < val3.childCount; i++)
{
Transform child = val3.GetChild(i);
((Component)child).gameObject.SetActive(((Object)child).name == "SettingsParameterPanel");
}
Transform val4 = ((Component)component).transform.Find("Conatainer/Panels/SettingsParameterPanel");
bool flag = true;
for (int j = 0; j < val4.childCount; j++)
{
if (flag)
{
((Component)val4.GetChild(j)).gameObject.SetActive(false);
flag = false;
}
else
{
Object.Destroy((Object)(object)((Component)val4.GetChild(j)).gameObject);
}
}
Transform child2 = val4.GetChild(0);
PanelsManagerUI component2 = ((Component)component).GetComponent<PanelsManagerUI>();
component2.panelUIs.Clear();
Transform val5 = ((Component)component).transform.Find("Conatainer/Panels/PlayerParametersPanel");
bool active = true;
foreach (Category category in categories)
{
Transform val6 = Object.Instantiate<Transform>(val5, val5.parent);
Object.Destroy((Object)(object)((Component)val6).GetComponent<ActivatorByController>());
Transform val7 = val6.Find("Scroll/Viewport/Content");
for (int k = 0; k < val7.childCount; k++)
{
((Component)val7.GetChild(k)).gameObject.SetActive(false);
}
Transform val8 = val7.Find("PlayerHeightParameterPanel");
Transform val9 = val7.Find("StrafeSetting");
Transform val10 = val7.Find("FloorOffsetParameterPanel");
Transform val11 = val7.Find("VibrationScale");
foreach (KeyValuePair<string, object> option in category.options)
{
Type type = option.Value.GetType();
if (type == typeof(ActionInfo))
{
Transform val12 = Object.Instantiate<Transform>(val8, val8.parent);
Object.Destroy((Object)(object)((Component)val12).GetComponent<SettingsParameterUI>());
((Component)val12.Find("Panel/ParamenerNameText")).GetComponent<Text>().text = option.Key;
Transform val13 = val12.Find("Panel/ChangeOffsetsButton");
((Object)((Component)val13).gameObject).name = categories.IndexOf(category) + "." + val7.childCount;
Object.Destroy((Object)(object)((Component)val13).GetComponent<UITextFieldLocalisator>());
((Component)val13.Find("StandartText")).GetComponent<Text>().text = ((ActionInfo)option.Value).text;
((Component)val13.Find("ChoosedText")).GetComponent<Text>().text = ((ActionInfo)option.Value).text;
((Component)val13).gameObject.AddComponent<MenuAction>();
if (!properties.ContainsKey(((Object)((Component)val13).gameObject).name))
{
properties.Add(((Object)((Component)val13).gameObject).name, option.Value);
}
((Component)val12).gameObject.SetActive(true);
}
else if (type == typeof(BoolInfo))
{
Transform val14 = Object.Instantiate<Transform>(val9, val9.parent);
Object.Destroy((Object)(object)((Component)val14).GetComponent<UITextFieldLocalisator>());
Object.Destroy((Object)(object)((Component)val14).GetComponent<ScriptableSettingUIChangerCheckbox>());
((Component)val14.Find("Panel/ParamenerNameText")).GetComponent<Text>().text = option.Key;
Transform val15 = val14.Find("Panel/ButtonsPanel/ChangeValue");
((Object)((Component)val15).gameObject).name = categories.IndexOf(category) + "." + val7.childCount;
((Component)val15).gameObject.AddComponent<MenuBool>();
if (!properties.ContainsKey(((Object)((Component)val15).gameObject).name))
{
properties.Add(((Object)((Component)val15).gameObject).name, option.Value);
}
((Component)val14).gameObject.SetActive(true);
}
else if (type == typeof(IntInfo))
{
Transform val16 = Object.Instantiate<Transform>(val10, val10.parent);
Object.Destroy((Object)(object)((Component)val16).GetComponent<SettingsParameterUI>());
Object.Destroy((Object)(object)((Component)val16).GetComponent<SettingsParameterChanger>());
((Component)val16.Find("Panel/ParamenerNameText")).GetComponent<Text>().text = option.Key;
Transform val17 = val16.Find("Panel/ButtonsPanel");
((Object)((Component)val17).gameObject).name = categories.IndexOf(category) + "." + val7.childCount;
((Component)val17).gameObject.AddComponent<MenuInt>();
if (!properties.ContainsKey(((Object)((Component)val17).gameObject).name))
{
properties.Add(((Object)((Component)val17).gameObject).name, option.Value);
}
((Component)val16).gameObject.SetActive(true);
}
else if (type == typeof(FloatInfo))
{
Transform val18 = Object.Instantiate<Transform>(val10, val10.parent);
Object.Destroy((Object)(object)((Component)val18).GetComponent<SettingsParameterUI>());
Object.Destroy((Object)(object)((Component)val18).GetComponent<SettingsParameterChanger>());
((Component)val18.Find("Panel/ParamenerNameText")).GetComponent<Text>().text = option.Key;
Transform val19 = val18.Find("Panel/ButtonsPanel");
((Object)((Component)val19).gameObject).name = categories.IndexOf(category) + "." + val7.childCount;
((Component)val19).gameObject.AddComponent<MenuFloat>();
if (!properties.ContainsKey(((Object)((Component)val19).gameObject).name))
{
properties.Add(((Object)((Component)val19).gameObject).name, option.Value);
}
((Component)val18).gameObject.SetActive(true);
}
else if (type == typeof(EnumInfo))
{
Transform val20 = Object.Instantiate<Transform>(val10, val10.parent);
Object.Destroy((Object)(object)((Component)val20).GetComponent<SettingsParameterUI>());
Object.Destroy((Object)(object)((Component)val20).GetComponent<SettingsParameterChanger>());
((Component)val20.Find("Panel/ParamenerNameText")).GetComponent<Text>().text = option.Key;
Transform val21 = val20.Find("Panel/ButtonsPanel");
((Object)((Component)val21).gameObject).name = categories.IndexOf(category) + "." + val7.childCount;
((Component)val21).gameObject.AddComponent<MenuEnum>();
if (!properties.ContainsKey(((Object)((Component)val21).gameObject).name))
{
properties.Add(((Object)((Component)val21).gameObject).name, option.Value);
}
((Component)val20).gameObject.SetActive(true);
}
else if (type == typeof(SliderInfo))
{
Transform val22 = Object.Instantiate<Transform>(val11, val11.parent);
Object.Destroy((Object)(object)((Component)val22).GetComponent<SettingsParameterUI>());
Object.Destroy((Object)(object)((Component)val22).GetComponent<SettingsParameterChangerScroll>());
((Component)val22.Find("Panel/ParamenerNameText")).GetComponent<Text>().text = option.Key;
Transform val23 = val22.Find("Panel/ButtonsPanel");
((Object)((Component)val23).gameObject).name = categories.IndexOf(category) + "." + val7.childCount;
((Component)val23).gameObject.AddComponent<MenuSlider>();
if (!properties.ContainsKey(((Object)((Component)val23).gameObject).name))
{
properties.Add(((Object)((Component)val23).gameObject).name, option.Value);
}
((Component)val22).gameObject.SetActive(true);
}
}
Transform val24 = Object.Instantiate<Transform>(child2, child2.parent);
((Object)((Component)val24).gameObject).name = categories.IndexOf(category).ToString();
Object.Destroy((Object)(object)((Component)val24).GetComponent<UITextFieldLocalisator>());
((Component)val24).GetComponent<Text>().text = category.Name;
GameObject gameObject = ((Component)val24.Find("Choose")).gameObject;
List<PanelUI> panelUIs = component2.panelUIs;
PanelUI val25 = new PanelUI();
val25.name = ((Object)((Component)val24).gameObject).name;
val25.gameObjects = Il2CppReferenceArray<GameObject>.op_Implicit((GameObject[])(object)new GameObject[2]
{
((Component)val6).gameObject,
gameObject
});
panelUIs.Add(val25);
gameObject.SetActive(active);
((Component)val24).gameObject.AddComponent<CategoryButton>();
((Component)val24).gameObject.SetActive(true);
((Component)val6).gameObject.SetActive(active);
active = false;
}
List<WindowData> list = ((IEnumerable<WindowData>)manager._data.Windows).ToList();
list.Add(new WindowData
{
WindowType = (WindowType)20,
Window = (Window)(object)component
});
manager._data.Windows = Il2CppReferenceArray<WindowData>.op_Implicit(list.ToArray());
if (((Object)manager._data).name == "PopUpWindowsData")
{
createdNormal = true;
return;
}
manager.Awake();
createdRide = true;
}
}
[RegisterTypeInIl2Cpp]
public class HBMFButton : MonoBehaviour
{
public HBMFButton(IntPtr ptr)
: base(ptr)
{
}
internal void OnEnable()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
UnityEvent val = new UnityEvent();
val.AddListener(UnityAction.op_Implicit((Action)delegate
{
MenuManager.manager.OpenWindow((WindowType)20, (WindowParameters)null);
}));
((Component)this).GetComponent<UIElement>().DoWhenInteract = val;
}
}
[RegisterTypeInIl2Cpp]
public class CategoryButton : MonoBehaviour
{
[CompilerGenerated]
private sealed class <FixCollider>d__2 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public CategoryButton <>4__this;
private RectTransform <rect>5__1;
private BoxCollider <collider>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <FixCollider>d__2(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<rect>5__1 = null;
<collider>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<rect>5__1 = ((Component)<>4__this).GetComponent<RectTransform>();
<>2__current = new WaitForAutoScale(<rect>5__1);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<collider>5__2 = ((Component)<>4__this).GetComponent<BoxCollider>();
<collider>5__2.size = new Vector3(<rect>5__1.sizeDelta.x, <collider>5__2.size.y, <collider>5__2.size.z);
<collider>5__2.center = new Vector3(<collider>5__2.size.x / 2f, <collider>5__2.center.y, <collider>5__2.center.z);
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 CategoryButton(IntPtr ptr)
: base(ptr)
{
}
internal void OnEnable()
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
PanelsManagerUI panelManager = ((Component)((Component)this).transform.parent.parent.parent.parent).GetComponent<PanelsManagerUI>();
UnityEvent val = new UnityEvent();
val.AddListener(UnityAction.op_Implicit((Action)delegate
{
panelManager.SetActivePanelByName(((Object)((Component)this).gameObject).name);
}));
((Component)this).GetComponent<UIElement>().DoWhenInteract = val;
MelonCoroutines.Start(FixCollider());
}
[IteratorStateMachine(typeof(<FixCollider>d__2))]
[HideFromIl2Cpp]
private IEnumerator FixCollider()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <FixCollider>d__2(0)
{
<>4__this = this
};
}
}
[RegisterTypeInIl2Cpp]
public class WaitForAutoScale : CustomYieldInstruction
{
public readonly RectTransform rect;
public override bool keepWaiting => rect.sizeDelta == Vector2.zero;
public WaitForAutoScale(IntPtr ptr)
: base(ptr)
{
}
public WaitForAutoScale(RectTransform newRect)
: base(ClassInjector.DerivedConstructorPointer<WaitForAutoScale>())
{
ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this);
rect = newRect;
}
}
internal class ActionInfo
{
internal string text;
internal Action action;
internal ActionInfo(string newText, Action newAction)
{
text = newText;
action = newAction;
}
}
[RegisterTypeInIl2Cpp]
public class MenuAction : MonoBehaviour
{
public MenuAction(IntPtr ptr)
: base(ptr)
{
}
internal void OnEnable()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
UnityEvent val = new UnityEvent();
val.AddListener(UnityAction.op_Implicit(((ActionInfo)MenuManager.properties[((Object)((Component)this).gameObject).name]).action));
((Component)this).GetComponent<UIElement>().DoWhenInteract = val;
}
}
internal class BoolInfo
{
internal bool state;
internal Action<bool> onChange;
internal BoolInfo(bool newState, Action<bool> newOnChange)
{
state = newState;
onChange = newOnChange;
}
}
[RegisterTypeInIl2Cpp]
public class MenuBool : MonoBehaviour
{
public MenuBool(IntPtr ptr)
: base(ptr)
{
}
internal void OnEnable()
{
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Expected O, but got Unknown
BoolInfo properties = (BoolInfo)MenuManager.properties[((Object)((Component)this).gameObject).name];
GameObject normal = ((Component)((Component)this).transform.Find("Default/Filled")).gameObject;
normal.SetActive(properties.state);
GameObject highlighted = ((Component)((Component)this).transform.Find("Highlighted/Filled")).gameObject;
highlighted.SetActive(properties.state);
UnityEvent val = new UnityEvent();
val.AddListener(UnityAction.op_Implicit((Action)delegate
{
properties.state = !properties.state;
normal.SetActive(properties.state);
highlighted.SetActive(properties.state);
properties.onChange(properties.state);
}));
((Component)this).GetComponent<UIElement>().DoWhenStopInteract = val;
}
}
internal class IntInfo
{
internal int state;
internal int min;
internal int max;
internal int step;
internal string units;
internal Action<int> onChange;
internal IntInfo(int newState, int newMin, int newMax, int newStep, string newUnits, Action<int> newOnChange)
{
state = newState;
min = newMin;
max = newMax;
step = newStep;
units = newUnits;
onChange = newOnChange;
}
}
[RegisterTypeInIl2Cpp]
public class MenuInt : MonoBehaviour
{
public MenuInt(IntPtr ptr)
: base(ptr)
{
}
internal void OnEnable()
{
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Expected O, but got Unknown
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Expected O, but got Unknown
IntInfo properties = (IntInfo)MenuManager.properties[((Object)((Component)this).gameObject).name];
Text text = ((Component)((Component)this).transform.Find("ParameterValueText")).GetComponent<Text>();
text.text = properties.state + properties.units;
UnityEvent val = new UnityEvent();
val.AddListener(UnityAction.op_Implicit((Action)delegate
{
properties.state = Mathf.Min(properties.state + properties.step, properties.max);
text.text = properties.state + properties.units;
properties.onChange(properties.state);
}));
((Component)((Component)this).transform.GetChild(2)).GetComponent<UIElement>().DoWhenStopInteract = val;
UnityEvent val2 = new UnityEvent();
val2.AddListener(UnityAction.op_Implicit((Action)delegate
{
properties.state = Mathf.Max(properties.state - properties.step, properties.min);
text.text = properties.state + properties.units;
properties.onChange(properties.state);
}));
((Component)((Component)this).transform.GetChild(0)).GetComponent<UIElement>().DoWhenStopInteract = val2;
}
}
internal class FloatInfo
{
internal float state;
internal float min;
internal float max;
internal float step;
internal string units;
internal Action<float> onChange;
internal FloatInfo(float newState, float newMin, float newMax, float newStep, string newUnits, Action<float> newOnChange)
{
state = newState;
min = newMin;
max = newMax;
step = newStep;
units = newUnits;
onChange = newOnChange;
}
}
[RegisterTypeInIl2Cpp]
public class MenuFloat : MonoBehaviour
{
public MenuFloat(IntPtr ptr)
: base(ptr)
{
}
internal void OnEnable()
{
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Expected O, but got Unknown
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Expected O, but got Unknown
FloatInfo properties = (FloatInfo)MenuManager.properties[((Object)((Component)this).gameObject).name];
Text text = ((Component)((Component)this).transform.Find("ParameterValueText")).GetComponent<Text>();
text.text = properties.state + properties.units;
UnityEvent val = new UnityEvent();
val.AddListener(UnityAction.op_Implicit((Action)delegate
{
properties.state = Mathf.Min(properties.state + properties.step, properties.max);
text.text = properties.state + properties.units;
properties.onChange(properties.state);
}));
((Component)((Component)this).transform.GetChild(2)).GetComponent<UIElement>().DoWhenStopInteract = val;
UnityEvent val2 = new UnityEvent();
val2.AddListener(UnityAction.op_Implicit((Action)delegate
{
properties.state = Mathf.Max(properties.state - properties.step, properties.min);
text.text = properties.state + properties.units;
properties.onChange(properties.state);
}));
((Component)((Component)this).transform.GetChild(0)).GetComponent<UIElement>().DoWhenStopInteract = val2;
}
}
internal class EnumInfo
{
internal int state;
internal string[] states;
internal Action<int> onChange;
internal EnumInfo(int newState, string[] newStates, Action<int> newOnChange)
{
state = newState;
states = newStates;
onChange = newOnChange;
}
}
[RegisterTypeInIl2Cpp]
public class MenuEnum : MonoBehaviour
{
public MenuEnum(IntPtr ptr)
: base(ptr)
{
}
internal void OnEnable()
{
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Expected O, but got Unknown
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Expected O, but got Unknown
EnumInfo properties = (EnumInfo)MenuManager.properties[((Object)((Component)this).gameObject).name];
Text text = ((Component)((Component)this).transform.Find("ParameterValueText")).GetComponent<Text>();
text.text = properties.states[properties.state];
UnityEvent val = new UnityEvent();
val.AddListener(UnityAction.op_Implicit((Action)delegate
{
properties.state++;
if (properties.state == properties.states.Length)
{
properties.state = 0;
}
text.text = properties.states[properties.state].ToString();
properties.onChange(properties.state);
}));
((Component)((Component)this).transform.GetChild(2)).GetComponent<UIElement>().DoWhenStopInteract = val;
UnityEvent val2 = new UnityEvent();
val2.AddListener(UnityAction.op_Implicit((Action)delegate
{
properties.state--;
if (properties.state == -1)
{
properties.state = properties.states.Length - 1;
}
text.text = properties.states[properties.state].ToString();
properties.onChange(properties.state);
}));
((Component)((Component)this).transform.GetChild(0)).GetComponent<UIElement>().DoWhenStopInteract = val2;
}
}
internal class SliderInfo
{
internal float state;
internal float min;
internal float max;
internal int steps;
internal string units;
internal Action<float> onChange;
internal SliderInfo(float newState, float newMin, float newMax, int newSteps, string newUnits, Action<float> newOnChange)
{
state = newState;
min = newMin;
max = newMax;
steps = newSteps;
units = newUnits;
onChange = newOnChange;
}
}
[RegisterTypeInIl2Cpp]
public class MenuSlider : MonoBehaviour
{
public MenuSlider(IntPtr ptr)
: base(ptr)
{
}
internal void OnEnable()
{
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Expected O, but got Unknown
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Expected O, but got Unknown
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Expected O, but got Unknown
HorizontalVRScrollbar scrollbar = ((Component)((Component)this).transform.Find("Scrollbar Horizontal")).GetComponent<HorizontalVRScrollbar>();
SliderInfo properties = (SliderInfo)MenuManager.properties[((Object)((Component)this).gameObject).name];
scrollbar._scrollbar.numberOfSteps = properties.steps;
Text text = ((Component)((Component)this).transform.Find("SliderControlContainer/ParameterValueSliderText")).GetComponent<Text>();
text.text = properties.min + (properties.max - properties.min) * properties.state + properties.units;
ScrollEvent val = new ScrollEvent();
bool fire = false;
((UnityEvent<float>)(object)val).AddListener(UnityAction<float>.op_Implicit((Action<float>)delegate(float value)
{
properties.state = value;
float obj = properties.min + (properties.max - properties.min) * value;
text.text = obj + properties.units;
if (fire)
{
properties.onChange(obj);
}
}));
scrollbar._scrollbar.onValueChanged = val;
scrollbar._scrollbar.value = properties.state;
fire = true;
UnityEvent val2 = new UnityEvent();
val2.AddListener(UnityAction.op_Implicit((Action)delegate
{
scrollbar._scrollbar.value = Mathf.Min(scrollbar._scrollbar.value + 1f / (float)properties.steps, 1f);
scrollbar.EndDrag();
}));
((Component)((Component)this).transform.Find("Scrollbar Horizontal/Sliding Area/Handle/ButtonHolder/IncreaseValue")).GetComponent<UIElement>().DoWhenInteract = val2;
UnityEvent val3 = new UnityEvent();
val3.AddListener(UnityAction.op_Implicit((Action)delegate
{
scrollbar._scrollbar.value = Mathf.Max(scrollbar._scrollbar.value - 1f / (float)properties.steps, 0f);
scrollbar.EndDrag();
}));
((Component)((Component)this).transform.Find("Scrollbar Horizontal/Sliding Area/Handle/ButtonHolder/DecreaseValue")).GetComponent<UIElement>().DoWhenInteract = val3;
}
}
}
namespace HBMF.AudioImporter
{
public class Audio
{
[CompilerGenerated]
private sealed class <WaitAndImport>d__2 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public byte[] bytes;
public AudioClip clip;
private string <file>5__1;
private Sound <sound>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <WaitAndImport>d__2(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<file>5__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: 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)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = new WaitForCoreSystem();
<>1__state = 1;
return true;
case 1:
{
<>1__state = -1;
<file>5__1 = Path.GetTempFileName();
File.WriteAllBytes(<file>5__1, bytes);
System coreSystem = RuntimeManager.CoreSystem;
((System)(ref coreSystem)).createSound(<file>5__1, (MODE)18, ref <sound>5__2);
clip.sound = <sound>5__2;
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();
}
}
[CompilerGenerated]
private sealed class <WaitAndImport>d__3 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public string file;
public AudioClip clip;
private Sound <sound>5__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <WaitAndImport>d__3(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: 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)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = new WaitForCoreSystem();
<>1__state = 1;
return true;
case 1:
{
<>1__state = -1;
System coreSystem = RuntimeManager.CoreSystem;
((System)(ref coreSystem)).createSound(file, (MODE)18, ref <sound>5__1);
clip.sound = <sound>5__1;
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 AudioClip Import(byte[] bytes)
{
AudioClip audioClip = new AudioClip();
MelonCoroutines.Start(WaitAndImport(bytes, audioClip));
return audioClip;
}
public static AudioClip Import(string file)
{
AudioClip audioClip = new AudioClip();
MelonCoroutines.Start(WaitAndImport(file, audioClip));
return audioClip;
}
[IteratorStateMachine(typeof(<WaitAndImport>d__2))]
private static IEnumerator WaitAndImport(byte[] bytes, AudioClip clip)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <WaitAndImport>d__2(0)
{
bytes = bytes,
clip = clip
};
}
[IteratorStateMachine(typeof(<WaitAndImport>d__3))]
private static IEnumerator WaitAndImport(string file, AudioClip clip)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <WaitAndImport>d__3(0)
{
file = file,
clip = clip
};
}
}
public class AudioClip
{
internal Sound sound;
}
public class AudioInstance
{
internal Channel channel;
public float Pitch;
public bool UseSlowMotion;
public bool Attached;
public bool Use2D
{
get
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
MODE val = default(MODE);
((Channel)(ref channel)).getMode(ref val);
return (int)val == 2058;
}
set
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
((Channel)(ref channel)).setMode((MODE)(0x802 | (value ? 8 : 16)));
}
}
public bool Looping
{
get
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
int num = default(int);
((Channel)(ref channel)).getLoopCount(ref num);
return num == -1;
}
set
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
((Channel)(ref channel)).setLoopCount(value ? (-1) : 0);
}
}
public float Volume
{
get
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
float result = default(float);
((Channel)(ref channel)).getVolume(ref result);
return result;
}
set
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
((Channel)(ref channel)).setVolume(value);
}
}
public uint Time
{
get
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
uint result = default(uint);
((Channel)(ref channel)).getPosition(ref result, (TIMEUNIT)1);
return result;
}
set
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
((Channel)(ref channel)).setPosition(value, (TIMEUNIT)1);
}
}
public bool Paused
{
get
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
bool result = default(bool);
((Channel)(ref channel)).getPaused(ref result);
return result;
}
set
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
((Channel)(ref channel)).setPaused(value);
}
}
public void Stop()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
((Channel)(ref channel)).stop();
}
}
[RegisterTypeInIl2Cpp]
public class AudioSource : MonoBehaviour
{
public AudioClip clip;
private VECTOR pos = default(VECTOR);
private VECTOR vel = default(VECTOR);
private VECTOR lastPos = default(VECTOR);
private readonly List<AudioInstance> instances = new List<AudioInstance>();
public AudioSource(IntPtr ptr)
: base(ptr)
{
}//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
internal void Update()
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: 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_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
pos = new VECTOR
{
x = ((Component)this).transform.position.x,
y = ((Component)this).transform.position.y,
z = ((Component)this).transform.position.z
};
vel = new VECTOR
{
x = pos.x - lastPos.x,
y = pos.y - lastPos.y,
z = pos.z - lastPos.z
};
lastPos = pos;
AudioInstance[] array = instances.ToArray();
Sound val = default(Sound);
uint num = default(uint);
foreach (AudioInstance audioInstance in array)
{
if (audioInstance.Attached)
{
((Channel)(ref audioInstance.channel)).set3DAttributes(ref pos, ref vel);
}
if (audioInstance.UseSlowMotion)
{
((Channel)(ref audioInstance.channel)).setPitch(audioInstance.Pitch * Time.timeScale);
}
else
{
((Channel)(ref audioInstance.channel)).setPitch(audioInstance.Pitch);
}
((Channel)(ref audioInstance.channel)).getCurrentSound(ref val);
((Sound)(ref val)).getLength(ref num, (TIMEUNIT)1);
if (num == 0)
{
instances.Remove(audioInstance);
}
}
}
[HideFromIl2Cpp]
public AudioInstance Play(PlaySettings playSettings = null)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: 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_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
if (playSettings == null)
{
playSettings = new PlaySettings();
}
System coreSystem = RuntimeManager.CoreSystem;
Channel channel = default(Channel);
((System)(ref coreSystem)).playSound(clip.sound, default(ChannelGroup), true, ref channel);
AudioInstance audioInstance = new AudioInstance
{
channel = channel,
Use2D = playSettings.Use2D,
Looping = playSettings.Looping,
Volume = playSettings.Volume,
Pitch = playSettings.Pitch,
UseSlowMotion = playSettings.UseSlowMotion,
Attached = playSettings.Attached,
Time = playSettings.Time,
Paused = false
};
instances.Add(audioInstance);
return audioInstance;
}
public void StopAll()
{
foreach (AudioInstance instance in instances)
{
instance.Stop();
}
}
public void SetUse2DAll(bool use2D)
{
foreach (AudioInstance instance in instances)
{
instance.Use2D = use2D;
}
}
public void SetLoopingAll(bool looping)
{
foreach (AudioInstance instance in instances)
{
instance.Looping = looping;
}
}
public void SetVolumeAll(float volume)
{
foreach (AudioInstance instance in instances)
{
instance.Volume = volume;
}
}
public void SetPitchAll(float pitch)
{
foreach (AudioInstance instance in instances)
{
instance.Pitch = pitch;
}
}
public void SetUseSlowMotionAll(bool useSlowMotion)
{
foreach (AudioInstance instance in instances)
{
instance.UseSlowMotion = useSlowMotion;
}
}
public void SetAttachedAll(bool attached)
{
foreach (AudioInstance instance in instances)
{
instance.Attached = attached;
}
}
public void SetTimeAll(uint time)
{
foreach (AudioInstance instance in instances)
{
instance.Time = time;
}
}
public void SetPauseAll(bool paused)
{
foreach (AudioInstance instance in instances)
{
instance.Paused = paused;
}
}
internal void OnDestroy()
{
StopAll();
}
}
public class PlaySettings
{
public bool Use2D = false;
public bool Looping = false;
public float Volume = 1f;
public float Pitch = 1f;
public bool UseSlowMotion = true;
public bool Attached = true;
public uint Time = 0u;
}
}
namespace HBMF.AudioImporter.Internal
{
[RegisterTypeInIl2Cpp]
public class WaitForCoreSystem : CustomYieldInstruction
{
public override bool keepWaiting => !RuntimeManager.IsInitialized;
public WaitForCoreSystem(IntPtr ptr)
: base(ptr)
{
}
public WaitForCoreSystem()
: base(ClassInjector.DerivedConstructorPointer<WaitForCoreSystem>())
{
ClassInjector.DerivedConstructorBody((Il2CppObjectBase)(object)this);
}
}
}