using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using UnityEngine; using UnityEngine.Audio; using UnityEngine.SceneManagement; using UnityEngine.UI; using Valve.VR; using Valve.VR.InteractionSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyVersion("0.0.0.0")] namespace TheLabModdingLib; public static class ArcheryAPI { public static ArcheryTarget[] GetAllTargets() { return Object.FindObjectsOfType(); } public static void ResetAllTargets() { ArcheryTarget[] allTargets = GetAllTargets(); foreach (ArcheryTarget val in allTargets) { if ((Object)(object)val != (Object)null) { ((Component)val).SendMessage("ResetTarget"); } } } public static void SetTargetActive(ArcheryTarget target, bool active) { if ((Object)(object)target != (Object)null) { ((Component)target).gameObject.SetActive(active); } } public static void ActivateAllTargets() { ArcheryTarget[] allTargets = GetAllTargets(); foreach (ArcheryTarget val in allTargets) { if ((Object)(object)val != (Object)null) { ((Component)val).gameObject.SetActive(true); } } } public static int GetActiveTargetCount() { int num = 0; ArcheryTarget[] allTargets = GetAllTargets(); foreach (ArcheryTarget val in allTargets) { if ((Object)(object)val != (Object)null && ((Behaviour)val).isActiveAndEnabled) { num++; } } return num; } public static ArcheryStaging GetStaging() { return Object.FindObjectOfType(); } public static void StartStaging() { ArcheryStaging staging = GetStaging(); if ((Object)(object)staging != (Object)null) { ((Component)staging).SendMessage("StartStaging"); } } public static void StopStaging() { ArcheryStaging staging = GetStaging(); if ((Object)(object)staging != (Object)null) { ((Component)staging).SendMessage("StopStaging"); } } public static Arrow[] GetAllArrows() { return Object.FindObjectsOfType(); } public static int GetArrowCount() { return GetAllArrows().Length; } public static void RemoveAllArrows() { Arrow[] allArrows = GetAllArrows(); foreach (Arrow val in allArrows) { if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } public static ArrowExplosive[] GetExplosiveArrows() { return Object.FindObjectsOfType(); } public static Quiver GetQuiver() { return Object.FindObjectOfType(); } public static void FillQuiver(int count = 10) { Quiver quiver = GetQuiver(); if ((Object)(object)quiver != (Object)null) { FieldInfo field = typeof(Quiver).GetField("arrowCount", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(quiver, count); } } } } public static class AudioAPI { public static void SetMasterVolume(float volume) { AudioListener.volume = Mathf.Clamp01(volume); } public static float GetMasterVolume() { return AudioListener.volume; } public static void MuteAll() { AudioListener.volume = 0f; } public static void UnmuteAll() { AudioListener.volume = 1f; } public static void SetAudioPitch(float pitch) { AudioSource globalAudioSource = GetGlobalAudioSource(); if ((Object)(object)globalAudioSource != (Object)null) { globalAudioSource.pitch = pitch; } } public static float GetAudioPitch() { AudioSource globalAudioSource = GetGlobalAudioSource(); return ((Object)(object)globalAudioSource != (Object)null) ? globalAudioSource.pitch : 1f; } public static void SetPitchToTimeScale() { AudioSource globalAudioSource = GetGlobalAudioSource(); if ((Object)(object)globalAudioSource != (Object)null) { globalAudioSource.pitch = Time.timeScale; } } public static AudioSource GetGlobalAudioSource() { Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return null; } AudioSource val = ((Component)main).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)main).gameObject.AddComponent(); } return val; } public static void PlayOneShot(AudioClip clip, float volume = 1f) { AudioSource globalAudioSource = GetGlobalAudioSource(); if ((Object)(object)globalAudioSource != (Object)null && (Object)(object)clip != (Object)null) { globalAudioSource.PlayOneShot(clip, volume); } } public static void PlayOneShotAtPosition(AudioClip clip, Vector3 position, float volume = 1f) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)clip != (Object)null) { AudioSource.PlayClipAtPoint(clip, position, volume); } } public static void PlaySoundOnGameObject(GameObject target, AudioClip clip, float volume = 1f) { if (!((Object)(object)target == (Object)null) && !((Object)(object)clip == (Object)null)) { AudioSource val = target.GetComponent(); if ((Object)(object)val == (Object)null) { val = target.AddComponent(); } val.PlayOneShot(clip, volume); } } public static AudioSource[] GetAllAudioSources() { return Object.FindObjectsOfType(); } public static void StopAllAudio() { AudioSource[] allAudioSources = GetAllAudioSources(); foreach (AudioSource val in allAudioSources) { if ((Object)(object)val != (Object)null) { val.Stop(); } } } public static void PauseAllAudio() { AudioSource[] allAudioSources = GetAllAudioSources(); foreach (AudioSource val in allAudioSources) { if ((Object)(object)val != (Object)null) { val.Pause(); } } } public static void ResumeAllAudio() { AudioSource[] allAudioSources = GetAllAudioSources(); foreach (AudioSource val in allAudioSources) { if ((Object)(object)val != (Object)null) { val.UnPause(); } } } public static void SetAudioCategoryVolume(string category, float volume) { AudioMixer[] array = Resources.FindObjectsOfTypeAll(); AudioMixer[] array2 = array; foreach (AudioMixer val in array2) { if ((Object)(object)val != (Object)null) { val.SetFloat(category + "Volume", Mathf.Log10(Mathf.Clamp01(volume)) * 20f); } } } public static void MuteAudioCategory(string category) { SetAudioCategoryVolume(category, 0f); } public static SoundPlayOneshot[] GetAllSoundEffects() { return Object.FindObjectsOfType(); } public static void PlaySoundEffect(string name) { SoundPlayOneshot[] allSoundEffects = GetAllSoundEffects(); foreach (SoundPlayOneshot val in allSoundEffects) { if ((Object)(object)val != (Object)null && ((Object)val).name.Contains(name)) { ((Component)val).SendMessage("Play", (object)null); break; } } } public static SoundEffectVRC[] GetXortexSoundEffects() { return Object.FindObjectsOfType(); } public static void SetMusicVolume(float volume) { MusicPlayerVRC[] array = Object.FindObjectsOfType(); MusicPlayerVRC[] array2 = array; foreach (MusicPlayerVRC val in array2) { if ((Object)(object)val != (Object)null) { AudioSource component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.volume = volume; } } } } public static SoundVolumeLerpController[] GetSoundVolumeControllers() { return Object.FindObjectsOfType(); } public static void FadeOutAll(float duration = 1f) { SoundVolumeLerpController[] soundVolumeControllers = GetSoundVolumeControllers(); foreach (SoundVolumeLerpController val in soundVolumeControllers) { if ((Object)(object)val != (Object)null) { ((Component)val).SendMessage("FadeOut", (object)duration); } } } public static void FadeInAll(float duration = 1f) { SoundVolumeLerpController[] soundVolumeControllers = GetSoundVolumeControllers(); foreach (SoundVolumeLerpController val in soundVolumeControllers) { if ((Object)(object)val != (Object)null) { ((Component)val).SendMessage("FadeIn", (object)duration); } } } } public static class CreditsAPI { public static bool IsAvailable => (Object)(object)GetCredits() != (Object)null; public static Credits GetCredits() { return Object.FindObjectOfType(); } public static bool IsPlaying() { Credits credits = GetCredits(); if ((Object)(object)credits == (Object)null) { return false; } FieldInfo field = typeof(Credits).GetField("isPlaying", BindingFlags.Instance | BindingFlags.NonPublic); return field != null && (bool)field.GetValue(credits); } public static void StartCredits() { Credits credits = GetCredits(); if ((Object)(object)credits != (Object)null) { ((Component)credits).SendMessage("StartCredits"); } } public static void StopCredits() { Credits credits = GetCredits(); if ((Object)(object)credits != (Object)null) { ((Component)credits).SendMessage("StopCredits"); } } public static void SkipToEnd() { Credits credits = GetCredits(); if ((Object)(object)credits != (Object)null) { ((Component)credits).SendMessage("SkipToEnd"); } } public static void SetScrollSpeed(float speed) { Credits credits = GetCredits(); if (!((Object)(object)credits == (Object)null)) { FieldInfo field = typeof(Credits).GetField("scrollSpeed", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(credits, speed); } } } public static float GetScrollSpeed() { Credits credits = GetCredits(); if ((Object)(object)credits == (Object)null) { return 0f; } FieldInfo field = typeof(Credits).GetField("scrollSpeed", BindingFlags.Instance | BindingFlags.NonPublic); return (field != null) ? ((float)field.GetValue(credits)) : 0f; } public static CreditsInteractive GetInteractiveCredits() { return Object.FindObjectOfType(); } public static void StartInteractiveCredits() { CreditsInteractive interactiveCredits = GetInteractiveCredits(); if ((Object)(object)interactiveCredits != (Object)null) { ((Component)interactiveCredits).SendMessage("StartInteractive"); } } } public static class DudeAPI { public static ApertureDudeMasterSpawner GetSpawner() { return ApertureDudeMasterSpawner.instance; } public static bool IsAssaultInProgress() { ApertureDudeMasterSpawner spawner = GetSpawner(); return (Object)(object)spawner != (Object)null && spawner.IsAssultInProgress(); } public static List GetAllDudes() { ApertureDudeAI[] source = Object.FindObjectsOfType(); return source.ToList(); } public static int GetDudeCount() { return GetAllDudes().Count; } public static void KillAllDudes() { foreach (ApertureDudeAI allDude in GetAllDudes()) { if ((Object)(object)allDude != (Object)null && (Object)(object)((Component)allDude).gameObject != (Object)null) { allDude.Death(); } } } public static void SetDudeDestination(ApertureDudeAI dude, Transform target) { if ((Object)(object)dude != (Object)null) { dude.SetDestination(target); } } public static void SetDudeDestination(ApertureDudeAI dude, Vector3 position) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)dude != (Object)null && (Object)(object)dude.agent != (Object)null) { dude.agent.SetDestination(position); } } public static void SetDudeSpeed(ApertureDudeAI dude, float speed) { if ((Object)(object)dude != (Object)null && (Object)(object)dude.agent != (Object)null) { dude.agent.speed = speed; } } public static void SetAllDudesSpeed(float speed) { foreach (ApertureDudeAI allDude in GetAllDudes()) { if ((Object)(object)allDude != (Object)null && (Object)(object)allDude.agent != (Object)null) { allDude.agent.speed = speed; } } } public static void SetDudeOnFire(ApertureDudeAI dude) { if ((Object)(object)dude != (Object)null) { dude.CatchOnFire(); } } public static void SetAllDudesOnFire() { foreach (ApertureDudeAI allDude in GetAllDudes()) { if ((Object)(object)allDude != (Object)null) { allDude.CatchOnFire(); } } } public static void ResetDudeDestination(ApertureDudeAI dude) { if ((Object)(object)dude != (Object)null) { dude.ResetDestination(); } } public static int GetCurrentWave() { ApertureDudeMasterSpawner spawner = GetSpawner(); return ((Object)(object)spawner != (Object)null) ? spawner.currentWave : 0; } public static int GetTotalWaves() { ApertureDudeMasterSpawner spawner = GetSpawner(); return ((Object)(object)spawner != (Object)null) ? spawner.wave.Length : 0; } public static void NextWave() { ApertureDudeMasterSpawner spawner = GetSpawner(); if ((Object)(object)spawner != (Object)null) { spawner.ReactToShot(); } } public static void TriggerPlayerLose() { ApertureDudeMasterSpawner spawner = GetSpawner(); if ((Object)(object)spawner != (Object)null) { spawner.PlayerLoses(); } } public static void InitializeLongbow() { ApertureDudeMasterSpawner spawner = GetSpawner(); if ((Object)(object)spawner != (Object)null) { spawner.Initialize(); } } public static void ShutdownLongbow() { ApertureDudeMasterSpawner spawner = GetSpawner(); if ((Object)(object)spawner != (Object)null) { spawner.ShutDown(); } } public static ApertureDudeAI SpawnDude(Vector3 position, Quaternion rotation) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) ApertureDudeMasterSpawner spawner = GetSpawner(); if ((Object)(object)spawner == (Object)null || (Object)(object)spawner.enemyBasePrefab == (Object)null) { return null; } GameObject val = Object.Instantiate(spawner.enemyBasePrefab, position, rotation); return val.GetComponent(); } public static void SpawnDudeWave(int count) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) ApertureDudeMasterSpawner spawner = GetSpawner(); if ((Object)(object)spawner == (Object)null || (Object)(object)spawner.enemyBasePrefab == (Object)null || spawner.spawnTransforms == null) { return; } for (int i = 0; i < count; i++) { Transform val = spawner.spawnTransforms[Random.Range(0, spawner.spawnTransforms.Length)]; if ((Object)(object)val != (Object)null) { SpawnDude(val.position, val.rotation); } } } public static void MakeDudeTaunt(ApertureDudeAI dude) { if ((Object)(object)dude != (Object)null) { dude.alwaysTaunting = !dude.alwaysTaunting; } } public static void MakeDudeMiniature(ApertureDudeAI dude, bool miniature) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)dude != (Object)null) { dude.isMiniature = miniature; ((Component)dude).transform.localScale = (miniature ? (Vector3.one * 0.3f) : Vector3.one); } } public static void SetDudeShield(ApertureDudeAI dude, bool hasShield) { if ((Object)(object)dude != (Object)null) { dude.hasShield = hasShield; } } public static void SetDudeOnFireState(ApertureDudeAI dude, bool onFire) { if (!((Object)(object)dude == (Object)null)) { if (onFire) { dude.CatchOnFire(); } else { dude.onFire = false; } } } public static void TeleportDude(ApertureDudeAI dude, Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)dude != (Object)null && (Object)(object)dude.agent != (Object)null) { dude.agent.Warp(position); } } public static void SetAllDudesDestination(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) foreach (ApertureDudeAI allDude in GetAllDudes()) { if ((Object)(object)allDude != (Object)null) { SetDudeDestination(allDude, position); } } } public static void MakeAllDudesMiniature(bool miniature) { foreach (ApertureDudeAI allDude in GetAllDudes()) { MakeDudeMiniature(allDude, miniature); } } public static FetchBot GetFetchBot() { return Object.FindObjectOfType(); } public static bool IsFetchBotValid(FetchBot bot) { return (Object)(object)bot != (Object)null && (Object)(object)((Component)bot).gameObject != (Object)null; } public static void TeleportFetchBotToPlayer(FetchBot bot) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bot != (Object)null && (Object)(object)PlayerAPI.VRPlayerInstance != (Object)null) { ((Component)bot).transform.position = PlayerAPI.FeetPositionGuess + PlayerAPI.HMDTransform.forward * 1.5f; } } } public static class EffectsAPI { public static ParticleSystem[] GetAllParticleSystems() { return Object.FindObjectsOfType(); } public static void PlayAllParticleSystems() { ParticleSystem[] allParticleSystems = GetAllParticleSystems(); foreach (ParticleSystem val in allParticleSystems) { if ((Object)(object)val != (Object)null) { val.Play(); } } } public static void StopAllParticleSystems() { ParticleSystem[] allParticleSystems = GetAllParticleSystems(); foreach (ParticleSystem val in allParticleSystems) { if ((Object)(object)val != (Object)null) { val.Stop(); } } } public static void PauseAllParticleSystems() { ParticleSystem[] allParticleSystems = GetAllParticleSystems(); foreach (ParticleSystem val in allParticleSystems) { if ((Object)(object)val != (Object)null) { val.Pause(); } } } public static void SpawnParticleBurst(Vector3 position, int count = 20) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00a6: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) ParticleSystem val = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)delegate(ParticleSystem p) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Scene scene = ((Component)p).gameObject.scene; return ((Scene)(ref scene)).IsValid(); }); if ((Object)(object)val != (Object)null) { ParticleSystem val2 = Object.Instantiate(val, position, Quaternion.identity); val2.Emit(count); Object.Destroy((Object)(object)((Component)val2).gameObject, 5f); return; } GameObject val3 = new GameObject("_EffectBurst"); val3.transform.position = position; ParticleSystem val4 = val3.AddComponent(); MainModule main = val4.main; ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(2f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.1f); ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(1f); ((MainModule)(ref main)).maxParticles = count; EmissionModule emission = val4.emission; ((EmissionModule)(ref emission)).SetBurst(0, new Burst(0f, (short)count)); val4.Play(); Object.Destroy((Object)(object)val3, 3f); } public static void FlashScreen(Color color, float duration = 0.2f) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) Camera main = Camera.main; if (!((Object)(object)main == (Object)null)) { GameObject val = new GameObject("_ScreenFlash"); Canvas val2 = val.AddComponent(); val2.renderMode = (RenderMode)0; val2.sortingOrder = 999; Image val3 = val.AddComponent(); ((Graphic)val3).color = color; ((Graphic)val3).raycastTarget = false; Object.Destroy((Object)(object)val, duration); } } public static void SetBloomIntensity(float intensity) { AmplifyColorEffect[] array = Object.FindObjectsOfType(); AmplifyColorEffect[] array2 = array; foreach (AmplifyColorEffect val in array2) { if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = intensity > 0f; } } } public static void SetVignetteEnabled(bool enabled) { AmplifyColorVolume[] array = Object.FindObjectsOfType(); AmplifyColorVolume[] array2 = array; foreach (AmplifyColorVolume val in array2) { if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = enabled; } } } public static void SpawnLightning(Vector3 start, Vector3 end) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: 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) //IL_0035: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b4: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("_Lightning"); val.transform.position = start; LineRenderer val2 = val.AddComponent(); ((Renderer)val2).material = new Material(Shader.Find("Sprites/Default")); val2.startColor = Color.yellow; val2.endColor = Color.white; val2.startWidth = 0.05f; val2.endWidth = 0.01f; int num = 10; Vector3[] array = (Vector3[])(object)new Vector3[num + 1]; array[0] = start; array[num] = end; for (int i = 1; i < num; i++) { float num2 = (float)i / (float)num; Vector3 val3 = Vector3.Lerp(start, end, num2); array[i] = val3 + Random.insideUnitSphere * 0.3f; } val2.positionCount = num + 1; val2.SetPositions(array); Object.Destroy((Object)(object)val, 0.3f); } public static void SetPostProcessingEnabled(bool enabled) { AmplifyColorBase[] array = Object.FindObjectsOfType(); AmplifyColorBase[] array2 = array; foreach (AmplifyColorBase val in array2) { if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = enabled; } } } public static TrailRenderer[] GetAllTrailRenderers() { return Object.FindObjectsOfType(); } public static void ClearAllTrails() { TrailRenderer[] allTrailRenderers = GetAllTrailRenderers(); foreach (TrailRenderer val in allTrailRenderers) { if ((Object)(object)val != (Object)null) { val.Clear(); } } } public static void SpawnExplosionEffect(Vector3 position, float scale = 1f) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); val.transform.position = position; val.transform.localScale = Vector3.one * scale * 0.5f; ((Object)val).name = "_ExplosionEffect"; Material val2 = new Material(Shader.Find("Particles/Additive")); val2.color = new Color(1f, 0.5f, 0f, 0.8f); ((Renderer)val.GetComponent()).material = val2; Rigidbody val3 = val.AddComponent(); val3.useGravity = false; Object.Destroy((Object)(object)val, 1f); } public static ProFlare[] GetAllFlares() { return Object.FindObjectsOfType(); } public static void SetFlareIntensity(float intensity) { ProFlare[] allFlares = GetAllFlares(); foreach (ProFlare val in allFlares) { if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = intensity > 0f; } } } public static CFX_SpawnSystem GetSpawnSystem() { return Object.FindObjectOfType(); } public static void SetAmbientParticlesEnabled(bool enabled) { //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) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.AddRange(Object.FindObjectsOfType()); foreach (ParticleSystem item in list) { if ((Object)(object)item != (Object)null) { MainModule main = item.main; if (((MainModule)(ref main)).loop) { EmissionModule emission = item.emission; ((EmissionModule)(ref emission)).enabled = enabled; } } } } } public static class ElevatorAPI { public static bool IsAvailable => (Object)(object)GetElevator() != (Object)null; public static Elevator GetElevator() { return Object.FindObjectOfType(); } public static void OpenDoors() { Elevator elevator = GetElevator(); if ((Object)(object)elevator != (Object)null) { ((Component)elevator).SendMessage("OpenDoors"); } } public static void CloseDoors() { Elevator elevator = GetElevator(); if ((Object)(object)elevator != (Object)null) { ((Component)elevator).SendMessage("CloseDoors"); } } public static void ToggleDoors() { Elevator elevator = GetElevator(); if ((Object)(object)elevator != (Object)null) { ((Component)elevator).SendMessage("ToggleDoors"); } } public static void CallElevator() { Elevator elevator = GetElevator(); if ((Object)(object)elevator != (Object)null) { ((Component)elevator).SendMessage("CallElevator"); } } public static void GoToFloor(int floor) { Elevator elevator = GetElevator(); if ((Object)(object)elevator != (Object)null) { ((Component)elevator).SendMessage("GoToFloor", (object)floor); } } public static void SetSpeed(float speed) { Elevator elevator = GetElevator(); if (!((Object)(object)elevator == (Object)null)) { FieldInfo field = typeof(Elevator).GetField("speed", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(elevator, speed); } } } public static void EmergencyStop() { Elevator elevator = GetElevator(); if ((Object)(object)elevator != (Object)null) { ((Component)elevator).SendMessage("EmergencyStop"); } } public static void SetDoorOpenDuration(float duration) { Elevator elevator = GetElevator(); if (!((Object)(object)elevator == (Object)null)) { FieldInfo field = typeof(Elevator).GetField("doorOpenDuration", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(elevator, duration); } } } public static void SetLightIntensity(float intensity) { Elevator elevator = GetElevator(); if (!((Object)(object)elevator == (Object)null)) { FieldInfo field = typeof(Elevator).GetField("lightIntensity", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(elevator, intensity); } } } public static bool AreDoorsOpen() { Elevator elevator = GetElevator(); if ((Object)(object)elevator == (Object)null) { return false; } FieldInfo field = typeof(Elevator).GetField("doorsOpen", BindingFlags.Instance | BindingFlags.NonPublic); return field != null && (bool)field.GetValue(elevator); } public static bool IsMoving() { Elevator elevator = GetElevator(); if ((Object)(object)elevator == (Object)null) { return false; } FieldInfo field = typeof(Elevator).GetField("isMoving", BindingFlags.Instance | BindingFlags.NonPublic); return field != null && (bool)field.GetValue(elevator); } public static int GetCurrentFloor() { Elevator elevator = GetElevator(); if ((Object)(object)elevator == (Object)null) { return -1; } FieldInfo field = typeof(Elevator).GetField("currentFloor", BindingFlags.Instance | BindingFlags.NonPublic); return (field != null) ? ((int)field.GetValue(elevator)) : (-1); } public static int GetTotalFloors() { Elevator elevator = GetElevator(); if ((Object)(object)elevator == (Object)null) { return 0; } FieldInfo field = typeof(Elevator).GetField("totalFloors", BindingFlags.Instance | BindingFlags.NonPublic); return (field != null) ? ((int)field.GetValue(elevator)) : 0; } } public static class FetchBotAPI { public static bool IsAvailable => (Object)(object)GetFetchBot() != (Object)null; public static FetchBot GetFetchBot() { return Object.FindObjectOfType(); } public static bool IsValid(FetchBot bot) { return (Object)(object)bot != (Object)null && (Object)(object)((Component)bot).gameObject != (Object)null; } public static void SetFollowTarget(Transform target) { FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot != (Object)null) { fetchBot.followObject = target; } } public static void SetLookTarget(Transform target) { FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot != (Object)null) { fetchBot.lookAtObject = target; } } public static void MakePlayDead() { FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot != (Object)null) { fetchBot.ApplyDamage(); } } public static void TeleportTo(Vector3 position) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot != (Object)null) { ((Component)fetchBot).transform.position = position; } } public static void TeleportToPlayer() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot != (Object)null && (Object)(object)PlayerAPI.HMDTransform != (Object)null) { ((Component)fetchBot).transform.position = PlayerAPI.FeetPositionGuess + PlayerAPI.HMDTransform.forward * 1.5f; } } public static void SetDebugMode(bool enabled) { FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot != (Object)null) { fetchBot.m_DebugMode = enabled; fetchBot.spewDebugText = enabled; } } public static void SetCanJump(bool canJump) { FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot != (Object)null) { fetchBot.canJump = canJump; } } public static void SetMovementParameters(float frequency, float amplitude) { FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot != (Object)null) { fetchBot.frequency = frequency; fetchBot.amplitude = amplitude; } } public static bool IsObjectFetchTarget(GameObject go) { FetchBot fetchBot = GetFetchBot(); return (Object)(object)fetchBot != (Object)null && fetchBot.IsObjectAFetchTarget(go); } public static void SetArrowPrefab(GameObject prefab) { FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot != (Object)null) { fetchBot.arrowPrefab = prefab; } } public static int GetArrowCount() { FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot == (Object)null || fetchBot.m_arrStuckArrows == null) { return 0; } return fetchBot.m_arrStuckArrows.Count; } public static void ClearArrows() { FetchBot fetchBot = GetFetchBot(); if ((Object)(object)fetchBot == (Object)null || fetchBot.m_arrStuckArrows == null) { return; } foreach (Arrow arrStuckArrow in fetchBot.m_arrStuckArrows) { if ((Object)(object)arrStuckArrow != (Object)null) { Object.Destroy((Object)(object)((Component)arrStuckArrow).gameObject); } } fetchBot.m_arrStuckArrows.Clear(); } } public static class FunAPI { public static void SpawnRainbowCube(Vector3 position, float scale = 0.2f) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0057: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); val.transform.position = position; val.transform.localScale = Vector3.one * scale; ((Object)val).name = "_RainbowCube"; Rigidbody val2 = val.AddComponent(); val2.useGravity = true; Material val3 = new Material(Shader.Find("Standard")); val3.color = new Color(Random.value, Random.value, Random.value); ((Renderer)val.GetComponent()).material = val3; val2.velocity = new Vector3(Random.Range(-2f, 2f), Random.Range(3f, 6f), Random.Range(-2f, 2f)); Object.Destroy((Object)(object)val, 10f); } public static void SpawnRainbowCubes(int count) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = PlayerAPI.FeetPositionGuess; if (val == Vector3.zero) { val = Vector3.zero; } for (int i = 0; i < count; i++) { Vector3 position = val + new Vector3(Random.Range(-3f, 3f), Random.Range(0.5f, 3f), Random.Range(-3f, 3f)); SpawnRainbowCube(position); } } public static void SpawnConfettiExplosion(Vector3 position, int count = 50) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < count; i++) { GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); val.transform.position = position; val.transform.localScale = new Vector3(0.03f, 0.03f, 0.1f); ((Object)val).name = "_Confetti"; Rigidbody val2 = val.AddComponent(); val2.useGravity = true; val2.velocity = Random.insideUnitSphere * 5f + Vector3.up * 3f; val2.angularVelocity = Random.insideUnitSphere * 10f; Material val3 = new Material(Shader.Find("Standard")); val3.color = new Color(Random.value, Random.value, Random.value); ((Renderer)val.GetComponent()).material = val3; Object.Destroy((Object)(object)val, 5f); } } public static void SpawnFirework(Vector3 position) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) int num = 30; Color color = default(Color); ((Color)(ref color))..ctor(Random.value, Random.value, Random.value); for (int i = 0; i < num; i++) { GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); val.transform.position = position; val.transform.localScale = Vector3.one * Random.Range(0.05f, 0.15f); ((Object)val).name = "_Firework"; Rigidbody val2 = val.AddComponent(); val2.useGravity = true; val2.velocity = Random.insideUnitSphere * Random.Range(2f, 6f); Material val3 = new Material(Shader.Find("Standard")); val3.color = color; ((Renderer)val.GetComponent()).material = val3; Object.Destroy((Object)(object)val, Random.Range(1f, 3f)); } } public static void SpawnFireworks(int count) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = PlayerAPI.FeetPositionGuess; if (val == Vector3.zero) { val = Vector3.zero; } for (int i = 0; i < count; i++) { Vector3 position = val + new Vector3(Random.Range(-5f, 5f), Random.Range(1f, 4f), Random.Range(-5f, 5f)); SpawnFirework(position); } } public static void MakeAllObjectsBouncy(float bounciness = 1f) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) Rigidbody[] array = Object.FindObjectsOfType(); Rigidbody[] array2 = array; foreach (Rigidbody val in array2) { if ((Object)(object)val == (Object)null) { continue; } Collider[] componentsInChildren = ((Component)val).GetComponentsInChildren(); Collider[] array3 = componentsInChildren; foreach (Collider val2 in array3) { if (!((Object)(object)val2 == (Object)null)) { PhysicMaterial val3 = (PhysicMaterial)(((object)val2.sharedMaterial) ?? ((object)new PhysicMaterial())); val3.bounciness = bounciness; val3.bounceCombine = (PhysicMaterialCombine)3; val2.sharedMaterial = val3; } } } } public static void SetRandomColorsOnAllObjects() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) MeshRenderer[] array = Object.FindObjectsOfType(); MeshRenderer[] array2 = array; foreach (MeshRenderer val in array2) { if ((Object)(object)val == (Object)null || ((Renderer)val).materials == null) { continue; } Material[] materials = ((Renderer)val).materials; foreach (Material val2 in materials) { if ((Object)(object)val2 != (Object)null && val2.HasProperty("_Color")) { val2.color = new Color(Random.value, Random.value, Random.value); } } } } public static void MakeItemFly(GameObject item, float height = 5f) { //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_003c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)item == (Object)null)) { Rigidbody component = item.GetComponent(); if ((Object)(object)component != (Object)null) { component.useGravity = false; component.velocity = Vector3.zero; component.AddForce(Vector3.up * height, (ForceMode)1); } } } public static void MakeAllItemsFly() { foreach (GameObject allItem in ItemAPI.GetAllItems()) { MakeItemFly(allItem); } } public static void SpawnBalloonAnimal(Vector3 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); val.transform.position = position; val.transform.localScale = Vector3.one * 0.3f; ((Object)val).name = "_BalloonAnimal"; Rigidbody val2 = val.AddComponent(); val2.useGravity = true; val2.mass = 0.1f; val2.drag = 0.5f; Material val3 = new Material(Shader.Find("Standard")); val3.color = Color.Lerp(Color.red, Color.blue, Random.value); ((Renderer)val.GetComponent()).material = val3; val2.AddForce(Vector3.up * 2f, (ForceMode)1); Object.Destroy((Object)(object)val, 20f); } public static void SpawnBalloonAnimals(int count) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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) Vector3 val = PlayerAPI.FeetPositionGuess; if (val == Vector3.zero) { val = Vector3.zero; } for (int i = 0; i < count; i++) { Vector3 position = val + new Vector3(Random.Range(-2f, 2f), 1f, Random.Range(-2f, 2f)); SpawnBalloonAnimal(position); } } public static void SpawnRainbowSphere(Vector3 position, float scale = 0.3f) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0057: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); val.transform.position = position; val.transform.localScale = Vector3.one * scale; ((Object)val).name = "_RainbowSphere"; Rigidbody val2 = val.AddComponent(); val2.useGravity = true; Material val3 = new Material(Shader.Find("Standard")); val3.color = Color.HSVToRGB(Random.value, 1f, 1f); ((Renderer)val.GetComponent()).material = val3; Object.Destroy((Object)(object)val, 15f); } public static void PlayDramaticEffect() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) WorldAPI.SlowMotion(0.1f); WorldAPI.SetAmbientLightColor(Color.red); WorldAPI.ScreenShake(1f, 0.5f); } public static void ResetDramaticEffect() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) WorldAPI.UnfreezeGame(); WorldAPI.SetAmbientLightColor(Color.white); } public static void ToggleRandomTeleport() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = default(Vector3); ((Vector3)(ref position))..ctor(Random.Range(-10f, 10f), 0f, Random.Range(-10f, 10f)); PlayerAPI.TeleportTo(position); } public static void SpawnSurpriseParticles(Vector3 position) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //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) //IL_0093: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 20; i++) { GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); val.transform.position = position; val.transform.localScale = Vector3.one * 0.1f; ((Object)val).name = "_Sparkle"; Rigidbody val2 = val.AddComponent(); val2.useGravity = false; val2.velocity = Random.onUnitSphere * Random.Range(1f, 4f); Material val3 = new Material(Shader.Find("Sprites/Default")); val3.color = Color.Lerp(Color.yellow, Color.white, Random.value); ((Renderer)val.GetComponent()).material = val3; Object.Destroy((Object)(object)val, 2f); } } public static void MakeDudesDance() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) foreach (ApertureDudeAI allDude in DudeAPI.GetAllDudes()) { if (!((Object)(object)allDude == (Object)null) && !((Object)(object)allDude.animator == (Object)null)) { allDude.alwaysTaunting = true; allDude.animator.SetFloat("speed", Random.Range(0.5f, 2f)); if ((Object)(object)allDude.agent != (Object)null) { allDude.agent.speed = Random.Range(3f, 8f); allDude.agent.SetDestination(((Component)allDude).transform.position + new Vector3(Random.Range(-3f, 3f), 0f, Random.Range(-3f, 3f))); } } } } } public static class GameAPI { public static class Xortex { public static GlobalManagerVRC Manager => GlobalManagerVRC.Instance; public static bool IsAvailable => (Object)(object)Manager != (Object)null; public static bool IsGameRunning => (Object)(object)Manager != (Object)null && Manager.GameIsRunning; public static bool IsInfiniteMode => (Object)(object)Manager != (Object)null && Manager.IsInfiniteMode; public static int CurrentScore => ((Object)(object)Manager != (Object)null) ? ((int)typeof(GlobalManagerVRC).GetField("currentScore", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(Manager)) : 0; public static PlayerVRC Player => (!((Object)(object)Manager != (Object)null)) ? ((PlayerVRC)null) : ((PlayerVRC)(typeof(GlobalManagerVRC).GetField("player", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(Manager))); public static bool IsPlayerUsingOverdrive => (Object)(object)Manager != (Object)null && Manager.IsPlayerUsingOverdrive; public static bool IsPlayerFightingBoss => (Object)(object)Manager != (Object)null && Manager.IsPlayerFightingBoss; public static bool IsWaitingForPlayer => (Object)(object)Manager != (Object)null && Manager.WaitingForPlayerToSpawn; public static void SpawnPlayer() { if ((Object)(object)Manager != (Object)null) { ((Component)Manager).SendMessage("Script", (object)null); } } public static void AddScore(int points) { if ((Object)(object)Manager != (Object)null) { Manager.AddScore(points); } } public static void IncrementMultiplier() { if ((Object)(object)Manager != (Object)null) { Manager.IncrementMultiplier(); } } public static void ResetMultiplier() { if ((Object)(object)Manager != (Object)null) { Manager.ResetMultiplier(); } } public static int GetMultiplier() { if ((Object)(object)Manager != (Object)null) { return (int)typeof(GlobalManagerVRC).GetField("currentMultiplier", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(Manager); } return 1; } public static void SetMultiplier(int multiplier) { if ((Object)(object)Manager != (Object)null) { FieldInfo field = typeof(GlobalManagerVRC).GetField("currentMultiplier", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(Manager, multiplier); } } } public static Vector3 GetPlayerPosition() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Manager != (Object)null) { Vector3? playerPosition = Manager.GetPlayerPosition(); return playerPosition.HasValue ? playerPosition.Value : Vector3.zero; } return Vector3.zero; } public static void DestroyOneNonBossEnemy() { if ((Object)(object)Manager != (Object)null) { Manager.DestroyOneNonBossEnemy(); } } public static void TriggerSpecialBlast() { if ((Object)(object)Manager != (Object)null) { Manager.TriggerSpecialBlast(); } } public static BossVRC GetBoss() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown if ((Object)(object)Manager != (Object)null) { return (BossVRC)(typeof(GlobalManagerVRC).GetField("bossInstance", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(Manager)); } return null; } public static void TriggerBossFight() { if ((Object)(object)Manager != (Object)null) { ((Component)Manager).SendMessage("TriggerBoss", (object)null); } } public static void SetScore(int score) { if ((Object)(object)Manager != (Object)null) { FieldInfo field = typeof(GlobalManagerVRC).GetField("currentScore", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(Manager, score); } } } public static EnemyVRC GetTutorialEnemyPrefab() { return Manager?.TutorialEnemyPrefab; } public static EnemyVRC GetEasyShooterPrefab() { return Manager?.EasyShooterPrefab; } public static EnemyVRC GetMediumShooterPrefab() { return Manager?.MediumShooterPrefab; } public static EnemyVRC GetHardShooterPrefab() { return Manager?.HardShooterPrefab; } public static EnemyVRC GetShotgunnerPrefab() { return Manager?.ShotgunnerPrefab; } public static EnemyVRC GetBigShooterPrefab() { return Manager?.BigShooterPrefab; } public static EnemyVRC GetSeekerPrefab() { return Manager?.SeekerPrefab; } public static EnemyVRC GetSeekerSwarmPrefab() { return Manager?.SeekerSwarmPrefab; } public static EnemyVRC GetDasherPrefab() { return Manager?.DasherPrefab; } public static EnemyVRC GetMineLayerPrefab() { return Manager?.MineLayerPrefab; } public static EnemyVRC GetSlicerPrefab() { return Manager?.SlicerPrefab; } public static EnemyVRC GetSpinnerPrefab() { return Manager?.SpinnerPrefab; } public static void SpawnRandomEnemy(Vector3 position) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) EnemyVRC[] source = (EnemyVRC[])(object)new EnemyVRC[5] { GetEasyShooterPrefab(), GetMediumShooterPrefab(), GetSeekerPrefab(), GetDasherPrefab(), GetShotgunnerPrefab() }; EnemyVRC[] array = source.Where((EnemyVRC p) => (Object)(object)p != (Object)null).ToArray(); if (array.Length != 0 && (Object)(object)Manager != (Object)null) { Manager.SpawnEnemy(array[Random.Range(0, array.Length)], position); } } public static void EnableOverdrive() { if ((Object)(object)Manager != (Object)null) { ((Component)Manager).SendMessage("EnableOverdrive", (object)null); } } public static void TriggerGameOver() { if ((Object)(object)Manager != (Object)null) { ((Component)Manager).SendMessage("GameOver", (object)null); } } } public static class Longbow { public static ApertureDudeMasterSpawner Spawner => ApertureDudeMasterSpawner.instance; public static bool IsAvailable => (Object)(object)Spawner != (Object)null; public static bool IsAssaultInProgress => (Object)(object)Spawner != (Object)null && Spawner.IsAssultInProgress(); public static int CurrentWave => ((Object)(object)Spawner != (Object)null) ? Spawner.currentWave : 0; public static int TotalWaves => ((Object)(object)Spawner != (Object)null) ? Spawner.wave.Length : 0; public static void SetCurrentWave(int wave) { if ((Object)(object)Spawner != (Object)null) { Spawner.currentWave = wave; } } public static GateHealthMeter GetGateHealthMeter() { return ((Object)(object)Spawner != (Object)null) ? Spawner.gateHealthMeter : null; } public static float GetGateHealth() { GateHealthMeter gateHealthMeter = GetGateHealthMeter(); return ((Object)(object)gateHealthMeter != (Object)null) ? ((float)gateHealthMeter.GetGateHealthState()) : 0f; } public static void SetGateHealth(float health) { GateHealthMeter gateHealthMeter = GetGateHealthMeter(); if ((Object)(object)gateHealthMeter != (Object)null) { FieldInfo field = typeof(GateHealthMeter).GetField("gateHealth", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(gateHealthMeter, health); } } } public static LongbowLeaderboard GetLeaderboard() { return LongbowLeaderboard.Instance; } public static int GetLongbowScore() { if ((Object)(object)LongbowLeaderboard.Instance == (Object)null) { return 0; } FieldInfo field = typeof(LongbowLeaderboard).GetField("longbowScore", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { return (int)field.GetValue(LongbowLeaderboard.Instance); } return 0; } public static void SetLongbowScore(int score) { if ((Object)(object)LongbowLeaderboard.Instance != (Object)null) { LongbowLeaderboard.Instance.AddToLongbowScore(score - GetLongbowScore()); } } public static ArcheryTarget[] GetArcheryTargets() { return Object.FindObjectsOfType(); } public static void ResetAllArcheryTargets() { ArcheryTarget[] archeryTargets = GetArcheryTargets(); foreach (ArcheryTarget val in archeryTargets) { if ((Object)(object)val != (Object)null) { ((Component)val).SendMessage("ResetTarget"); } } } public static void SpawnRabble(int count) { //IL_0053: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Spawner == (Object)null || Spawner.rabbleSourceGO == null) { return; } GameObject[] rabbleSourceGO = Spawner.rabbleSourceGO; foreach (GameObject val in rabbleSourceGO) { if ((Object)(object)val != (Object)null) { for (int j = 0; j < count; j++) { Object.Instantiate(val, val.transform.position + Random.insideUnitSphere * 0.5f, Quaternion.identity); } } } } public static void TriggerWin() { if ((Object)(object)Spawner != (Object)null && Spawner.winEvent != null) { Spawner.winEvent.Invoke(); } } public static void TriggerLose() { if ((Object)(object)Spawner != (Object)null && Spawner.loseEvent != null) { Spawner.loseEvent.Invoke(); } } } public static class Slingshot { public static SlingshotGameSequence GetGameSequence() { return Object.FindObjectOfType(); } public static SlingshotCoreToy GetCore() { return Object.FindObjectOfType(); } public static SlingshotProgressBar GetProgressBar() { return Object.FindObjectOfType(); } public static void SpawnBall() { SlingshotProgressBar progressBar = GetProgressBar(); if ((Object)(object)progressBar != (Object)null) { ((Component)progressBar).SendMessage("SpawnStartingBalls"); } } public static int GetCurrentScore() { SlingshotLeaderboard val = Object.FindObjectOfType(); if ((Object)(object)val == (Object)null) { return 0; } FieldInfo field = typeof(SlingshotLeaderboard).GetField("score", BindingFlags.Instance | BindingFlags.NonPublic); return (field != null) ? ((int)field.GetValue(val)) : 0; } public static SlingshotAnnouncer GetAnnouncer() { return Object.FindObjectOfType(); } public static void SpawnAllBalls() { SlingshotProgressBar progressBar = GetProgressBar(); if ((Object)(object)progressBar != (Object)null) { ((Component)progressBar).SendMessage("SpawnAllBalls", (object)null); } } public static SlingshotTower[] GetAllTowers() { return Object.FindObjectsOfType(); } public static void ResetAllTowers() { SlingshotTower[] allTowers = GetAllTowers(); foreach (SlingshotTower val in allTowers) { if ((Object)(object)val != (Object)null) { ((Component)val).SendMessage("ResetTower", (object)null); } } } } public static class RobotRepair { public static bool IsAvailable => (Object)(object)GetGameManager() != (Object)null; public static GameManager GetGameManager() { return Object.FindObjectOfType(); } public static void SpawnRobot() { GameManager gameManager = GetGameManager(); if ((Object)(object)gameManager != (Object)null) { ((Component)gameManager).SendMessage("SpawnRobot", (object)null); } } public static void ResetGame() { GameManager gameManager = GetGameManager(); if ((Object)(object)gameManager != (Object)null) { ((Component)gameManager).SendMessage("ResetGame", (object)null); } } } public static class VesperPeak { public static bool IsAvailable => (Object)(object)GetManager() != (Object)null; public static VesperPeakManager GetManager() { return Object.FindObjectOfType(); } public static void TeleportToNorth() { //IL_0029: 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) VesperPeakManager manager = GetManager(); if ((Object)(object)manager != (Object)null && (Object)(object)manager.vesperPeakNorthSpawnTransform != (Object)null) { PlayerAPI.TeleportTo(manager.vesperPeakNorthSpawnTransform.position, (Quaternion?)manager.vesperPeakNorthSpawnTransform.rotation); } } public static void TeleportToSouth() { //IL_0029: 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) VesperPeakManager manager = GetManager(); if ((Object)(object)manager != (Object)null && (Object)(object)manager.vesperPeakSouthSpawnTransform != (Object)null) { PlayerAPI.TeleportTo(manager.vesperPeakSouthSpawnTransform.position, (Quaternion?)manager.vesperPeakSouthSpawnTransform.rotation); } } } public static class Chess { public static bool IsAvailable => (Object)(object)GetManager() != (Object)null; public static ChessGameManager GetManager() { return ChessGameManager.instance; } public static void ResetBoard() { ChessGameManager manager = GetManager(); if ((Object)(object)manager != (Object)null) { ((Component)manager).SendMessage("ResetBoard", (object)null); } } public static void SetPieceColors(Color black, Color white) { //IL_0019: 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) ChessGameManager manager = GetManager(); if ((Object)(object)manager != (Object)null) { manager.blackPieceMaterial.color = black; manager.whitePieceMaterial.color = white; } } public static void ScatterPieces() { //IL_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) ChessPiece[] array = Object.FindObjectsOfType(); foreach (ChessPiece val in array) { if ((Object)(object)val != (Object)null) { Rigidbody component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.isKinematic = false; component.AddExplosionForce(200f, ((Component)val).transform.position + Vector3.up, 3f); } } } } } public static class Cheats { public static void UnlockAllLevels() { if ((Object)(object)PlayerData.instance != (Object)null) { string[] allSceneNames = MiniGamesSceneManifest.GetAllSceneNames(); string[] array = allSceneNames; foreach (string text in array) { PlayerData.instance.DebugVisitLevel(text); } PlayerData.instance.allScenesVisited = true; PlayerData.instance.allExperimentsComplete = true; PlayerData.instance.Save(); } } public static void ResetAllData() { if ((Object)(object)PlayerData.instance != (Object)null) { ((Component)PlayerData.instance).SendMessage("ResetAndSave"); } } public static void VisitAllLevels() { if ((Object)(object)PlayerData.instance != (Object)null) { ((Component)PlayerData.instance).SendMessage("VisitAllLevelsAndSave"); } } public static void AddTokens(int count) { if ((Object)(object)PlayerData.instance != (Object)null) { FieldInfo field = typeof(PlayerData).GetField("tokens", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { int num = (int)field.GetValue(PlayerData.instance); field.SetValue(PlayerData.instance, num + count); PlayerData.instance.Save(); } } } public static void UnlockAllPostcards() { if ((Object)(object)PlayerData.instance != (Object)null) { FieldInfo field = typeof(PlayerData).GetField("unlockedPostcards", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(PlayerData.instance, MiniGamesSceneManifest.GetAllSceneNames().ToArray()); } PlayerData.instance.Save(); } } public static void MaxAllStats() { UnlockAllLevels(); AddTokens(9999); UnlockAllPostcards(); } } } public static class HubAPI { internal class DeskItemDef { public string id; public string displayName; public string sceneName; public Action callback; public Color color; public GameObject prefab; } private static readonly List _deskItems = new List(); public static HubAnnouncer GetAnnouncer() { return HubAnnouncer.instance; } public static void TriggerAnnouncerVO(string voCategory) { HubAnnouncer announcer = GetAnnouncer(); if ((Object)(object)announcer != (Object)null) { ((Component)announcer).SendMessage("PlayCategory", (object)voCategory); } } public static IntroAnnouncer GetIntroAnnouncer() { return Object.FindObjectOfType(); } public static ReturnToHubMenu GetReturnToHubMenu() { return Object.FindObjectOfType(); } public static void ShowInventory() { ReturnToHubMenu returnToHubMenu = GetReturnToHubMenu(); if ((Object)(object)returnToHubMenu != (Object)null) { ((Component)returnToHubMenu).SendMessage("ShowInventory"); } } public static void HideInventory() { ReturnToHubMenu returnToHubMenu = GetReturnToHubMenu(); if ((Object)(object)returnToHubMenu != (Object)null) { ((Component)returnToHubMenu).SendMessage("HideInventory"); } } public static void ForceHideInventory() { ReturnToHubMenu returnToHubMenu = GetReturnToHubMenu(); if ((Object)(object)returnToHubMenu != (Object)null) { returnToHubMenu.ForceHideInventory(); } } public static Elevator GetElevator() { return Object.FindObjectOfType(); } public static void OpenElevatorDoors() { Elevator elevator = GetElevator(); if ((Object)(object)elevator != (Object)null) { ((Component)elevator).SendMessage("OpenDoors"); } } public static void CloseElevatorDoors() { Elevator elevator = GetElevator(); if ((Object)(object)elevator != (Object)null) { ((Component)elevator).SendMessage("CloseDoors"); } } public static DeskMagnifier GetDeskMagnifier() { return Object.FindObjectOfType(); } public static PostcardPlug GetPostcardPlug() { return Object.FindObjectOfType(); } public static string GetPluggedPostcardScene() { PostcardPlug postcardPlug = GetPostcardPlug(); if ((Object)(object)postcardPlug != (Object)null) { return postcardPlug.GetPluggedInPostcardScene(); } return ""; } public static Whiteboard GetWhiteboard() { return Object.FindObjectOfType(); } public static TitleScreenManager GetTitleScreenManager() { return Object.FindObjectOfType(); } public static HubConveyorItem[] GetAllConveyorItems() { return Object.FindObjectsOfType(); } public static HubCoffeeMugSpawner GetCoffeeMugSpawner() { return Object.FindObjectOfType(); } public static void SpawnCoffeeMug() { HubCoffeeMugSpawner coffeeMugSpawner = GetCoffeeMugSpawner(); if ((Object)(object)coffeeMugSpawner != (Object)null) { ((Component)coffeeMugSpawner).SendMessage("SpawnMug", (object)null); } } public static DioramaSceneShift GetDioramaShift() { return Object.FindObjectOfType(); } public static void TriggerDioramaShift() { DioramaSceneShift dioramaShift = GetDioramaShift(); if ((Object)(object)dioramaShift != (Object)null) { ((Component)dioramaShift).SendMessage("Shift", (object)null); } } public static ConveyorBehavior[] GetAllConveyorBelts() { return Object.FindObjectsOfType(); } public static void SetConveyorSpeed(float speed) { ConveyorBehavior[] allConveyorBelts = GetAllConveyorBelts(); foreach (ConveyorBehavior val in allConveyorBelts) { if ((Object)(object)val != (Object)null) { FieldInfo field = typeof(ConveyorBehavior).GetField("speed", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, speed); } } } } public static void ToggleHubLights(bool on) { Light[] array = Object.FindObjectsOfType(); foreach (Light val in array) { if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = on; } } } public static void PlayHubJingle() { HubAnnouncer announcer = GetAnnouncer(); if ((Object)(object)announcer != (Object)null) { ((Component)announcer).SendMessage("PlayJingle", (object)null); } } public static string RegisterDeskItem(string displayName, string sceneName) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return RegisterDeskItem(displayName, sceneName, Color.white); } public static string RegisterDeskItem(string displayName, string sceneName, Color color) { //IL_0034: 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) string text = Guid.NewGuid().ToString("N"); _deskItems.Add(new DeskItemDef { id = text, displayName = displayName, sceneName = sceneName, color = color }); HubItemManager.OnItemsChanged(); return text; } public static string RegisterDeskItem(string displayName, Action callback) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return RegisterDeskItem(displayName, callback, Color.white); } public static string RegisterDeskItem(string displayName, Action callback, Color color) { //IL_0034: 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) string text = Guid.NewGuid().ToString("N"); _deskItems.Add(new DeskItemDef { id = text, displayName = displayName, callback = callback, color = color }); HubItemManager.OnItemsChanged(); return text; } public static void UnregisterDeskItem(string id) { _deskItems.RemoveAll((DeskItemDef d) => d.id == id); HubItemManager.OnItemsChanged(); } public static string RegisterDeskItem(string displayName, GameObject prefab) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return RegisterDeskItem(displayName, prefab, Color.white); } public static string RegisterDeskItem(string displayName, GameObject prefab, Color color) { //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) string text = Guid.NewGuid().ToString("N"); if ((Object)(object)prefab != (Object)null) { Object.DontDestroyOnLoad((Object)(object)prefab); DisablePrefabRenderers(prefab); } _deskItems.Add(new DeskItemDef { id = text, displayName = displayName, prefab = prefab, color = color }); HubItemManager.OnItemsChanged(); return text; } public static string RegisterDeskItem(string displayName, GameObject prefab, string sceneName) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) return RegisterDeskItem(displayName, prefab, sceneName, Color.white); } public static string RegisterDeskItem(string displayName, GameObject prefab, string sceneName, Color color) { //IL_0056: 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) string text = Guid.NewGuid().ToString("N"); if ((Object)(object)prefab != (Object)null) { Object.DontDestroyOnLoad((Object)(object)prefab); DisablePrefabRenderers(prefab); } _deskItems.Add(new DeskItemDef { id = text, displayName = displayName, prefab = prefab, sceneName = sceneName, color = color }); HubItemManager.OnItemsChanged(); return text; } public static string RegisterDeskItem(string displayName, GameObject prefab, Action callback) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) return RegisterDeskItem(displayName, prefab, callback, Color.white); } public static string RegisterDeskItem(string displayName, GameObject prefab, Action callback, Color color) { //IL_0056: 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) string text = Guid.NewGuid().ToString("N"); if ((Object)(object)prefab != (Object)null) { Object.DontDestroyOnLoad((Object)(object)prefab); DisablePrefabRenderers(prefab); } _deskItems.Add(new DeskItemDef { id = text, displayName = displayName, prefab = prefab, callback = callback, color = color }); HubItemManager.OnItemsChanged(); return text; } private static void DisablePrefabRenderers(GameObject prefab) { Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { val.enabled = false; } } public static void ClearDeskItems() { _deskItems.Clear(); HubItemManager.OnItemsChanged(); } internal static IReadOnlyList GetDeskItems() { return _deskItems; } } internal static class HubItemManager { private static GameObject _itemsRoot; private static readonly List _spawnedItems; static HubItemManager() { _spawnedItems = new List(); Debug.Log((object)"[TheLabModdingLib] HubItemManager static constructor - subscribing to sceneLoaded"); SceneManager.sceneLoaded += OnSceneLoaded; } internal static void OnItemsChanged() { if (SceneAPI.IsInHub()) { RefreshItems(); } } private static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)$"[TheLabModdingLib] OnSceneLoaded: '{((Scene)(ref scene)).name}' (mode={mode})"); if (((Scene)(ref scene)).name == "hub") { RefreshItems(); } else { Cleanup(); } } private static void RefreshItems() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) Cleanup(); IReadOnlyList deskItems = HubAPI.GetDeskItems(); Debug.Log((object)$"[TheLabModdingLib] RefreshItems: {deskItems.Count} registered items"); if (deskItems.Count == 0) { return; } Vector3 val = FindDeskPosition(); Debug.Log((object)$"[TheLabModdingLib] FindDeskPosition returned: {val}"); if (val == Vector3.zero) { return; } _itemsRoot = new GameObject("_ModDeskItems"); _itemsRoot.transform.position = val; float num = 0.15f; int num2 = Mathf.Min(deskItems.Count, 4); int num3 = Mathf.CeilToInt((float)deskItems.Count / (float)num2); for (int i = 0; i < deskItems.Count; i++) { HubAPI.DeskItemDef def = deskItems[i]; int num4 = i / num2; int num5 = i % num2; float num6 = ((float)num5 - (float)(num2 - 1) * 0.5f) * num; float num7 = ((float)num4 - (float)(num3 - 1) * 0.5f) * num + 0.15f; GameObject val2 = SpawnItem(def, new Vector3(num6, 0.05f, num7)); if ((Object)(object)val2 != (Object)null) { _spawnedItems.Add(val2); } } } private static Vector3 FindDeskPosition() { //IL_0019: 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) //IL_002f: 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_006b: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) DeskMagnifier val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { Vector3 position = ((Component)val).transform.position; position.y += 0.05f; return position; } DeskLampArm val2 = Object.FindObjectOfType(); if ((Object)(object)val2 != (Object)null) { Vector3 position2 = ((Component)val2).transform.position; position2.y += 0.05f; return position2; } return Vector3.zero; } private static GameObject SpawnItem(HubAPI.DeskItemDef def, Vector3 localPos) { //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Expected O, but got Unknown //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) GameObject val; if ((Object)(object)def.prefab != (Object)null) { string displayName = def.displayName; MeshFilter component = def.prefab.GetComponent(); int? obj; if (component == null) { obj = null; } else { Mesh sharedMesh = component.sharedMesh; obj = ((sharedMesh != null) ? new int?(sharedMesh.vertexCount) : ((int?)null)); } Debug.Log((object)$"[HubItemManager] Spawning prefab '{displayName}' mesh={obj} verts"); val = Object.Instantiate(def.prefab, _itemsRoot.transform); ((Object)val).name = "ModItem_" + def.displayName; val.transform.localPosition = localPos; val.transform.localRotation = Quaternion.identity; MeshRenderer[] componentsInChildren = val.GetComponentsInChildren(); MeshRenderer[] array = componentsInChildren; foreach (MeshRenderer val2 in array) { Material[] materials = ((Renderer)val2).materials; foreach (Material val3 in materials) { val3.color = def.color; } } } else { Debug.Log((object)("[HubItemManager] Spawning CUBE fallback for '" + def.displayName + "'")); val = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val).name = "ModItem_" + def.displayName; val.transform.SetParent(_itemsRoot.transform, false); val.transform.localPosition = localPos; val.transform.localScale = Vector3.one * 0.08f; val.transform.localRotation = Quaternion.identity; Object.DestroyImmediate((Object)(object)val.GetComponent()); MeshRenderer component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { Material val4 = new Material(Shader.Find("Standard")); val4.color = def.color; ((Renderer)component2).material = val4; } } if ((Object)(object)val.GetComponent() == (Object)null) { MeshFilter component3 = val.GetComponent(); Bounds? obj2; if (component3 == null) { obj2 = null; } else { Mesh sharedMesh2 = component3.sharedMesh; obj2 = ((sharedMesh2 != null) ? new Bounds?(sharedMesh2.bounds) : ((Bounds?)null)); } Bounds? val5 = obj2; if (val5.HasValue) { BoxCollider val6 = val.AddComponent(); Bounds value = val5.Value; val6.center = ((Bounds)(ref value)).center; value = val5.Value; val6.size = ((Bounds)(ref value)).size; } else { SphereCollider val7 = val.AddComponent(); val7.radius = 0.5f; } } if ((Object)(object)val.GetComponent() == (Object)null) { Rigidbody val8 = val.AddComponent(); val8.isKinematic = false; val8.useGravity = true; } VRInteractable interactable = val.AddComponent(); interactable.highlightOnHover = true; interactable.attachEaseIn = true; interactable.hideHandOnAttach = false; VRThrowable val9 = val.AddComponent(); val9.restoreOriginalParent = false; string itemScene = def.sceneName; Action itemCallback = def.callback; OnAttachedToHandDelegate onAttach = null; onAttach = (OnAttachedToHandDelegate)delegate { interactable.onAttachedToHand -= onAttach; if (!string.IsNullOrEmpty(itemScene)) { SceneAPI.LoadScene(itemScene); } else { itemCallback?.Invoke(); } }; interactable.onAttachedToHand += onAttach; return val; } private static void Cleanup() { foreach (GameObject spawnedItem in _spawnedItems) { if ((Object)(object)spawnedItem != (Object)null) { Object.Destroy((Object)(object)spawnedItem); } } _spawnedItems.Clear(); if ((Object)(object)_itemsRoot != (Object)null) { Object.Destroy((Object)(object)_itemsRoot); _itemsRoot = null; } } } public static class InputAPI { private static bool _initialized; public static void Initialize() { if (!_initialized) { _initialized = true; if ((SteamVR_ActionSet)(object)SteamVR_Actions.tool != (SteamVR_ActionSet)null) { ((SteamVR_ActionSet)SteamVR_Actions.tool).Activate((SteamVR_Input_Sources)0, 0, false); } } } public static void Shutdown() { if ((SteamVR_ActionSet)(object)SteamVR_Actions.tool != (SteamVR_ActionSet)null) { ((SteamVR_ActionSet)SteamVR_Actions.tool).Deactivate((SteamVR_Input_Sources)0); } _initialized = false; } public static Vector2 GetLeftThumbstickAxis() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) return SteamVR_Actions.tool_RadialMenuPos.GetAxis((SteamVR_Input_Sources)1); } public static Vector2 GetRightThumbstickAxis() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) return SteamVR_Actions.tool_RadialMenuPos.GetAxis((SteamVR_Input_Sources)2); } public static Vector2 GetLeftThumbstickAxisNormalized() { //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return Normalize(GetLeftThumbstickAxis()); } public static Vector2 GetRightThumbstickAxisNormalized() { //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return Normalize(GetRightThumbstickAxis()); } private static Vector2 Normalize(Vector2 axis) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) float magnitude = ((Vector2)(ref axis)).magnitude; if (magnitude > 0.15f) { return (magnitude > 1f) ? ((Vector2)(ref axis)).normalized : axis; } return Vector2.zero; } } public static class ItemAPI { private static FieldInfo _enemiesField; private static FieldInfo EnemiesField { get { if (_enemiesField == null) { _enemiesField = typeof(GlobalManagerVRC).GetField("enemies", BindingFlags.Instance | BindingFlags.NonPublic); } return _enemiesField; } } private static IEnumerable GetEnemiesInternal() { if ((Object)(object)GlobalManagerVRC.Instance == (Object)null || EnemiesField == null) { return new List(); } return (EnemiesField.GetValue(GlobalManagerVRC.Instance) as IEnumerable) ?? new List(); } public static List GetAllItems() { List list = new List(); VRThrowable[] source = Object.FindObjectsOfType(); list.AddRange(source.Select((VRThrowable t) => ((Component)t).gameObject)); return list; } public static List GetAllItemsWithComponent() where T : Component { return (from t in Object.FindObjectsOfType() select ((Component)t).gameObject).ToList(); } public static List GetItemsByTag(string tag) { return GameObject.FindGameObjectsWithTag(tag).ToList(); } public static List GetItemsByName(string name) { return (from go in Resources.FindObjectsOfTypeAll() where ((Object)go).name.Contains(name) select go).ToList(); } public static void DestroyItem(GameObject item) { if ((Object)(object)item != (Object)null) { Object.Destroy((Object)(object)item); } } public static void DestroyAllItems() { List allItems = GetAllItems(); foreach (GameObject item in allItems) { if ((Object)(object)item != (Object)null) { Object.Destroy((Object)(object)item); } } } public static void SetItemPosition(GameObject item, Vector3 position) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)item != (Object)null) { item.transform.position = position; } } public static void SetItemRotation(GameObject item, Quaternion rotation) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)item != (Object)null) { item.transform.rotation = rotation; } } public static Vector3 GetItemPosition(GameObject item) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) return ((Object)(object)item != (Object)null) ? item.transform.position : Vector3.zero; } public static void SetItemKinematic(GameObject item, bool kinematic) { Rigidbody val = ((item != null) ? item.GetComponent() : null); if ((Object)(object)val != (Object)null) { val.isKinematic = kinematic; } } public static void SetItemVelocity(GameObject item, Vector3 velocity) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) Rigidbody val = ((item != null) ? item.GetComponent() : null); if ((Object)(object)val != (Object)null) { val.velocity = velocity; } } public static void AddForceToItem(GameObject item, Vector3 force, ForceMode mode = (ForceMode)0) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Rigidbody val = ((item != null) ? item.GetComponent() : null); if ((Object)(object)val != (Object)null) { val.AddForce(force, mode); } } public static void AddTorqueToItem(GameObject item, Vector3 torque, ForceMode mode = (ForceMode)0) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Rigidbody val = ((item != null) ? item.GetComponent() : null); if ((Object)(object)val != (Object)null) { val.AddTorque(torque, mode); } } public static void MakeItemBouncy(GameObject item, float bounciness = 1f) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)item == (Object)null)) { Collider[] componentsInChildren = item.GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val in array) { PhysicMaterial val2 = (PhysicMaterial)(((object)val.sharedMaterial) ?? ((object)new PhysicMaterial())); val2.bounciness = bounciness; val2.bounceCombine = (PhysicMaterialCombine)3; val.sharedMaterial = val2; val.material = val2; } } } public static void MakeAllItemsBouncy(float bounciness = 1f) { foreach (GameObject allItem in GetAllItems()) { MakeItemBouncy(allItem, bounciness); } } public static void AddRandomForce(GameObject item, float maxForce = 10f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) AddForceToItem(item, Random.insideUnitSphere * maxForce, (ForceMode)1); } public static void LaunchItemUpward(GameObject item, float force = 10f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) AddForceToItem(item, Vector3.up * force, (ForceMode)1); } public static void SpawnExplosion(Vector3 position, float radius = 5f, float force = 500f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(position, radius); Collider[] array2 = array; foreach (Collider val in array2) { Rigidbody attachedRigidbody = val.attachedRigidbody; if ((Object)(object)attachedRigidbody != (Object)null) { attachedRigidbody.AddExplosionForce(force, position, radius, 1f); } } } public static List GetAllRigidbodies() { return Object.FindObjectsOfType().ToList(); } public static List GetAllBreakables() { List list = new List(); list.AddRange(from p in Object.FindObjectsOfType() select ((Component)p).gameObject); list.AddRange(from p in Object.FindObjectsOfType() select ((Component)p).gameObject); list.AddRange(from d in Object.FindObjectsOfType() select ((Component)d).gameObject); return list; } public static void BreakAllBreakables() { PropBreakable[] array = Object.FindObjectsOfType(); foreach (PropBreakable val in array) { Object.Destroy((Object)(object)((Component)val).gameObject); } } public static GameObject SpawnPrimitive(PrimitiveType type, Vector3 position, Color color, float scale = 0.1f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_005f: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive(type); val.transform.position = position; val.transform.localScale = Vector3.one * scale; Rigidbody val2 = val.AddComponent(); val2.useGravity = true; MeshRenderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Material val3 = new Material(Shader.Find("Standard")); val3.color = color; ((Renderer)component).material = val3; } return val; } public static List GetAllEnemies() { List list = new List(); foreach (object item in GetEnemiesInternal()) { EnemyVRC val = (EnemyVRC)((item is EnemyVRC) ? item : null); if (val != null) { list.Add(val); } } return list; } public static int GetEnemyCount() { return GetAllEnemies().Count; } public static void DestroyAllEnemies() { foreach (EnemyVRC allEnemy in GetAllEnemies()) { if ((Object)(object)allEnemy != (Object)null) { allEnemy.DestroyUnconditionally(); } } } public static EnemyVRC SpawnEnemy(EnemyVRC prefab, Vector3 position) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GlobalManagerVRC.Instance == (Object)null) { return null; } return GlobalManagerVRC.Instance.SpawnEnemy(prefab, position); } public static void KillAllEnemies() { foreach (EnemyVRC allEnemy in GetAllEnemies()) { if ((Object)(object)allEnemy != (Object)null) { allEnemy.TakeLaserDamage(999999); } } } public static PickupVRC[] GetAllPickups() { return Object.FindObjectsOfType(); } public static Arrow[] GetAllArrows() { return Object.FindObjectsOfType(); } public static void RemoveAllArrows() { Arrow[] allArrows = GetAllArrows(); foreach (Arrow val in allArrows) { if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } public static SlingshotProjectile[] GetAllSlingshotProjectiles() { return Object.FindObjectsOfType(); } public static void DestroyAllSlingshotProjectiles() { SlingshotProjectile[] allSlingshotProjectiles = GetAllSlingshotProjectiles(); foreach (SlingshotProjectile val in allSlingshotProjectiles) { if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } public static Balloon[] GetAllBalloons() { return Object.FindObjectsOfType(); } public static void PopAllBalloons() { Balloon[] allBalloons = GetAllBalloons(); foreach (Balloon val in allBalloons) { if ((Object)(object)val != (Object)null) { val.EndBalloonLife(); } } } public static Block[] GetAllBlocks() { return Object.FindObjectsOfType(); } public static void ExplodeAllBlocks() { Block[] allBlocks = GetAllBlocks(); foreach (Block val in allBlocks) { if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } } public static class ModelAPI { public static GameObject LoadOBJ(string path, string objectName = null) { //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Expected O, but got Unknown //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Expected O, but got Unknown //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Expected O, but got Unknown //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) if (!File.Exists(path)) { Debug.LogError((object)("[ModelAPI] File not found: " + path)); return null; } string[] array = File.ReadAllLines(path); Dictionary dictionary = new Dictionary(); string[] array2 = array; foreach (string text in array2) { string text2 = text.Trim(); if (text2.StartsWith("mtllib ")) { string text3 = text2.Substring(7).Trim(); string directoryName = Path.GetDirectoryName(path); string path2 = Path.Combine(directoryName, text3.Replace('/', Path.DirectorySeparatorChar)); if (File.Exists(path2)) { LoadMTL(path2, dictionary); } } } List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); List list5 = new List(); List list6 = new List(); List list7 = new List(); string item = ""; bool flag = objectName == null; string[] array3 = array; foreach (string text4 in array3) { string text5 = text4.Trim(); if (text5.Length == 0 || text5.StartsWith("#") || text5.StartsWith("mtllib ")) { continue; } string[] array4 = text5.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (array4.Length == 0) { continue; } switch (array4[0]) { case "o": if (objectName != null) { flag = array4.Length > 1 && array4[1] == objectName; } break; case "usemtl": if (array4.Length > 1) { item = array4[1]; } break; case "v": if (flag && array4.Length >= 4) { list.Add(new Vector3(ParseFloat(array4[1]), ParseFloat(array4[2]), ParseFloat(array4[3]))); } break; case "vt": if (flag && array4.Length >= 3) { list2.Add(new Vector2(ParseFloat(array4[1]), ParseFloat(array4[2]))); } break; case "vn": if (flag && array4.Length >= 4) { list3.Add(new Vector3(ParseFloat(array4[1]), ParseFloat(array4[2]), ParseFloat(array4[3]))); } break; case "f": { if (!flag) { break; } for (int k = 1; k < array4.Length; k++) { int uvIdx; int nIdx; int num = ParseFaceIndex(array4[k], out uvIdx, out nIdx); if (num >= 0) { list4.Add(num); list5.Add(uvIdx); list6.Add(nIdx); list7.Add(item); } } break; } } } if (list4.Count < 3) { Debug.LogError((object)("[ModelAPI] No valid faces found in " + path)); return null; } List list8 = new List(); foreach (string item2 in list7) { if (!list8.Contains(item2)) { list8.Add(item2); } } int count = list8.Count; List[] array5 = new List[count]; for (int l = 0; l < count; l++) { array5[l] = new List(); } List list9 = new List(); List list10 = new List(); List list11 = new List(); Dictionary dictionary2 = new Dictionary(); bool flag2 = list2.Count > 0; bool flag3 = list3.Count > 0; for (int m = 0; m < list4.Count; m++) { int num2 = m; if (!dictionary2.ContainsKey(num2)) { dictionary2[num2] = list9.Count; int num3 = list4[num2]; list9.Add((num3 >= 0 && num3 < list.Count) ? list[num3] : Vector3.zero); if (flag2) { int num4 = list5[num2]; list10.Add((num4 >= 0 && num4 < list2.Count) ? list2[num4] : Vector2.zero); } if (flag3) { int num5 = list6[num2]; list11.Add((num5 >= 0 && num5 < list3.Count) ? list3[num5] : Vector3.up); } } int num6 = list8.IndexOf(list7[m]); array5[num6].Add(dictionary2[num2]); } Mesh val = new Mesh(); val.vertices = list9.ToArray(); val.triangles = new int[0]; if (flag2) { val.uv = list10.ToArray(); } if (flag3) { val.normals = list11.ToArray(); } val.subMeshCount = count; for (int n = 0; n < count; n++) { val.SetTriangles(array5[n].ToArray(), n); } val.RecalculateBounds(); if (!flag3) { val.RecalculateNormals(); } NormalizeScale(val, 0.2f); val.RecalculateBounds(); if (!flag3) { val.RecalculateNormals(); } GameObject val2 = new GameObject(Path.GetFileNameWithoutExtension(path)); Object.DontDestroyOnLoad((Object)(object)val2); MeshFilter val3 = val2.AddComponent(); val3.sharedMesh = val; MeshRenderer val4 = val2.AddComponent(); Material[] array6 = (Material[])(object)new Material[count]; for (int num7 = 0; num7 < count; num7++) { Material val5 = new Material(Shader.Find("Standard")); if (dictionary.TryGetValue(list8[num7], out var value)) { val5.color = value; } array6[num7] = val5; } ((Renderer)val4).materials = array6; object[] obj = new object[5] { list.Count, list9.Count, list4.Count / 3, null, null }; Bounds bounds = val.bounds; obj[3] = ((Bounds)(ref bounds)).size; obj[4] = count; Debug.Log((object)string.Format("[ModelAPI] Mesh: {0} source verts, {1} unique verts, {2} triangles, bounds={3}, materials={4}", obj)); return val2; } private static void LoadMTL(string path, Dictionary colors) { //IL_00db: Unknown result type (might be due to invalid IL or missing references) string text = ""; string[] array = File.ReadAllLines(path); foreach (string text2 in array) { string text3 = text2.Trim(); if (text3.Length == 0 || text3.StartsWith("#")) { continue; } string[] array2 = text3.Split(new char[2] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); if (array2.Length != 0) { if (array2[0] == "newmtl" && array2.Length > 1) { text = array2[1]; } else if (array2[0] == "Kd" && array2.Length >= 4 && text.Length > 0) { colors[text] = new Color(ParseFloat(array2[1]), ParseFloat(array2[2]), ParseFloat(array2[3])); } } } } private static void NormalizeScale(Mesh mesh, float maxSize) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00ca: Unknown result type (might be due to invalid IL or missing references) Vector3[] vertices = mesh.vertices; if (vertices.Length == 0) { return; } Bounds val = default(Bounds); ((Bounds)(ref val))..ctor(vertices[0], Vector3.zero); Vector3[] array = vertices; foreach (Vector3 val2 in array) { ((Bounds)(ref val)).Encapsulate(val2); } float num = Mathf.Max(new float[3] { ((Bounds)(ref val)).size.x, ((Bounds)(ref val)).size.y, ((Bounds)(ref val)).size.z }); if (!(num < 0.001f)) { float num2 = maxSize / num; Vector3 center = ((Bounds)(ref val)).center; for (int j = 0; j < vertices.Length; j++) { vertices[j] = (vertices[j] - center) * num2; } mesh.vertices = vertices; } } private static float ParseFloat(string s) { float result; return float.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out result) ? result : 0f; } private static int ParseFaceIndex(string token, out int uvIdx, out int nIdx) { uvIdx = -1; nIdx = -1; string[] array = token.Split(new char[1] { '/' }); if (array.Length == 0) { return -1; } int result; int num = (int.TryParse(array[0], out result) ? result : 0); if (num == 0) { return -1; } int result2 = ((num > 0) ? (num - 1) : num); if (array.Length >= 2 && array[1].Length > 0) { int.TryParse(array[1], out uvIdx); } if (array.Length >= 3 && array[2].Length > 0) { int.TryParse(array[2], out nIdx); } if (uvIdx > 0) { uvIdx--; } if (nIdx > 0) { nIdx--; } return result2; } } public static class PlanetAPI { public static bool IsAvailable => (Object)(object)GetManager() != (Object)null; public static PlanetManager GetManager() { return Object.FindObjectOfType(); } public static PlanetObject[] GetAllPlanets() { return Object.FindObjectsOfType(); } public static int GetPlanetCount() { return GetAllPlanets().Length; } public static void SetSunRotation(Quaternion rotation) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) PlanetManager manager = GetManager(); if ((Object)(object)manager != (Object)null) { object? obj = typeof(PlanetManager).GetField("sunTransform", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(manager); Transform val = (Transform)((obj is Transform) ? obj : null); if ((Object)(object)val != (Object)null) { val.rotation = rotation; } } } public static Quaternion GetSunRotation() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_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) PlanetManager manager = GetManager(); if ((Object)(object)manager != (Object)null) { object? obj = typeof(PlanetManager).GetField("sunTransform", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(manager); Transform val = (Transform)((obj is Transform) ? obj : null); if ((Object)(object)val != (Object)null) { return val.rotation; } } return Quaternion.identity; } public static void SetTimeOfDay(float time01) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Lerp(0f, 360f, Mathf.Clamp01(time01)); SetSunRotation(Quaternion.Euler(num, 0f, 0f)); } public static void SetPlanetRotationSpeed(float speed) { PlanetObject[] allPlanets = GetAllPlanets(); foreach (PlanetObject val in allPlanets) { if ((Object)(object)val != (Object)null) { FieldInfo field = typeof(PlanetObject).GetField("rotationSpeed", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, speed); } } } } public static void TogglePlanetOrbits(bool active) { PlanetObject[] allPlanets = GetAllPlanets(); foreach (PlanetObject val in allPlanets) { if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = active; } } } public static void SetCameraFocus(string planetName) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) PlanetObject[] allPlanets = GetAllPlanets(); foreach (PlanetObject val in allPlanets) { if ((Object)(object)val != (Object)null && ((Object)val).name.Contains(planetName)) { Camera main = Camera.main; if ((Object)(object)main != (Object)null) { ((Component)main).transform.position = ((Component)val).transform.position + new Vector3(0f, 0f, -3f); ((Component)main).transform.LookAt(((Component)val).transform); } } } } public static PlanetSeat[] GetAllPlanetSeats() { return Object.FindObjectsOfType(); } public static void SetGravityToPlanetSurface() { PlanetManager manager = GetManager(); if ((Object)(object)manager != (Object)null) { FieldInfo field = typeof(PlanetManager).GetField("useSurfaceGravity", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(manager, true); } } } public static void ResetGravityToNormal() { PlanetManager manager = GetManager(); if ((Object)(object)manager != (Object)null) { FieldInfo field = typeof(PlanetManager).GetField("useSurfaceGravity", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(manager, false); } } } } public static class PlayerAPI { public static VRPlayer VRPlayerInstance => VRPlayer.instance; public static Transform HMDTransform { get { if ((Object)(object)VRPlayer.instance != (Object)null && (Object)(object)VRPlayer.instance.hmdTransform != (Object)null) { return VRPlayer.instance.hmdTransform; } return null; } } public static Vector3 HMDPosition { get { //IL_0018: 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_001d: 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) Transform hMDTransform = HMDTransform; return ((Object)(object)hMDTransform != (Object)null) ? hMDTransform.position : Vector3.zero; } } public static Vector3 HMDForward { get { //IL_0018: 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_001d: 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) Transform hMDTransform = HMDTransform; return ((Object)(object)hMDTransform != (Object)null) ? hMDTransform.forward : Vector3.forward; } } public static Vector3 FeetPositionGuess { get { //IL_001d: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)VRPlayer.instance != (Object)null) { return VRPlayer.instance.feetPositionGuess; } return Vector3.zero; } } public static Transform TrackingOrigin { get { if ((Object)(object)VRPlayer.instance != (Object)null) { return VRPlayer.instance.trackingOriginTransform; } return null; } } public static Vector3 TrackingOriginPosition { get { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return ((Object)(object)TrackingOrigin != (Object)null) ? TrackingOrigin.position : Vector3.zero; } set { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)TrackingOrigin != (Object)null) { TrackingOrigin.position = value; } } } public static int HandCount { get { if ((Object)(object)VRPlayer.instance != (Object)null) { return VRPlayer.instance.handCount; } return 0; } } public static VRHand LeftHand { get { if ((Object)(object)VRPlayer.instance != (Object)null) { return VRPlayer.instance.leftHand; } return null; } } public static VRHand RightHand { get { if ((Object)(object)VRPlayer.instance != (Object)null) { return VRPlayer.instance.rightHand; } return null; } } public static VRHand GetHand(int index) { if ((Object)(object)VRPlayer.instance != (Object)null) { return VRPlayer.instance.GetHand(index); } return null; } public static IEnumerable GetAllHands() { if (!((Object)(object)VRPlayer.instance == (Object)null)) { for (int i = 0; i < VRPlayer.instance.handCount; i++) { yield return VRPlayer.instance.GetHand(i); } } } public static void TeleportTo(Vector3 position, Quaternion? rotation = null) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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) Transform trackingOrigin = TrackingOrigin; if (!((Object)(object)trackingOrigin == (Object)null)) { Transform hMDTransform = HMDTransform; if ((Object)(object)hMDTransform != (Object)null) { Vector3 val = hMDTransform.position - trackingOrigin.position; trackingOrigin.position = position - new Vector3(val.x, 0f, val.z); } else { trackingOrigin.position = position; } if (rotation.HasValue) { trackingOrigin.rotation = rotation.Value; } } } public static void TeleportTo(Vector3 position, Vector3 forward) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) TeleportTo(position, (Quaternion?)Quaternion.LookRotation(forward)); } public static void TeleportRandom(float radius = 10f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0025: 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) Vector3 position = FeetPositionGuess + new Vector3(Random.Range(0f - radius, radius), 0f, Random.Range(0f - radius, radius)); TeleportTo(position); } public static Vector3 GetPlayerVelocity() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_003a: 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) Transform hMDTransform = HMDTransform; if ((Object)(object)hMDTransform == (Object)null) { return Vector3.zero; } Rigidbody componentInParent = ((Component)hMDTransform).GetComponentInParent(); return ((Object)(object)componentInParent != (Object)null) ? componentInParent.velocity : Vector3.zero; } public static float GetPlayerHeight() { //IL_001a: 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) return ((Object)(object)HMDTransform != (Object)null) ? (HMDTransform.position.y - FeetPositionGuess.y) : 1.7f; } public static void SetPlayerScale(float scale) { //IL_0013: 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 trackingOrigin = TrackingOrigin; if ((Object)(object)trackingOrigin != (Object)null) { trackingOrigin.localScale = Vector3.one * Mathf.Clamp(scale, 0.05f, 10f); } } public static float GetPlayerScale() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) Transform trackingOrigin = TrackingOrigin; return ((Object)(object)trackingOrigin != (Object)null) ? trackingOrigin.localScale.x : 1f; } public static void MakePlayerGiant() { SetPlayerScale(5f); } public static void MakePlayerTiny() { SetPlayerScale(0.2f); } public static void ResetPlayerScale() { SetPlayerScale(1f); } public static void SetMovementSpeed(float speed) { MinigamesTeleport val = Object.FindObjectOfType(); if (!((Object)(object)val != (Object)null)) { return; } MinigamesTeleportArc component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { FieldInfo field = typeof(MinigamesTeleportArc).GetField("arcDistance", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(component, speed); } } } public static void SetPlayerCollision(bool enabled) { IEnumerable allHands = GetAllHands(); foreach (VRHand item in allHands) { if ((Object)(object)item != (Object)null) { Collider[] componentsInChildren = ((Component)item).GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val in array) { val.enabled = enabled; } } } } public static void ToggleInfiniteHealth(bool enabled) { PlayerVRC val = FindXortexPlayer(); if (!((Object)(object)val == (Object)null)) { FieldInfo field = typeof(PlayerVRC).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, enabled ? 999999f : 100f); } } } public static void SetPlayerHealth(float health) { PlayerVRC val = FindXortexPlayer(); if (!((Object)(object)val == (Object)null)) { FieldInfo field = typeof(PlayerVRC).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, health); } } } public static float GetPlayerHealth() { PlayerVRC val = FindXortexPlayer(); if ((Object)(object)val == (Object)null) { return 0f; } FieldInfo field = typeof(PlayerVRC).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); return (field != null) ? ((float)field.GetValue(val)) : 0f; } public static PlayerVRC FindXortexPlayer() { return Object.FindObjectOfType(); } public static HubPlayerVRC FindHubPlayer() { return Object.FindObjectOfType(); } public static bool IsXortexPlayerAttachedToHand() { PlayerVRC val = FindXortexPlayer(); if ((Object)(object)val == (Object)null) { return false; } object obj = typeof(PlayerVRC).GetField("attachedHand", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(val); return obj != null; } public static GlobalManagerVRC GetGlobalManagerVRC() { return GlobalManagerVRC.Instance; } public static bool IsGameRunning() { return (Object)(object)GlobalManagerVRC.Instance != (Object)null && GlobalManagerVRC.Instance.GameIsRunning; } public static void TeleportPlayerToStart() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GlobalManagerVRC.Instance != (Object)null && (Object)(object)GlobalManagerVRC.Instance.PlayerSpawnPoint != (Object)null) { TeleportTo(GlobalManagerVRC.Instance.PlayerSpawnPoint.position, (Quaternion?)GlobalManagerVRC.Instance.PlayerSpawnPoint.rotation); } } public static PlayerData GetPlayerData() { return PlayerData.instance; } public static void SavePlayerData() { if ((Object)(object)PlayerData.instance != (Object)null) { PlayerData.instance.Save(); } } public static void SetSubtitles(bool enabled) { if ((Object)(object)PlayerData.instance != (Object)null) { PlayerData.instance.subtitlesEnabled = enabled; PlayerData.instance.Save(); } } public static bool GetSubtitles() { return (Object)(object)PlayerData.instance != (Object)null && PlayerData.instance.subtitlesEnabled; } public static void SetDashTeleport(bool enabled) { if ((Object)(object)PlayerData.instance != (Object)null) { PlayerData.instance.dashTeleportEnabled = enabled; PlayerData.instance.Save(); } } public static bool GetDashTeleport() { return (Object)(object)PlayerData.instance != (Object)null && PlayerData.instance.dashTeleportEnabled; } public static void SetTeleportEnabled(bool enabled) { MinigamesTeleport val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = enabled; ((Component)val).gameObject.SetActive(enabled); } } public static bool IsTeleportEnabled() { MinigamesTeleport val = Object.FindObjectOfType(); return (Object)(object)val != (Object)null && ((Behaviour)val).enabled; } public static void TriggerHapticPulse(SteamVR_Input_Sources source, float duration = 0.05f, float frequency = 100f, float amplitude = 0.5f) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_004c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)VRPlayer.instance != (Object)null) { VRHand val = (((int)source == 1) ? LeftHand : RightHand); if ((Object)(object)val != (Object)null && (SteamVR_Action)(object)val.hapticAction != (SteamVR_Action)null) { val.hapticAction.Execute(0f, duration, frequency, amplitude, source); } } } public static void TriggerHapticPulseBoth(float duration = 0.05f, float frequency = 100f, float amplitude = 0.5f) { TriggerHapticPulse((SteamVR_Input_Sources)1, duration, frequency, amplitude); TriggerHapticPulse((SteamVR_Input_Sources)2, duration, frequency, amplitude); } } public static class SceneAPI { public static string CurrentScene { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).name; } } public static int CurrentSceneBuildIndex { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).buildIndex; } } public static int SceneCount => SceneManager.sceneCount; public static bool IsInScene(string sceneName) { //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) Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).name == sceneName; } public static bool IsInAnyScene(params string[] sceneNames) { //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) Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; foreach (string text in sceneNames) { if (name == text) { return true; } } return false; } public static bool IsInHub() { return IsInScene("hub"); } public static bool IsInLongbow() { return IsInScene("Longbow"); } public static bool IsInXortex() { return IsInScene("xortex_classic") || IsInScene("xortex_infinite") || IsInScene("Xortex"); } public static bool IsInSlingshot() { return IsInScene("Slingshot"); } public static bool IsInVesperPeak() { return IsInScene("VesperPeak_merged"); } public static bool IsInIntro() { return IsInScene("intro"); } public static bool IsInCredits() { return IsInScene("credits"); } public static bool IsInRobotRepair() { return IsInScene("RobotRepair"); } public static bool IsInChess() { return IsInScene("chess"); } public static bool IsInPlanetarium() { return IsInScene("solar_system"); } public static bool IsInDiorama() { return IsInScene("Diorama"); } public static bool IsInConveyor() { return IsInScene("conveyor"); } public static void LoadScene(string sceneName) { if ((Object)(object)PlayerData.instance != (Object)null) { PlayerData.instance.VisitLevel(sceneName, (ExtendedLoadLevel)null, false); } else { SceneManager.LoadScene(sceneName); } } public static void LoadSceneAdditive(string sceneName) { SceneManager.LoadScene(sceneName, (LoadSceneMode)1); } public static void LoadHub() { LoadScene("hub"); } public static void LoadLongbow() { LoadScene("Longbow"); } public static void LoadXortex() { LoadScene("xortex_classic"); } public static void LoadSlingshot() { LoadScene("Slingshot"); } public static void LoadRobotRepair() { LoadScene("RobotRepair"); } public static void LoadCredits() { LoadScene("credits"); } public static void ReloadCurrentScene() { LoadScene(CurrentScene); } public static void UnloadScene(string sceneName) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) Scene sceneByName = SceneManager.GetSceneByName(sceneName); if (((Scene)(ref sceneByName)).isLoaded) { SceneManager.UnloadSceneAsync(sceneName); } } public static GameObject FindRootObject(string name) { //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) Scene activeScene = SceneManager.GetActiveScene(); GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects(); GameObject[] array = rootGameObjects; foreach (GameObject val in array) { if (((Object)val).name == name) { return val; } } return null; } public static T FindComponentInScene() where T : Component { return Object.FindObjectOfType(); } public static T[] FindAllComponentsInScene() where T : Component { return Object.FindObjectsOfType(); } public static string[] GetAllSceneNames() { int sceneCountInBuildSettings = SceneManager.sceneCountInBuildSettings; string[] array = new string[sceneCountInBuildSettings]; for (int i = 0; i < sceneCountInBuildSettings; i++) { string scenePathByBuildIndex = SceneUtility.GetScenePathByBuildIndex(i); array[i] = Path.GetFileNameWithoutExtension(scenePathByBuildIndex); } return array; } } public static class WorldAPI { public static void SetTimeScale(float scale) { Time.timeScale = scale; } public static float GetTimeScale() { return Time.timeScale; } public static void FreezeGame() { Time.timeScale = 0f; } public static void UnfreezeGame() { Time.timeScale = 1f; } public static void SlowMotion(float factor = 0.3f) { Time.timeScale = factor; } public static void SetAudioListenerVolume(float volume) { AudioListener.volume = Mathf.Clamp01(volume); } public static float GetAudioListenerVolume() { return AudioListener.volume; } public static void MuteAudio() { AudioListener.volume = 0f; } public static void UnmuteAudio() { AudioListener.volume = 1f; } public static GameObject FindObjectByPath(string path) { return GameObject.Find(path); } public static T FindComponent() where T : Component { return Object.FindObjectOfType(); } public static T[] FindAllComponents() where T : Component { return Object.FindObjectsOfType(); } public static List FindObjectsWithLayer(int layer) { GameObject[] source = Resources.FindObjectsOfTypeAll(); return source.Where((GameObject go) => go.layer == layer).ToList(); } public static void SetGravity(Vector3 gravity) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Physics.gravity = gravity; } public static Vector3 GetGravity() { //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_0009: Unknown result type (might be due to invalid IL or missing references) return Physics.gravity; } public static void ResetGravity() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Physics.gravity = new Vector3(0f, -9.81f, 0f); } public static void SetDefaultGravity() { ResetGravity(); } public static void InvertGravity() { //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) Physics.gravity = -Physics.gravity; } public static void SetLowGravity() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Physics.gravity = new Vector3(0f, -2f, 0f); } public static void SetMoonGravity() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Physics.gravity = new Vector3(0f, -1.62f, 0f); } public static void SetZeroGravity() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Physics.gravity = Vector3.zero; } public static void SetWindForce(Vector3 direction, float strength) { //IL_0031: 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) //IL_0041: Unknown result type (might be due to invalid IL or missing references) Rigidbody[] array = Object.FindObjectsOfType(); Rigidbody[] array2 = array; foreach (Rigidbody val in array2) { if ((Object)(object)val != (Object)null && !val.isKinematic) { val.AddForce(((Vector3)(ref direction)).normalized * strength * 0.1f, (ForceMode)0); } } } public static void StopWind() { } public static void SetShadowDistance(float distance) { QualitySettings.shadowDistance = Mathf.Max(0f, distance); } public static float GetShadowDistance() { return QualitySettings.shadowDistance; } public static void SetAmbientIntensity(float intensity) { RenderSettings.ambientIntensity = intensity; } public static float GetAmbientIntensity() { return RenderSettings.ambientIntensity; } public static void SetReflectionIntensity(float intensity) { RenderSettings.reflectionIntensity = intensity; } public static void SetDefaultFog() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) RenderSettings.fog = true; RenderSettings.fogMode = (FogMode)3; RenderSettings.fogDensity = 0.01f; RenderSettings.fogColor = Color.gray; } public static void SetFogMode(FogMode mode) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) RenderSettings.fogMode = mode; } public static void SetFogStartEnd(float start, float end) { RenderSettings.fogStartDistance = start; RenderSettings.fogEndDistance = end; } public static void IgnoreCollision(GameObject a, GameObject b, bool ignore = true) { if ((Object)(object)a == (Object)null || (Object)(object)b == (Object)null) { return; } Collider[] componentsInChildren = a.GetComponentsInChildren(); Collider[] componentsInChildren2 = b.GetComponentsInChildren(); Collider[] array = componentsInChildren; foreach (Collider val in array) { Collider[] array2 = componentsInChildren2; foreach (Collider val2 in array2) { Physics.IgnoreCollision(val, val2, ignore); } } } public static void ScreenShake(float intensity = 0.5f, float duration = 0.3f) { //IL_0033: 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) Camera mainCamera = GetMainCamera(); if (!((Object)(object)mainCamera == (Object)null)) { Rigidbody val = ((Component)mainCamera).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)mainCamera).gameObject.AddComponent(); } val.AddForce(Random.insideUnitSphere * intensity, (ForceMode)1); } } public static Light[] GetAllLights() { return Object.FindObjectsOfType(); } public static void SetAmbientLightColor(Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) RenderSettings.ambientLight = color; } public static void SetFogEnabled(bool enabled) { RenderSettings.fog = enabled; } public static void SetFogDensity(float density) { RenderSettings.fogDensity = density; } public static void SetFogColor(Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) RenderSettings.fogColor = color; } public static void SetSkybox(Material skybox) { RenderSettings.skybox = skybox; } public static void SetQualityLevel(int level) { QualitySettings.SetQualityLevel(level); } public static int GetQualityLevel() { return QualitySettings.GetQualityLevel(); } public static Camera GetMainCamera() { return Camera.main; } public static Camera[] GetAllCameras() { return Camera.allCameras; } public static void SetCameraFOV(float fov) { Camera mainCamera = GetMainCamera(); if ((Object)(object)mainCamera != (Object)null) { mainCamera.fieldOfView = fov; } } public static float GetCameraFOV() { Camera mainCamera = GetMainCamera(); return ((Object)(object)mainCamera != (Object)null) ? mainCamera.fieldOfView : 0f; } } public static class Library { public static bool Initialized { get; private set; } public static void Init() { if (!Initialized) { Initialized = true; } } } public static class Extensions { public static Vector3 WithX(this Vector3 v, float x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return new Vector3(x, v.y, v.z); } public static Vector3 WithY(this Vector3 v, float y) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v.x, y, v.z); } public static Vector3 WithZ(this Vector3 v, float z) { //IL_0000: 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_000d: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v.x, v.y, z); } public static Vector3 AddX(this Vector3 v, float x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v.x + x, v.y, v.z); } public static Vector3 AddY(this Vector3 v, float y) { //IL_0000: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v.x, v.y + y, v.z); } public static Vector3 AddZ(this Vector3 v, float z) { //IL_0000: 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v.x, v.y, v.z + z); } public static bool IsValid(this MonoBehaviour mb) { return (Object)(object)mb != (Object)null && (Object)(object)((Component)mb).gameObject != (Object)null; } }