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.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CustomDiscoverStateLib; using ExitGames.Client.Photon; using HarmonyLib; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Utils.Cil; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Photon.Pun; using Photon.Realtime; using RepoXR.Assets; using RepoXR.Data; using RepoXR.Input; using RepoXR.Managers; using RepoXR.Networking; using RepoXR.Networking.Frames; using RepoXR.Patches; using RepoXR.Player; using RepoXR.Player.Camera; using RepoXR.Rendering; using RepoXR.ThirdParty.MRTK; using RepoXR.UI; using RepoXR.UI.Controls; using RepoXR.UI.Expressions; using RepoXR.UI.Menu; using RepoXR.UI.Settings; using Steamworks; using Steamworks.Data; using TMPro; using Unity.XR.CoreUtils; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Experimental.Rendering; using UnityEngine.InputSystem; using UnityEngine.InputSystem.UI; using UnityEngine.InputSystem.Utilities; using UnityEngine.InputSystem.XR; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; using UnityEngine.Scripting; using UnityEngine.Serialization; using UnityEngine.UI; using UnityEngine.XR; using UnityEngine.XR.Interaction.Toolkit; using UnityEngine.XR.Interaction.Toolkit.UI; using UnityEngine.XR.Management; using UnityEngine.XR.OpenXR; using UnityEngine.XR.OpenXR.Features; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DaXcess")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright (c) DaXcess 2026")] [assembly: AssemblyDescription("Collecting Valuables in VR")] [assembly: AssemblyFileVersion("1.2.2.0")] [assembly: AssemblyInformationalVersion("1.2.2+b9a820e6a3701d416b6134275db93f484314aa13")] [assembly: AssemblyProduct("RepoXR")] [assembly: AssemblyTitle("RepoXR")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/DaXcess/RepoXR")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlyArray : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Length; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => _items.Length; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Length; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyArray(T[] items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return ((ICollection)_items).Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { ((ICollection)_items).CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return ((IList)_items).IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NativeIntegerAttribute : Attribute { public readonly bool[] TransformFlags; public NativeIntegerAttribute() { TransformFlags = new bool[1] { true }; } public NativeIntegerAttribute(bool[] P_0) { TransformFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class ExtensionMarkerAttribute : Attribute { private readonly string k__BackingField; public string Name => k__BackingField; public ExtensionMarkerAttribute(string name) { k__BackingField = name; } } } namespace RepoXR { public static class Compat { public const string UnityExplorer = "com.sinai.unityexplorer"; public const string CustomDiscoverStateLib = "Kistras-CustomDiscoverStateLib"; public static bool IsLoaded(string modId) { return Chainloader.PluginInfos.ContainsKey(modId); } } public class Config { public enum HapticFeedbackOption { Off, Reduced, All } public enum TurnProviderOption { Snap, Smooth, Disabled } public string AssemblyPath { get; } public ConfigFile File { get; } [ConfigDescriptor("Enable VR", false, 1f, 1f, "", "Disable", "Enable", false)] public ConfigEntry DisableVR { get; } [ConfigDescriptor(null, false, 1f, 1f, "", "On", "Off", false)] public ConfigEntry VerboseLogging { get; } [ConfigDescriptor("VR Prescence", false, 1f, 1f, "", "Hidden", "Shown", false)] public ConfigEntry DisableVRPresence { get; } [ConfigDescriptor(null, false, 1f, 1f, "", "On", "Off", false)] public ConfigEntry ReducedAimImpact { get; } [ConfigDescriptor(null, false, 1f, 1f, "", "On", "Off", false)] public ConfigEntry RoomscaleCrouch { get; } [ConfigDescriptor("Dominant Hand", false, 1f, 1f, "", "Left", "Right", false)] public ConfigEntry LeftHandDominant { get; } [ConfigDescriptor("Arms", false, 1f, 1f, "", "Detached", "Attached", false)] public ConfigEntry DetachedArms { get; } [ConfigDescriptor(null, false, 1f, 1f, "", "On", "Off", false)] public ConfigEntry HapticFeedback { get; } [ConfigDescriptor("Eye Tracking", false, 1f, 1f, "", "Enabled", "Disabled", false)] public ConfigEntry EnableEyeTracking { get; } [ConfigDescriptor("HUD Height", false, 0.05f, 0.01f, "", "On", "Off", false)] public ConfigEntry HUDPlaneOffset { get; } [ConfigDescriptor("HUD Secondary Height", false, 0.05f, 0.01f, "", "On", "Off", false)] public ConfigEntry HUDGazePlaneOffset { get; } [ConfigDescriptor(null, false, 0.25f, 0.05f, "", "On", "Off", false)] public ConfigEntry SmoothCanvasDistance { get; } [ConfigDescriptor(null, false, 1f, 1f, "", "On", "Off", true)] public ConfigEntry TurnProvider { get; } [ConfigDescriptor(null, false, 0.05f, 0.01f, "x", "On", "Off", false)] public ConfigEntry SmoothTurnSpeedModifier { get; } [ConfigDescriptor(null, false, 1f, 1f, "", "On", "Off", false)] public ConfigEntry AnalogSmoothTurn { get; } [ConfigDescriptor(null, false, 5f, 1f, "°", "On", "Off", false)] public ConfigEntry SnapTurnSize { get; } [ConfigDescriptor(null, false, 1f, 1f, "", "On", "Off", false)] public ConfigEntry NormalizeMovement { get; } [ConfigDescriptor("Vehicle direction source", false, 1f, 1f, "", "Head", "Hand", false)] public ConfigEntry VehicleHeadForward { get; } [ConfigDescriptor(null, false, 5f, 1f, "%", "On", "Off", false)] public ConfigEntry CameraResolution { get; } [ConfigDescriptor(null, false, 1f, 1f, "", "On", "Off", false)] public ConfigEntry Vignette { get; } [ConfigDescriptor(null, false, 1f, 1f, "", "On", "Off", false)] public ConfigEntry CustomCamera { get; } [ConfigDescriptor(null, false, 15f, 5f, "", "On", "Off", false)] public ConfigEntry CustomCameraFramerate { get; } [ConfigDescriptor(null, false, 5f, 1f, "", "On", "Off", false)] public ConfigEntry CustomCameraFOV { get; } [ConfigDescriptor(null, true, 0.1f, 0.05f, "", "On", "Off", false)] public ConfigEntry CustomCameraSmoothing { get; } public ConfigEntry ControllerBindingsOverride { get; } public ConfigEntry ControllerBindingsOverrideLeft { get; } public ConfigEntry InputToggleBindings { get; } public ConfigEntry OpenXRRuntimeFile { get; } public Config(string assemblyPath, ConfigFile file) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Expected O, but got Unknown //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Expected O, but got Unknown //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Expected O, but got Unknown //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Expected O, but got Unknown //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Expected O, but got Unknown AssemblyPath = assemblyPath; File = file; DisableVR = file.Create("General", "DisableVR", defaultValue: false, "Disables the main functionality of this mod, can be used if you want to play without VR while keeping the mod installed."); VerboseLogging = file.Create("General", "VerboseLogging", defaultValue: false, "Enables verbose debug logging during OpenXR initialization"); DisableVRPresence = file.Create("General", "DisableVRPresence", defaultValue: false, "Disable the addition of VR status to Discord and Steam prescence."); ReducedAimImpact = file.Create("Gameplay", "ReducedAimImpact", defaultValue: false, "When enabled, lowers the severity of force-look events (like the ceiling eye), which can be helpful for people with motion sickness"); RoomscaleCrouch = file.Create("Gameplay", "RoomscaleCrouch", defaultValue: true, "When enabled, allows for the player to physically crouch to also crouch in-game"); LeftHandDominant = file.Create("Gameplay", "LeftHandDominant", defaultValue: false, "Whether to use the left or right hand as dominant hand (the hand used to pick up items)"); DetachedArms = file.Create("Gameplay", "DetachedArms", defaultValue: false, "Whether your arms are attached to your body, or if they are separate"); HapticFeedback = file.Create("Gameplay", "HapticFeedback", HapticFeedbackOption.All, new ConfigDescription("Controls how much haptic feedback you will experience while playing with the VR mod.", (AcceptableValueBase)(object)new AcceptableValueEnum(), Array.Empty())); EnableEyeTracking = file.Create("Gameplay", "EnableEyeTracking", defaultValue: true, "If supported by the headset, use eye tracking to move your characters pupils for other players and for checking line of sight with enemies."); HUDPlaneOffset = file.Create("UI", "HUDPlaneOffset", -0.45f, new ConfigDescription("The default height offset for the HUD", (AcceptableValueBase)(object)new AcceptableValueRange(-1f, 0.5f), Array.Empty())); HUDGazePlaneOffset = file.Create("UI", "HUDGazePlaneOffset", -0.25f, new ConfigDescription("The height offset for the HUD when looking at it", (AcceptableValueBase)(object)new AcceptableValueRange(-1f, 0.5f), Array.Empty())); SmoothCanvasDistance = file.Create("UI", "SmoothCanvasDistance", 1.5f, new ConfigDescription("The distance that the smooth canvas should be away from the main camera", (AcceptableValueBase)(object)new AcceptableValueRange(1.25f, 3f), Array.Empty())); TurnProvider = file.Create("Input", "TurnProvider", TurnProviderOption.Smooth, new ConfigDescription("Specify which turning provider your player uses, if any.", (AcceptableValueBase)(object)new AcceptableValueEnum(), Array.Empty())); SmoothTurnSpeedModifier = file.Create("Input", "SmoothTurnSpeedModifier", 1f, new ConfigDescription("A multiplier that is added to the smooth turning speed. Requires turn provider to be set to smooth.", (AcceptableValueBase)(object)new AcceptableValueRange(0.25f, 5f), Array.Empty())); AnalogSmoothTurn = file.Create("Input", "AnalogSmoothTurn", defaultValue: true, "When enabled, makes the speed of the smooth turning dependent on how far the analog stick is pushed."); SnapTurnSize = file.Create("Input", "SnapTurnSize", 45f, new ConfigDescription("The amount of rotation that is applied when performing a snap turn. Requires turn provider to be set to snap.", (AcceptableValueBase)(object)new AcceptableValueRange(10f, 180f), Array.Empty())); NormalizeMovement = file.Create("Input", "NormalizeMovement", defaultValue: false, "When enabled, any direction you move in will always be at full speed, even when the stick is only pushed slightly."); VehicleHeadForward = file.Create("Input", "VehicleHeadForward", defaultValue: false, "When enabled, will make the scooters go forward based on head rotation instead of hand rotation."); CameraResolution = file.Create("Rendering", "CameraResolution", 100, new ConfigDescription("This setting configures the resolution scale of the game, lower values are more performant, but will make the game look worse.", (AcceptableValueBase)(object)new AcceptableValueRange(5, 200), Array.Empty())); Vignette = file.Create("Rendering", "Vignette", defaultValue: true, "Enables the vignette shader used in certain scenarios and levels in the game."); CustomCamera = file.Create("Rendering", "CustomCamera", defaultValue: false, "Adds a second camera mounted on top of the VR camera that will render separately from the VR camera to the display. This requires extra GPU power!"); CustomCameraFramerate = file.Create("Rendering", "CustomCameraFramerate", 144f, new ConfigDescription("The maximum frequency that the custom camera can render at. The custom camera framerate is limited to the VR headset's refresh rate, so setting this higher won't have any effect.", (AcceptableValueBase)(object)new AcceptableValueRange(15f, 144f), Array.Empty())); CustomCameraFOV = file.Create("Rendering", "CustomCameraFOV", 75f, new ConfigDescription("The field of view that the custom camera should have.", (AcceptableValueBase)(object)new AcceptableValueRange(45f, 120f), Array.Empty())); CustomCameraSmoothing = file.Create("Rendering", "CustomCameraSmoothing", 0.5f, new ConfigDescription("The amount of smoothing that is applied to the custom camera.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ControllerBindingsOverride = file.Create("Internal", "ControllerBindingsOverride", "", "FOR INTERNAL USE ONLY, DO NOT EDIT"); ControllerBindingsOverrideLeft = file.Create("Internal", "ControllerBindingsOverrideLeft", "", "FOR INTERNAL USE ONLY, DO NOT EDIT"); InputToggleBindings = file.Create("Internal", "InputToggleBindings", "", "FOR INTERNAL USE ONLY, DO NOT EDIT"); OpenXRRuntimeFile = file.Create("Internal", "OpenXRRuntimeFile", "", "FOR INTERNAL USE ONLY, DO NOT EDIT"); base..ctor(); } public void SetupGlobalCallbacks() { CameraResolution.SettingChanged += delegate { XRSettings.eyeTextureResolutionScale = (float)CameraResolution.Value / 100f; }; CustomCamera.SettingChanged += delegate { if (VRSession.InVR) { if (CustomCamera.Value) { Object.Instantiate(AssetCollection.CustomCamera, ((Component)Camera.main).transform.parent); } else { Object.Destroy((Object)(object)((Component)VRCustomCamera.instance).gameObject); } } }; DisableVRPresence.SettingChanged += delegate { if (VRSession.InVR) { RunManager instance = RunManager.instance; if (instance != null) { instance.UpdateSteamRichPresence(); } } }; } } internal class AcceptableValueEnum : AcceptableValueBase where T : Enum { private readonly string[] names = Enum.GetNames(typeof(T)); public AcceptableValueEnum() : base(typeof(T)) { } public override object Clamp(object value) { return value; } public override bool IsValid(object value) { return true; } public override string ToDescriptionString() { return "# Acceptable values: " + string.Join(", ", names); } } [AttributeUsage(AttributeTargets.Property)] public class ConfigDescriptorAttribute : Attribute { [CompilerGenerated] private string? P; [CompilerGenerated] private bool P; [CompilerGenerated] private float P; [CompilerGenerated] private float P; [CompilerGenerated] private string P; [CompilerGenerated] private string P; [CompilerGenerated] private string P; [CompilerGenerated] private bool P; public string? CustomName => P; public bool Percentage => P; public float StepSize => P; public float PointerSize => P; public string Suffix => P; public string TrueText => P; public string FalseText => P; public bool EnumDisableBar => P; public ConfigDescriptorAttribute(string? customName = null, bool percentage = false, float stepSize = 1f, float pointerSize = 1f, string suffix = "", string trueText = "On", string falseText = "Off", bool enumDisableBar = false) { P = customName; P = percentage; P = stepSize; P = pointerSize; P = suffix; P = trueText; P = falseText; P = enumDisableBar; base..ctor(); } } internal static class ConfigExtensions { [SpecialName] public sealed class $B12CDF11896C5C4C15CE4BB252F1BD5B { [SpecialName] public static class $037C64F40E5FD1BCD853070F004509B4 { } [ExtensionMarker("$037C64F40E5FD1BCD853070F004509B4")] internal ConfigEntry Create(string section, string key, T defaultValue, string description) { throw new NotSupportedException(); } [ExtensionMarker("$037C64F40E5FD1BCD853070F004509B4")] internal ConfigEntry Create(string section, string key, T defaultValue, ConfigDescription description) { throw new NotSupportedException(); } } internal static ConfigEntry Create(this ConfigFile file, string section, string key, T defaultValue, string description) where T : notnull { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown return file.Bind(section, key, defaultValue, new ConfigDescription(description, (AcceptableValueBase)null, new object[1] { "HideFromREPOConfig" })); } internal static ConfigEntry Create(this ConfigFile file, string section, string key, T defaultValue, ConfigDescription description) where T : notnull { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown string description2 = description.Description; AcceptableValueBase acceptableValues = description.AcceptableValues; object obj = "HideFromREPOConfig"; object[] tags = description.Tags; int num = 0; object[] array = new object[1 + tags.Length]; array[num] = obj; num++; ReadOnlySpan readOnlySpan = new ReadOnlySpan(tags); readOnlySpan.CopyTo(new Span(array).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; return file.Bind(section, key, defaultValue, new ConfigDescription(description2, acceptableValues, array)); } } [RepoXRPatch(RepoXRPatchTarget.VROnly, null)] internal static class Entrypoint { internal static void SetupDefaultSceneVR() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0274: 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_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)GameObject.Find("UI/UI/Canvas").GetComponent()).enabled = false; Transform transform = GameObject.Find("UI/HUD/HUD Canvas").transform; Transform val = transform.Find("Fade"); Transform val2 = transform.Find("Render Texture Video"); Transform val3 = transform.Find("Loading"); Transform val4 = transform.Find("Moon UI"); Transform val5 = transform.Find("Splash Screen"); Transform val6 = transform.Find("Result Screen"); Camera component = ((Component)transform.parent.Find("Camera Overlay")).GetComponent(); Camera main = Camera.main; ((Component)main).gameObject.AddComponent(); ((Component)component).transform.SetParent(((Component)main).transform, false); ((Component)component).transform.localPosition = Vector3.zero; component.depth = 2f; component.farClipPlane = 1000f; component.orthographic = false; component.clearFlags = (CameraClearFlags)3; component.targetTexture = null; component.nearClipPlane = 0.01f; Object.Destroy((Object)(object)((Component)component).GetComponent()); main.targetTexture = null; Canvas val7 = new GameObject("VR Overlay Canvas") { layer = 5 }.AddComponent(); val7.renderMode = (RenderMode)1; val7.worldCamera = component; val7.sortingOrder = 5; val.SetParent(((Component)val7).transform, false); val2.SetParent(((Component)val7).transform, false); ((Graphic)((Component)val2).GetComponent()).material = AssetCollection.VideoOverlay; CollectionExtensions.Do((IEnumerable)((Component)((Component)val7).transform).GetComponentsInChildren(true), (Action)delegate(RectTransform rect) { //IL_0001: 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) rect.anchorMin = Vector2.zero; rect.anchorMax = Vector2.one; }); Canvas val8 = new GameObject("VR Loading Canvas") { layer = 5 }.AddComponent(); val8.renderMode = (RenderMode)2; val8.sortingOrder = 6; ((Component)val8).transform.localPosition = Vector3.zero; ((Component)val8).transform.localEulerAngles = Vector3.zero; ((Component)val8).transform.localScale = Vector3.one * 0.01f; ((Component)val8).transform.SetParent(((Component)Camera.main).transform.parent, false); ((Component)val8).gameObject.AddComponent(); ((Component)val8).GetComponent().sizeDelta = new Vector2(720f, 400f); val3.SetParent(((Component)val8).transform, false); GameObject val9 = new GameObject("Moon Mask"); val9.transform.parent = ((Component)val8).transform; val9.transform.localScale = Vector3.one; val9.transform.localPosition = Vector3.zero; val9.transform.localRotation = Quaternion.identity; RectTransform component2 = ((Component)val9.AddComponent()).GetComponent(); component2.sizeDelta = new Vector2(800f, 550f); val4.SetParent(((Component)component2).transform, false); val4.localScale = Vector3.one * 0.8f; GameObject val10 = new GameObject("Result Mask"); val10.transform.parent = ((Component)val8).transform; val10.transform.localScale = Vector3.one; val10.transform.localPosition = Vector3.zero; val10.transform.localRotation = Quaternion.identity; RectTransform component3 = ((Component)val10.AddComponent()).GetComponent(); component3.sizeDelta = new Vector2(720f, 405f); val6.SetParent(((Component)component3).transform, false); val5.SetParent(((Component)val8).transform, false); val5.SetAsFirstSibling(); if (Plugin.Config.CustomCamera.Value) { Object.Instantiate(AssetCollection.CustomCamera, ((Component)Camera.main).transform.parent); } new GameObject("Haptic Manager").AddComponent(); new GameObject("Data Manager").AddComponent(); } [HarmonyPatch(typeof(GameDirector), "Start")] [HarmonyPostfix] private static void OnStartup(GameDirector __instance) { VRInputSystem.Instance.ActivateInput(); if ((Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelMainMenu || (Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelSplashScreen) { OnStartupMainMenu(); } } [HarmonyPatch(typeof(LobbyMenuOpen), "Awake")] [HarmonyPostfix] private static void OnStartLobbyMenu() { if ((Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelLobbyMenu) { OnStartupMainMenu(); } } [HarmonyPatch(typeof(StartRoom), "Start")] [HarmonyPostfix] private static void OnStartTruck(StartRoom __instance) { bool flag; switch (((Object)__instance).name) { case "Start Room - Main Menu(Clone)": case "Start Room - Lobby Menu(Clone)": case "Start Room - Splash Screen(Clone)": flag = true; break; default: flag = false; break; } if (!flag) { OnStartupInGame(); } } [HarmonyPatch(typeof(SplashScreen), "Start")] [HarmonyPostfix] private static void OnStartupSplashScreen() { LoadingUI.instance.ResetPosition(); } private static void OnStartupMainMenu() { ((Component)HUDCanvas.instance).gameObject.AddComponent(); DataManager.instance.ResetData(); } private static void OnStartupInGame() { ((Component)GameDirector.instance).gameObject.AddComponent(); } } [RepoXRPatch(RepoXRPatchTarget.Universal, null)] internal static class UniversalEntrypoint { private static bool hasShownErrorMessage; public static void OnSceneLoad(string _) { if (Plugin.Flags.HasFlag(Flags.VR)) { Entrypoint.SetupDefaultSceneVR(); } SetupDefaultSceneUniversal(); } private static void SetupDefaultSceneUniversal() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("RepoXR Network System").AddComponent(); ShowVRFailedWarning(); } private static void ShowVRFailedWarning() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Flags.HasFlag(Flags.StartupFailed) && !hasShownErrorMessage && !((Object)(object)RunManager.instance.levelCurrent != (Object)(object)RunManager.instance.levelMainMenu)) { hasShownErrorMessage = true; MenuManager.instance.PagePopUpScheduled("VR Startup Failed", Color.red, "RepoXR tried to launch the game in VR, however an error occured during initialization.\n\nYou will still be able to play the game and make use of this mod's features, however you will not be in VR.\n\nYou can disable VR in the settings if you want to suppress this error in the future.", "Alright fam", true); } } } public static class Logger { internal static ManualLogSource? source; public static void LogInfo(object message) { ManualLogSource? obj = source; if (obj != null) { obj.LogInfo(message); } } public static void LogWarning(object message) { ManualLogSource? obj = source; if (obj != null) { obj.LogWarning(message); } } public static void LogError(object message) { ManualLogSource? obj = source; if (obj != null) { obj.LogError(message); } } public static void LogDebug(object message) { ManualLogSource? obj = source; if (obj != null) { obj.LogDebug(message); } } } internal static class Native { private delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam); private struct SID_AND_ATTRIBUTES { public IntPtr Sid; public uint Attributes; } private struct TOKEN_MANDATORY_LABEL { public SID_AND_ATTRIBUTES Label; } public static readonly IntPtr HKEY_LOCAL_MACHINE = (IntPtr)2147483650L; private const int SECURITY_MAX_SID_SIZE = 68; [DllImport("user32.dll", CharSet = CharSet.Unicode)] private static extern int GetWindowText(IntPtr hWnd, StringBuilder strText, int maxCount); [DllImport("user32.dll", CharSet = CharSet.Unicode)] private static extern int GetWindowTextLength(IntPtr hWnd); [DllImport("user32.dll")] private static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam); [DllImport("user32.dll")] private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId); [DllImport("user32.dll")] private static extern bool BringWindowToTop(IntPtr hWnd); [DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow(); [DllImport("kernel32.dll", CharSet = CharSet.Auto)] public static extern IntPtr GetModuleHandle(string lpModuleName); [DllImport("user32.dll")] private static extern void AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach); [DllImport("kernel32.dll")] private static extern uint GetCurrentProcessId(); [DllImport("kernel32.dll")] private static extern uint GetCurrentThreadId(); [DllImport("Advapi32.dll", CharSet = CharSet.Ansi, EntryPoint = "RegOpenKeyExA")] public static extern int RegOpenKeyEx(IntPtr hKey, [In] string lpSubKey, int ulOptions, int samDesired, out IntPtr phkResult); [DllImport("advapi32.dll", CharSet = CharSet.Ansi)] public static extern int RegQueryValueEx(IntPtr hKey, string lpValueName, int lpReserved, out uint lpType, StringBuilder? lpData, ref uint lpcbData); [DllImport("advapi32.dll", CharSet = CharSet.Ansi)] public static extern int RegQueryInfoKey(IntPtr hKey, StringBuilder? lpClass, IntPtr lpcbClass, IntPtr lpReserved, out uint lpcSubKeys, out uint lpcbMaxSubKeyLen, out uint lpcbMaxClassLen, out uint lpcValues, out uint lpcbMaxValueNameLen, out uint lpcbMaxValueLen, IntPtr lpSecurityDescriptor, IntPtr lpftLastWriteTime); [DllImport("advapi32.dll", CharSet = CharSet.Ansi, EntryPoint = "RegEnumValueA")] public static extern int RegEnumValue(IntPtr hKey, uint dwIndex, StringBuilder lpValueName, ref uint lpcchValueName, IntPtr lpReserved, IntPtr lpType, IntPtr lpData, IntPtr lpcbData); [DllImport("advapi32.dll")] public static extern int RegCloseKey(IntPtr hKey); [DllImport("Shlwapi.dll", CharSet = CharSet.Ansi)] public static extern int ShellMessageBox(IntPtr hAppInst, IntPtr hWnd, string lpcText, string lpcTitle, uint fuStyle); [DllImport("kernel32.dll", SetLastError = true)] private static extern IntPtr GetCurrentProcess(); [DllImport("advapi32.dll", SetLastError = true)] private static extern bool OpenProcessToken(IntPtr hProcess, uint dwAccess, out IntPtr hToken); [DllImport("advapi32.dll", SetLastError = true)] private static extern bool GetTokenInformation(IntPtr hToken, uint tokenInformationClass, in byte lpData, int tokenInformationLength, out uint returnLength); [DllImport("advapi32.dll", SetLastError = true)] private static extern IntPtr GetSidSubAuthorityCount(IntPtr pSid); [DllImport("advapi32.dll", SetLastError = true)] private static extern IntPtr GetSidSubAuthority(IntPtr pSid, int nSubAuthority); [DllImport("kernel32.dll", SetLastError = true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool CloseHandle(IntPtr handle); public static bool RegOpenSubKey(ref IntPtr hKey, string lpSubKey, int samDesired) { if (RegOpenKeyEx(hKey, lpSubKey, 0, samDesired, out var phkResult) != 0) { return false; } RegCloseKey(hKey); hKey = phkResult; return true; } public static bool IsHighIntegrityLevel() { IntPtr hToken = IntPtr.Zero; try { if (!OpenProcessToken(GetCurrentProcess(), 24u, out hToken)) { return false; } Span span = stackalloc byte[72]; if (!GetTokenInformation(hToken, 25u, in MemoryMarshal.GetReference(span), span.Length, out var _)) { return false; } IntPtr sid = MemoryMarshal.Cast(span)[0].Label.Sid; if (sid == IntPtr.Zero) { return false; } byte b = Marshal.ReadByte(GetSidSubAuthorityCount(sid)); return Marshal.ReadInt32(GetSidSubAuthority(sid, b - 1)) > 8192; } finally { if (hToken != IntPtr.Zero) { CloseHandle(hToken); } } } public static void BringGameWindowToFront() { uint currentPid = GetCurrentProcessId(); IntPtr[] array = FindWindows(delegate(IntPtr hWnd, IntPtr _) { GetWindowThreadProcessId(hWnd, out var processId2); return processId2 == currentPid && GetWindowText(hWnd) == "REPO"; }).ToArray(); if (array.Length > 1) { Logger.LogWarning("Multiple game windows called 'R.E.P.O.' detected. Bringing only the first one to the front."); } IntPtr hWnd2 = array[0]; uint processId; uint windowThreadProcessId = GetWindowThreadProcessId(GetForegroundWindow(), out processId); uint currentThreadId = GetCurrentThreadId(); AttachThreadInput(windowThreadProcessId, currentThreadId, fAttach: true); BringWindowToTop(hWnd2); AttachThreadInput(windowThreadProcessId, currentThreadId, fAttach: false); } private static string GetWindowText(IntPtr hWnd) { int windowTextLength = GetWindowTextLength(hWnd); if (windowTextLength <= 0) { return string.Empty; } StringBuilder stringBuilder = new StringBuilder(windowTextLength + 1); GetWindowText(hWnd, stringBuilder, stringBuilder.Capacity); return stringBuilder.ToString(); } private static IEnumerable FindWindows(EnumWindowsProc filter) { EnumWindowsProc filter2 = filter; List windows = new List(); EnumWindows(delegate(IntPtr hWnd, IntPtr lParam) { if (filter2(hWnd, lParam)) { windows.Add(hWnd); } return true; }, IntPtr.Zero); return windows; } } internal static class OpenXR { public class Runtimes : IReadOnlyCollection, IEnumerable, IEnumerable { [CompilerGenerated] private Runtime[] P; public Runtime? Default; public int Count => P.Length; public Runtimes(Runtime[] runtimes) { P = runtimes; Default = ((IEnumerable)P).Select((Func)((Runtime rt) => rt)).FirstOrDefault((Runtime? rt) => rt.Value.Default); base..ctor(); } public bool TryGetRuntime(string name, out Runtime runtime) { string name2 = name; runtime = default(Runtime); try { runtime = P.First((Runtime rt) => rt.Name == name2); return true; } catch { return false; } } public bool TryGetRuntimeByPath(string path, out Runtime runtime) { string path2 = path; runtime = default(Runtime); try { runtime = P.First((Runtime rt) => rt.Path == path2); return true; } catch { return false; } } public IEnumerator GetEnumerator() { return ((IEnumerable)P).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public struct Runtime : IEquatable { public string Name { get; set; } public string Path { get; set; } public bool Default { get; set; } public static bool ReadFromJson(string path, out Runtime runtime) { runtime = default(Runtime); try { JToken val = JsonConvert.DeserializeObject(File.ReadAllText(path))[(object)"runtime"]; runtime.Name = val[(object)"name"].ToObject(); runtime.Path = path; string defaultRuntimePath = GetDefaultRuntimePath(); if (defaultRuntimePath != null) { runtime.Default = string.Equals(path, defaultRuntimePath, StringComparison.CurrentCultureIgnoreCase); } return true; } catch { return false; } } public bool Equals(Runtime other) { return Path == other.Path; } public override bool Equals(object? obj) { if (obj is Runtime other) { return Equals(other); } return false; } public override int GetHashCode() { return HashCode.Combine(Path); } } public static class Loader { private static XRGeneralSettings? xrGeneralSettings; private static XRManagerSettings? xrManagerSettings; private static OpenXRLoader? xrLoader; private static readonly ManualLogSource Logger; static Loader() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown Logger = new ManualLogSource("OpenXR Loader"); Logger.Sources.Add((ILogSource)(object)Logger); } public static bool InitializeXR() { InitializeScripts(); List list = new List(); SubsystemManager.GetAllSubsystemDescriptors(list); if (!list.Any((ISubsystemDescriptor subsystem) => subsystem.id == "OpenXR Input") || !list.Any((ISubsystemDescriptor subsystem) => subsystem.id == "OpenXR Display")) { Logger.LogError((object)"No Unity OpenXR subsystem found, this installation of RepoXR was not installed correctly."); return false; } if (Native.IsHighIntegrityLevel()) { Logger.LogWarning((object)"Application is elevated! Unable to override the XR runtime! Only the system default OpenXR runtime will be available."); return InitializeXR(null); } Runtimes runtimes = GetRuntimes(); if (runtimes.Count == 0) { Logger.LogWarning((object)"Failed to query runtimes, or no runtimes were found. Falling back to default behavior."); Runtime? runtime; if (!string.IsNullOrEmpty(Plugin.Config.OpenXRRuntimeFile.Value)) { Runtime value = default(Runtime); value.Name = "RepoXR OpenXR Override"; value.Path = Plugin.Config.OpenXRRuntimeFile.Value; runtime = value; } else { runtime = null; } return InitializeXR(runtime); } if (!string.IsNullOrEmpty(Plugin.Config.OpenXRRuntimeFile.Value)) { Runtime value2; if (!runtimes.TryGetRuntimeByPath(Plugin.Config.OpenXRRuntimeFile.Value, out var runtime2)) { Runtime value = default(Runtime); value.Name = "RepoXR OpenXR Override"; value.Path = Plugin.Config.OpenXRRuntimeFile.Value; value2 = value; } else { value2 = runtime2; } if (InitializeXR(value2)) { return true; } Logger.LogWarning((object)"Loading OpenXR using override failed, falling back to automatic enumeration..."); } Runtime? @default = runtimes.Default; if (@default.HasValue) { Runtime valueOrDefault = @default.GetValueOrDefault(); if (valueOrDefault.Path != Plugin.Config.OpenXRRuntimeFile.Value && InitializeXR(valueOrDefault)) { return true; } } foreach (Runtime item in runtimes.Where((Runtime rt) => rt.Path != Plugin.Config.OpenXRRuntimeFile.Value && !rt.Default)) { if (InitializeXR(item)) { return true; } } Logger.LogError((object)"All available runtimes were attempted, but none worked. Aborting..."); return false; } private static bool InitializeXR(Runtime? runtime) { if ((Object)(object)xrManagerSettings == (Object)null || (Object)(object)xrGeneralSettings == (Object)null || (Object)(object)xrLoader == (Object)null) { return false; } if (runtime.HasValue) { Runtime valueOrDefault = runtime.GetValueOrDefault(); Logger.LogInfo((object)("Attempting to initialize OpenXR on " + valueOrDefault.Name)); Environment.SetEnvironmentVariable("XR_RUNTIME_JSON", valueOrDefault.Path); } else { Logger.LogInfo((object)"Attempting to initialize OpenXR using default runtime"); Environment.SetEnvironmentVariable("XR_RUNTIME_JSON", null); } xrGeneralSettings.InitXRSDK(); xrGeneralSettings.Start(); List list = new List(); SubsystemManager.GetInstances(list); if (Plugin.Config.VerboseLogging.Value) { Logger.LogWarning((object)"OpenXR Diagnostics Report:"); string[] array = GenerateReport().Split("\n"); foreach (string text in array) { Logger.LogWarning((object)text); } Logger.LogWarning((object)""); Logger.LogWarning((object)"To prevent diagnostic reports from being printed, disable the 'VerboseLogging' option in the settings."); } return list.Count > 0; } private static void InitializeScripts() { if (xrGeneralSettings == null) { xrGeneralSettings = ScriptableObject.CreateInstance(); } if (xrManagerSettings == null) { xrManagerSettings = ScriptableObject.CreateInstance(); } if (xrLoader == null) { xrLoader = ScriptableObject.CreateInstance(); } xrGeneralSettings.Manager = xrManagerSettings; ((List)xrManagerSettings.activeLoaders).Clear(); ((List)xrManagerSettings.activeLoaders).Add((XRLoader)(object)xrLoader); OpenXRSettings.Instance.renderMode = (RenderMode)0; OpenXRSettings.Instance.depthSubmissionMode = (DepthSubmissionMode)0; OpenXRSettings.Instance.features = AssetCollection.OpenXRFeatures.Features.ToArray(); } } [CompilerGenerated] private sealed class d__8 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private Runtime <>2__current; private int <>l__initialThreadId; Runtime IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { Runtime runtime2; string path; switch (<>1__state) { default: return false; case 0: { <>1__state = -1; Runtime? runtime = Utils.ExecuteWithSteamAPI((Func)delegate { //IL_0005: 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) if (SteamApps.IsAppInstalled(AppId.op_Implicit(250820))) { string text = SteamApps.AppInstallDir(AppId.op_Implicit(250820)); if (text != null && Runtime.ReadFromJson(Path.Combine(text, "steamxr_win64.json"), out var runtime3)) { return runtime3; } } return null; }); if (runtime.HasValue) { <>2__current = runtime.Value; <>1__state = 1; return true; } goto IL_0071; } case 1: <>1__state = -1; goto IL_0071; case 2: <>1__state = -1; goto IL_00ac; case 3: { <>1__state = -1; break; } IL_00ac: path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Oculus\\Support\\oculus-runtime\\oculus_openxr_64.json"); if (File.Exists(path) && Runtime.ReadFromJson(path, out runtime2)) { <>2__current = runtime2; <>1__state = 3; return true; } break; IL_0071: path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Virtual Desktop Streamer\\OpenXR\\virtualdesktop-openxr.json"); if (File.Exists(path) && Runtime.ReadFromJson(path, out runtime2)) { <>2__current = runtime2; <>1__state = 2; return true; } goto IL_00ac; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; return this; } return new d__8(0); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_GenerateReport")] private static extern nint Internal_GenerateReport(); [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_ReleaseReport")] private static extern void Internal_ReleaseReport(nint report); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRuntimeName")] private static extern bool Internal_GetRuntimeName(out nint runtimeNamePtr); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRuntimeVersion")] private static extern bool Internal_GetRuntimeVersion(out ushort major, out ushort minor, out ushort patch); private static string GenerateReport() { nint num = Internal_GenerateReport(); if (num == 0) { return ""; } string result = Marshal.PtrToStringAnsi(num); Internal_ReleaseReport(num); return result; } public static Runtimes GetRuntimes() { HashSet hashSet = new HashSet(); foreach (Runtime item in LocateCommonRuntimes()) { hashSet.Add(item); } string defaultRuntimePath = GetDefaultRuntimePath(); if (Native.RegOpenKeyEx(Native.HKEY_LOCAL_MACHINE, "SOFTWARE\\Khronos\\OpenXR\\1", 0, 131097, out nint phkResult) != 0) { return new Runtimes(hashSet.ToArray()); } List list = new List(); if (!Native.RegOpenSubKey(ref phkResult, "AvailableRuntimes", 131097) || !EnumRuntimeFiles(phkResult, list)) { if (string.IsNullOrEmpty(defaultRuntimePath)) { return new Runtimes(hashSet.ToArray()); } try { JToken val = JsonConvert.DeserializeObject(File.ReadAllText(defaultRuntimePath))[(object)"runtime"]; hashSet.Add(new Runtime { Name = val[(object)"name"].ToObject(), Path = defaultRuntimePath, Default = true }); } catch { } return new Runtimes(hashSet.ToArray()); } if (!string.IsNullOrEmpty(defaultRuntimePath) && !list.Contains(defaultRuntimePath)) { list.Add(defaultRuntimePath); } foreach (string item2 in list) { try { JToken val2 = JsonConvert.DeserializeObject(File.ReadAllText(item2))[(object)"runtime"]; hashSet.Add(new Runtime { Name = val2[(object)"name"].ToObject(), Path = item2, Default = (item2 == defaultRuntimePath) }); } catch (Exception ex) { Logger.LogWarning("Failed to parse " + item2 + ": " + ex.Message + ". Runtime will be skipped."); } } return new Runtimes(hashSet.ToArray()); } private static string? GetDefaultRuntimePath() { if (Native.RegOpenKeyEx(Native.HKEY_LOCAL_MACHINE, "SOFTWARE\\Khronos\\OpenXR\\1", 0, 131097, out var phkResult) != 0) { return null; } string result = null; uint lpcbData = 0u; uint lpType; bool flag = Native.RegQueryValueEx(phkResult, "ActiveRuntime", 0, out lpType, null, ref lpcbData) != 0; if (!flag) { bool flag2 = lpType - 1 <= 1; flag = !flag2; } if (flag) { return null; } StringBuilder stringBuilder = new StringBuilder((int)lpcbData); if (Native.RegQueryValueEx(phkResult, "ActiveRuntime", 0, out lpType, stringBuilder, ref lpcbData) == 0) { result = stringBuilder.ToString(); } return result; } private static bool EnumRuntimeFiles(nint hKey, List files) { if (Native.RegQueryInfoKey(hKey, null, IntPtr.Zero, IntPtr.Zero, out var _, out var _, out var _, out var lpcValues, out var lpcbMaxValueNameLen, out var _, IntPtr.Zero, IntPtr.Zero) != 0) { return false; } for (uint num = 0u; num < lpcValues; num++) { uint lpcchValueName = lpcbMaxValueNameLen + 1; StringBuilder stringBuilder = new StringBuilder((int)lpcchValueName); if (Native.RegEnumValue(hKey, num, stringBuilder, ref lpcchValueName, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero) == 0) { files.Add(stringBuilder.ToString()); } } return true; } [IteratorStateMachine(typeof(d__8))] private static IEnumerable LocateCommonRuntimes() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(-2); } public static bool GetActiveRuntimeName(out string name) { name = ""; if (!Internal_GetRuntimeName(out IntPtr runtimeNamePtr) || runtimeNamePtr == (IntPtr)0) { return false; } name = Marshal.PtrToStringAnsi(runtimeNamePtr); return true; } public static bool GetActiveRuntimeVersion(out ushort major, out ushort minor, out ushort patch) { return Internal_GetRuntimeVersion(out major, out minor, out patch); } } [PublicAPI] [BepInPlugin("io.daxcess.repoxr", "RepoXR", "1.2.2")] public class Plugin : BaseUnityPlugin { public const string PLUGIN_GUID = "io.daxcess.repoxr"; public const string PLUGIN_NAME = "RepoXR"; public const string PLUGIN_VERSION = "1.2.2"; public const string SUPPORTED_GAME_VERSION = "v0.4.3"; public static Config Config { get; private set; } public static Flags Flags { get; private set; } public static string GameVersion => Environment.GetEnvironmentVariable("REPO_VERSION") ?? "v?"; public static bool GameDebugBuild { get { if (!Environment.GetCommandLineArgs().Contains("--repoxr-force-release-build")) { return Debug.isDebugBuild; } return false; } } private void Awake() { CultureInfo.CurrentCulture = CultureInfo.InvariantCulture; InputSystem.PerformDefaultPluginInitialization(); Logger.source = ((BaseUnityPlugin)this).Logger; Config = new Config(((BaseUnityPlugin)this).Info.Location, ((BaseUnityPlugin)this).Config); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Starting RepoXR v1.2.2 (" + GetCommitHash() + ")")); bool flag = Config.DisableVR.Value || Environment.GetCommandLineArgs().Contains("--disable-vr", StringComparer.OrdinalIgnoreCase); if (flag) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"VR has been disabled by config or the `--disable-vr` command line flag"); } if (!PreloadRuntimeDependencies()) { ((BaseUnityPlugin)this).Logger.LogError((object)"Disabling mod because required runtime dependencies could not be loaded!"); return; } if (!AssetCollection.LoadAssets()) { ((BaseUnityPlugin)this).Logger.LogError((object)"Disabling mod because assets could not be loaded!"); return; } if (!flag && InitializeVR()) { Flags |= Flags.VR; } HarmonyPatcher.PatchUniversal(); HarmonyPatcher.PatchNetworkRPCs(); ((BaseUnityPlugin)this).Logger.LogDebug((object)"Inserted universal patches using Harmony"); if (Environment.GetCommandLineArgs().Contains("--repoxr-debug-eyetracking", StringComparer.OrdinalIgnoreCase)) { Flags |= Flags.EyeTrackingDebug; } Native.BringGameWindowToFront(); Config.SetupGlobalCallbacks(); SceneManager.sceneLoaded += delegate(Scene scene, LoadSceneMode _) { UniversalEntrypoint.OnSceneLoad(((Scene)(ref scene)).name); }; } public static string GetCommitHash() { try { AssemblyInformationalVersionAttribute? customAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute(); return ((customAttribute != null) ? customAttribute.InformationalVersion.Split('+')[1].Substring(0, 7) : null) ?? "unknown"; } catch { Logger.LogWarning("Failed to retrieve commit hash (compiled outside of git repo?)."); return "unknown"; } } private bool PreloadRuntimeDependencies() { try { string[] files = Directory.GetFiles(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "RuntimeDeps"), "*.dll"); foreach (string path in files) { string fileName = Path.GetFileName(path); try { Assembly.LoadFile(path); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Failed to preload '" + fileName + "': " + ex.Message)); } } } catch (Exception ex2) { ((BaseUnityPlugin)this).Logger.LogError((object)("Unexpected error occured while preloading runtime dependencies (incorrect folder structure?): " + ex2.Message)); return false; } return true; } private static bool InitializeVR() { Logger.LogInfo("Loading VR..."); if (!OpenXR.Loader.InitializeXR()) { Logger.LogError("Failed to start in VR Mode! Only Non-VR features are available!"); Logger.LogError("Make sure your headset is turned on and connected before starting the game."); Logger.LogWarning("You may ignore the previous error if you meant to play without VR"); Flags |= Flags.StartupFailed; return false; } if (OpenXR.GetActiveRuntimeName(out string name) && OpenXR.GetActiveRuntimeVersion(out var major, out var minor, out var patch)) { Logger.LogInfo($"OpenXR runtime being used: {name} ({major}.{minor}.{patch})"); } else { Logger.LogError("Could not get OpenXR runtime info?"); } HarmonyPatcher.PatchVR(); Logger.LogDebug("Inserted VR patches using Harmony"); XRSettings.eyeTextureResolutionScale = (float)Config.CameraResolution.Value / 100f; InputSystem.settings.backgroundBehavior = (BackgroundBehavior)2; return true; } public static MethodInfo GetConfigGetter() { return typeof(Plugin).GetProperty("Config", BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).GetGetMethod(nonPublic: true); } } [Flags] public enum Flags { VR = 1, StartupFailed = 2, EyeTrackingDebug = 4 } internal static class Utils { public class WaitUntilTimeout : CustomYieldInstruction { [CompilerGenerated] private Func P; [CompilerGenerated] private float P; private readonly float timeStarted; public override bool keepWaiting { get { if (!P()) { return Time.realtimeSinceStartup - timeStarted < P; } return false; } } public WaitUntilTimeout(Func predicate, float timeout) { P = predicate; P = timeout; timeStarted = Time.realtimeSinceStartup; ((CustomYieldInstruction)this)..ctor(); } } public static string ToHumanReadable(string input) { StringBuilder stringBuilder = new StringBuilder(input[0].ToString()); if (stringBuilder.Length <= 0) { return stringBuilder.ToString(); } for (int i = 1; i < input.Length; i++) { char c = input[i - 1]; char c2 = ((i + 1 < input.Length) ? input[i + 1] : '\0'); bool flag = char.IsLower(c2); bool flag2 = char.IsUpper(c2); bool flag3 = char.IsUpper(input[i]); bool flag4 = char.IsLower(c); bool flag5 = char.IsUpper(c); if (!string.IsNullOrWhiteSpace(c.ToString()) && ((flag5 && flag3 && flag) || (flag4 && flag3 && flag) || (flag4 && flag3 && flag2))) { stringBuilder.Append(' '); } stringBuilder.Append(input[i]); } return stringBuilder.ToString(); } public static string GetControlSpriteString(string controlPath) { if (string.IsNullOrEmpty(controlPath)) { return "NOT BOUND"; } string text = Regex.Replace(controlPath.ToLowerInvariant(), "<[^>]+>([^ ]+)", "$1"); string text2 = text.Split('/')[0].TrimStart('{').TrimEnd('}'); controlPath = Regex.Replace(string.Join("/", text.Split('/').Skip(1)), "{(.*)}", "$1"); if (!(text2 == "lefthand")) { if (text2 == "righthand") { switch (controlPath) { case "primary2daxis": case "thumbstick": goto IL_07a8; case "primary2daxisclick": case "thumbstickclicked": goto IL_07b0; case "thumbstick/up": case "primary2daxis/up": goto IL_07b8; case "primary2daxis/down": case "thumbstick/down": goto IL_07c0; case "primary2daxis/left": case "thumbstick/left": goto IL_07c8; case "thumbstick/right": case "primary2daxis/right": goto IL_07d0; case "primarybutton": case "primarypressed": goto IL_07d8; case "secondarypressed": case "secondarybutton": goto IL_07e0; case "triggerbutton": case "triggerpressed": case "trigger": goto IL_07e8; case "gripbutton": case "grip": case "grippressed": goto IL_07f0; } } switch (controlPath) { case "menu": case "menubutton": case "menupressed": break; default: goto IL_0800; } goto IL_07f8; } switch (controlPath) { case "thumbstick": case "primary2daxis": break; case "primary2daxisclick": case "thumbstickclicked": goto IL_0754; case "thumbstick/up": case "primary2daxis/up": goto IL_075f; case "primary2daxis/down": case "thumbstick/down": goto IL_076a; case "primary2daxis/left": case "thumbstick/left": goto IL_0775; case "thumbstick/right": case "primary2daxis/right": goto IL_0780; case "primarybutton": case "primarypressed": goto IL_0788; case "secondarypressed": case "secondarybutton": goto IL_0790; case "triggerbutton": case "triggerpressed": case "trigger": goto IL_0798; case "grip": case "gripbutton": case "grippressed": goto IL_07a0; case "menu": case "menubutton": case "menupressed": goto IL_07f8; default: goto IL_0800; } string text3 = "leftStick"; goto IL_0806; IL_0780: text3 = "leftStickRight"; goto IL_0806; IL_0775: text3 = "leftStickLeft"; goto IL_0806; IL_076a: text3 = "leftStickDown"; goto IL_0806; IL_0806: string text4 = text3; return ""; IL_07f0: text3 = "rightGrip"; goto IL_0806; IL_07e8: text3 = "rightTrigger"; goto IL_0806; IL_07e0: text3 = "rightSecondaryButton"; goto IL_0806; IL_07d8: text3 = "rightPrimaryButton"; goto IL_0806; IL_07d0: text3 = "rightStickRight"; goto IL_0806; IL_07c8: text3 = "rightStickLeft"; goto IL_0806; IL_07c0: text3 = "rightStickDown"; goto IL_0806; IL_07b8: text3 = "rightStickUp"; goto IL_0806; IL_07b0: text3 = "rightStickClick"; goto IL_0806; IL_07a8: text3 = "rightStick"; goto IL_0806; IL_0754: text3 = "leftStickClick"; goto IL_0806; IL_075f: text3 = "leftStickUp"; goto IL_0806; IL_0800: text3 = "unknown"; goto IL_0806; IL_07f8: text3 = "menuButton"; goto IL_0806; IL_07a0: text3 = "leftGrip"; goto IL_0806; IL_0798: text3 = "leftTrigger"; goto IL_0806; IL_0790: text3 = "leftSecondaryButton"; goto IL_0806; IL_0788: text3 = "leftPrimaryButton"; goto IL_0806; } public static bool GetControlHand(string controlPath, out HapticManager.Hand hand) { hand = HapticManager.Hand.Both; if (string.IsNullOrEmpty(controlPath)) { return false; } string text = Regex.Replace(controlPath.ToLowerInvariant(), "<[^>]+>([^ ]+)", "$1").Split('/')[0].TrimStart('{').TrimEnd('}'); hand = ((!(text == "lefthand")) ? HapticManager.Hand.Right : HapticManager.Hand.Left); return true; } public static T? ExecuteWithSteamAPI(Func func) { try { bool isValid = SteamClient.IsValid; if (!isValid) { SteamClient.Init(3241660u, false); } T result = func(); if (!isValid) { SteamClient.Shutdown(); } return result; } catch { return default(T); } } public static bool Collide(Collider lhs, params Collider[] rhs) { Collider lhs2 = lhs; Vector3 val = default(Vector3); float num = default(float); return rhs.Any((Collider collider) => Physics.ComputePenetration(lhs2, ((Component)lhs2).transform.position, ((Component)lhs2).transform.rotation, collider, ((Component)collider).transform.position, ((Component)collider).transform.rotation, ref val, ref num)); } public static void DisableScanlines(this SemiUI ui) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) UIScanlines componentInChildren = ((Component)ui).GetComponentInChildren(); if (componentInChildren != null) { ((Behaviour)componentInChildren).enabled = false; ((Graphic)componentInChildren.image).color = Color.clear; } } public static void SetUIAnchoredPosition(this SemiUI ui, Vector2 anchoredPosition) { //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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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) //IL_0024: 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_002b: Unknown result type (might be due to invalid IL or missing references) Vector2 hidePosition = ui.hidePosition - ui.showPosition; ((Component)ui).GetComponent().anchoredPosition = anchoredPosition; ui.showPosition = Vector2.zero; ui.hidePosition = hidePosition; ui.Start(); } public static void ReplaceOrInsert(this List list, T item, Predicate match) { int num = list.FindIndex(match); if (num >= 0) { list[num] = item; } else { list.Add(item); } } public static Color GetTextColor(Color baseColor, float minBrightness = 0.6f, float alpha = 1f) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //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) float num = 0.2126f * baseColor.r + 0.7152f * baseColor.g + 0.0722f * baseColor.b; if (num < minBrightness) { float num2 = Mathf.Clamp01((minBrightness - num) / minBrightness); baseColor = Color.Lerp(baseColor, Color.white, num2); } baseColor.a = alpha; return baseColor; } public static string StripSuffix(this string @string, string suffix) { if (!@string.EndsWith(suffix)) { return @string; } int length = suffix.Length; return @string.Substring(0, @string.Length - length); } public static LocalizedAsset L(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) return AssetCollection.GetLocalizedAsset(name).WaitForCompletion(); } } public static class PlayerLocalCameraExtensions { public static MethodInfo GetHandOverrideTransformMethod => AccessTools.Method(typeof(PlayerLocalCameraExtensions), "GetHandOverrideTransform", (Type[])null, (Type[])null); public static Transform GetHandOverrideTransform(this PlayerLocalCamera camera) { if (camera.GetOverrideActive()) { return camera.playerAvatar.PlayerVisionTarget.VisionTransform; } VRSession instance = VRSession.Instance; if (instance != null && camera.playerAvatar.isLocal) { return instance.Player.MainHand; } if (Object.op_Implicit((Object)(object)NetworkSystem.instance) && NetworkSystem.instance.GetNetworkPlayer(camera.playerAvatar, out NetworkPlayer networkPlayer)) { return networkPlayer.PrimaryHand; } return ((Component)camera).transform; } } public static class HashExtensions { private const ulong FNV_OFFSET_BASIS = 12201171901673549955uL; private const ulong FNV_PRIME = 7286768417uL; private static Dictionary typeHashCache = new Dictionary(); private static Dictionary methodHashCache = new Dictionary(); public static ulong GetNetworkHash(this Type type) { if (typeHashCache.TryGetValue(type, out var value)) { return value; } value = ComputeHash(Encoding.UTF8.GetBytes(TypeExtensions.GetFullNameWithGenericArguments(type))); typeHashCache[type] = value; return value; } public static ulong GetNetworkHash(this MethodBase method) { if (methodHashCache.TryGetValue(method, out var value)) { return value; } string fullNameWithGenericArguments = TypeExtensions.GetFullNameWithGenericArguments(method.DeclaringType); string text = method.Name + "<" + string.Join(", ", from a in method.GetGenericArguments() select TypeExtensions.GetFullNameWithGenericArguments(a.DeclaringType)) + ">(" + string.Join(",", from p in method.GetParameters() select TypeExtensions.GetFullNameWithGenericArguments(p.ParameterType)) + ")"; string s = fullNameWithGenericArguments + "::" + text; value = ComputeHash(Encoding.UTF8.GetBytes(s)); methodHashCache[method] = value; return value; } private static ulong ComputeHash(byte[] input) { ulong num = 12201171901673549955uL; foreach (byte b in input) { num ^= b; num *= 7286768417L; } return num; } } } namespace RepoXR.UI { public class ChatUI : MonoBehaviour { private ChatManager chatManager; private NonNativeKeyboard keyboard; private Vector3 keyboardScale; private float keyboardLerp; private ChatState prevState; private void Awake() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0099: 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) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) chatManager = ChatManager.instance; keyboard = Object.Instantiate(AssetCollection.Keyboard, ((Component)this).transform.TransformPoint(new Vector3(360f, -100f)), ((Component)this).transform.rotation * Quaternion.Euler(15f, 0f, 0f)).GetComponent(); keyboard.SubmitOnEnter = false; keyboard.OnKeyboardValueKeyPressed += OnKeyPressed; keyboard.OnKeyboardFunctionKeyPressed += OnFunctionKeyPressed; keyboardScale = Vector3.one * (((Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelLobbyMenu) ? 0.0175f : 0.005f); prevState = chatManager.chatState; } private void OnDestroy() { keyboard.OnKeyboardValueKeyPressed -= OnKeyPressed; keyboard.OnKeyboardFunctionKeyPressed -= OnFunctionKeyPressed; } private void Update() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Invalid comparison between Unknown and I4 //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Invalid comparison between Unknown and I4 //IL_006a: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Invalid comparison between Unknown and I4 //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)LoadingUI.instance).isActiveAndEnabled && (int)ChatManager.instance.chatState == 1) { chatManager.StateSet((ChatState)0); } if (!SemiFunc.MenuLevel() && Object.op_Implicit((Object)(object)MenuManager.instance.currentMenuPage) && (int)ChatManager.instance.chatState == 1) { chatManager.StateSet((ChatState)0); } if (((int)chatManager.chatState == 1 && chatManager.chatState != prevState) || (int)chatManager.chatState == 2) { PauseUI.instance?.ResetPosition(instant: true); } if ((Object)(object)RunManager.instance.levelCurrent != (Object)(object)RunManager.instance.levelLobbyMenu) { if ((int)chatManager.chatState == 1 && chatManager.chatState != prevState) { XRRayInteractorManager.Instance?.SetVisible(visible: true); } if ((int)chatManager.chatState != 1 && chatManager.chatState != prevState) { XRRayInteractorManager.Instance?.SetVisible(visible: false); } } prevState = chatManager.chatState; if ((int)chatManager.chatState == 1) { PhysGrabber.instance.ReleaseObject(-1, 0.1f); if (!((Component)keyboard).gameObject.activeSelf) { keyboard.PresentKeyboard(); } keyboardLerp += 8f * Time.deltaTime; keyboardLerp = Mathf.Clamp01(keyboardLerp); ((Component)keyboard).transform.localScale = Vector3.Slerp(Vector3.zero, keyboardScale, keyboardLerp); } else if (((Component)keyboard).gameObject.activeSelf) { keyboardLerp -= 8f * Time.deltaTime; keyboardLerp = Mathf.Clamp01(keyboardLerp); ((Component)keyboard).transform.localScale = Vector3.Slerp(Vector3.zero, keyboardScale, keyboardLerp); if (keyboardLerp == 0f) { keyboard.Close(); } } } private void LateUpdate() { //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_0040: 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) ((Component)keyboard).transform.position = ((Component)this).transform.TransformPoint(new Vector3(360f, -100f, 0f)); ((Component)keyboard).transform.rotation = ((Component)this).transform.rotation * Quaternion.Euler(15f, 0f, 0f); } private void AppendText(string text) { //IL_00a7: 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) string chatMessage = chatManager.chatMessage; ChatManager obj = chatManager; obj.chatMessage += text; if (chatManager.chatMessage.Length > 50) { ((SemiUI)ChatUI.instance).SemiUITextFlashColor(Color.red, 0.2f); ((SemiUI)ChatUI.instance).SemiUISpringShakeX(10f, 10f, 0.3f); ((SemiUI)ChatUI.instance).SemiUISpringScale(0.05f, 5f, 0.2f); MenuManager.instance.MenuEffectClick((MenuClickEffectType)2, (MenuPage)null, 1f, 1f, true); chatManager.chatMessage = chatMessage; } else { chatManager.TypeEffect(Color.yellow); } } private void OnKeyPressed(KeyboardValueKey key) { AppendText(keyboard.IsShifted ? key.ShiftValue : key.Value); } private void ChatHistoryCycle(bool previous) { //IL_00de: Unknown result type (might be due to invalid IL or missing references) if (chatManager.chatHistory.Count == 0) { return; } if (previous) { if (chatManager.chatHistoryIndex > 0) { ChatManager obj = chatManager; obj.chatHistoryIndex--; } else { chatManager.chatHistoryIndex = chatManager.chatHistory.Count - 1; } } else if (chatManager.chatHistoryIndex < chatManager.chatHistory.Count - 1) { ChatManager obj2 = chatManager; obj2.chatHistoryIndex++; } else { chatManager.chatHistoryIndex = 0; } chatManager.chatMessage = chatManager.chatHistory[chatManager.chatHistoryIndex]; ((TMP_Text)chatManager.chatText).text = chatManager.chatMessage; ((SemiUI)ChatUI.instance).SemiUITextFlashColor(Color.cyan, 0.2f); ((SemiUI)ChatUI.instance).SemiUISpringShakeY(2f, 5f, 0.2f); MenuManager.instance.MenuEffectClick((MenuClickEffectType)4, (MenuPage)null, 1f, 0.2f, true); } private void OnFunctionKeyPressed(KeyboardKeyFunc key) { switch (key.ButtonFunction) { case KeyboardKeyFunc.Function.Backspace: if (chatManager.chatMessage.Length != 0) { string chatMessage = chatManager.chatMessage; chatMessage = chatMessage.Remove(Mathf.Max(chatMessage.Length - 1, 0)); chatManager.chatMessage = chatMessage; ((TMP_Text)chatManager.chatText).text = chatMessage; chatManager.CharRemoveEffect(); } break; case KeyboardKeyFunc.Function.Enter: chatManager.StateSet((ChatState)((!(chatManager.chatMessage == "")) ? 3 : 0)); break; case KeyboardKeyFunc.Function.Space: AppendText(" "); break; case KeyboardKeyFunc.Function.Previous: ChatHistoryCycle(previous: true); break; case KeyboardKeyFunc.Function.Next: ChatHistoryCycle(previous: false); break; } } } public class Crosshair : MonoBehaviour { public static Crosshair instance; public const int LayerMask = 9504257; private Transform camera; private Transform sprite; private void Awake() { instance = this; camera = ((Component)Camera.main).transform; sprite = ((Component)((Component)this).GetComponentInChildren(true)).transform; } private void OnDestroy() { instance = null; } private void Update() { //IL_0015: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) VRSession vRSession = VRSession.Instance; if (vRSession != null) { RaycastHit val = default(RaycastHit); if (!Physics.Raycast(new Ray(vRSession.Player.MainHand.position, vRSession.Player.MainHand.forward), ref val, 10f, 9504257)) { ((Component)this).transform.position = Vector3.down * 3000f; return; } if (Object.op_Implicit((Object)(object)PhysGrabber.instance.grabbedObject)) { sprite.position = Vector3.down * 3000f; return; } if (((Component)((RaycastHit)(ref val)).collider).CompareTag("Phys Grab Object") && Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponentInParent())) { ((Component)this).transform.SetPositionAndRotation(((RaycastHit)(ref val)).point, Quaternion.LookRotation(((RaycastHit)(ref val)).point - camera.position) * Quaternion.Euler(0f, 90f, 90f)); return; } float num = Mathf.Abs(Mathf.Max(0f, Vector3.Dot(((RaycastHit)(ref val)).normal, Vector3.up) - 0.5f)) / 0.5f; Vector3 val2 = Vector3.ProjectOnPlane(camera.position - ((RaycastHit)(ref val)).point, ((RaycastHit)(ref val)).normal); Vector3 normalized = ((Vector3)(ref val2)).normalized; Quaternion val3 = Quaternion.LookRotation(Quaternion.AngleAxis(90f, ((RaycastHit)(ref val)).normal) * normalized, ((RaycastHit)(ref val)).normal); Quaternion val4 = Quaternion.Lerp(Quaternion.Euler(0f, ((Quaternion)(ref val3)).eulerAngles.y, ((Quaternion)(ref val3)).eulerAngles.z), val3, num); ((Component)this).transform.SetPositionAndRotation(((RaycastHit)(ref val)).point, val4); sprite.localScale = Vector3.Lerp(Vector3.one * 0.3f, Vector3.one, ((RaycastHit)(ref val)).distance * 0.33f); sprite.localPosition = Vector3.zero; } } } [ExecuteInEditMode] [RequireComponent(typeof(TextMeshProUGUI))] public class CurvedTMP : MonoBehaviour { private TextMeshProUGUI textComponent; [SerializeField] private float radius = 10f; private void Awake() { textComponent = ((Component)this).GetComponent(); } private void OnEnable() { ((TMP_Text)textComponent).OnPreRenderText += UpdateTextCurve; OnCurvePropertyChanged(); } private void OnDisable() { ((TMP_Text)textComponent).OnPreRenderText -= UpdateTextCurve; } private void OnCurvePropertyChanged() { UpdateTextCurve(((TMP_Text)textComponent).textInfo); ((TMP_Text)textComponent).ForceMeshUpdate(false, false); } private void UpdateTextCurve(TMP_TextInfo textInfo) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a5: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < Mathf.Min(textInfo.characterCount, textInfo.characterInfo.Length); i++) { if (textInfo.characterInfo[i].isVisible) { int vertexIndex = textInfo.characterInfo[i].vertexIndex; int materialReferenceIndex = textInfo.characterInfo[i].materialReferenceIndex; Vector3[] vertices = textInfo.meshInfo[materialReferenceIndex].vertices; Vector3 val = Vector2.op_Implicit(new Vector2((vertices[vertexIndex].x + vertices[vertexIndex + 2].x) / 2f, textInfo.characterInfo[i].baseLine)); ref Vector3 reference = ref vertices[vertexIndex]; reference += -val; ref Vector3 reference2 = ref vertices[vertexIndex + 1]; reference2 += -val; ref Vector3 reference3 = ref vertices[vertexIndex + 2]; reference3 += -val; ref Vector3 reference4 = ref vertices[vertexIndex + 3]; reference4 += -val; Matrix4x4 val2 = ComputeTransformationMatrix(val, textInfo, i); vertices[vertexIndex] = ((Matrix4x4)(ref val2)).MultiplyPoint3x4(vertices[vertexIndex]); vertices[vertexIndex + 1] = ((Matrix4x4)(ref val2)).MultiplyPoint3x4(vertices[vertexIndex + 1]); vertices[vertexIndex + 2] = ((Matrix4x4)(ref val2)).MultiplyPoint3x4(vertices[vertexIndex + 2]); vertices[vertexIndex + 3] = ((Matrix4x4)(ref val2)).MultiplyPoint3x4(vertices[vertexIndex + 3]); } } } private Matrix4x4 ComputeTransformationMatrix(Vector3 charMidBaselinePos, TMP_TextInfo textInfo, int charIdx) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) float num = radius + textInfo.lineInfo[textInfo.characterInfo[charIdx].lineNumber].baseline; float num2 = 2f * num * MathF.PI; float num3 = ((charMidBaselinePos.x / num2 - 0.5f) * 360f + 90f) * (MathF.PI / 180f); float num4 = Mathf.Cos(num3); float num5 = Mathf.Sin(num3); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(num4 * num, (0f - num5) * num); float num6 = (0f - Mathf.Atan2(num5, num4)) * 57.29578f - 90f; return Matrix4x4.TRS(new Vector3(val.x, val.y, 0f), Quaternion.AngleAxis(num6, Vector3.forward), Vector3.one); } } public class FocusSphere : MonoBehaviour { private static readonly int FadeStart = Shader.PropertyToID("_FadeStart"); private static readonly int FadeEnd = Shader.PropertyToID("_FadeEnd"); [SerializeField] protected Renderer renderer; [SerializeField] protected AnimationCurve animIn; [SerializeField] protected AnimationCurve animOut; private Transform camera; private Transform? lookAtTarget; private float lookAtTimer; private float lookAtSpeed; private float lookAtStrength; private float strengthLerp; private void Awake() { renderer.material.SetFloat(FadeStart, 0f); renderer.material.SetFloat(FadeEnd, 0f); camera = ((Component)Camera.main).transform; } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.localPosition = camera.localPosition; bool num = (Object)(object)lookAtTarget != (Object)null; bool flag = num && lookAtTimer > 0f; strengthLerp = Mathf.Clamp01(strengthLerp + (flag ? lookAtSpeed : (0f - lookAtSpeed)) * Time.deltaTime); if (lookAtTimer > 0f) { lookAtTimer = Mathf.Max(0f, lookAtTimer - Time.deltaTime); renderer.material.SetFloat(FadeStart, animIn.Evaluate(strengthLerp) * lookAtStrength * 0.92f); renderer.material.SetFloat(FadeEnd, animIn.Evaluate(strengthLerp) * lookAtStrength); } else if (strengthLerp > 0f) { renderer.material.SetFloat(FadeStart, animOut.Evaluate(strengthLerp) * lookAtStrength * 0.92f); renderer.material.SetFloat(FadeEnd, animOut.Evaluate(strengthLerp) * lookAtStrength); } if (num && strengthLerp > 0f) { ((Component)this).transform.LookAt(lookAtTarget); } } public void SetLookAtTarget(Transform target, float time, float speed, float strength) { strength = Mathf.Clamp01(strength); lookAtTarget = target; lookAtTimer = time; lookAtSpeed = speed; lookAtStrength = strength; } } public class GameHud : MonoBehaviour { [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameHud <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0071: 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) int num = <>1__state; GameHud gameHud = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; gameHud.camera = ((Component)CameraOverlay.instance.overlayCamera).transform; DisableEventSystem(); gameHud.SetupOverlayCanvas(); gameHud.SetupSmoothedCanvas(); gameHud.SetupPauseMenu(); gameHud.SetupInfoHUD(); ((Component)HUDCanvas.instance).transform.position = Vector3.down * 10000f; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Transform smoothCanvasContainer; private Transform camera; private PauseUI pause; public Canvas OverlayCanvas { get; private set; } public Canvas SmoothedCanvas { get; private set; } [IteratorStateMachine(typeof(d__11))] private IEnumerator Start() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this }; } private void LateUpdate() { //IL_0027: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0058: 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_0077: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_008e: 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) //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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)camera)) { Vector3 val = ((Object.op_Implicit((Object)(object)SpectateCamera.instance) && SpectateCamera.instance.CheckState((State)0)) ? ((Component)SpectateCamera.instance).transform.up : Vector3.up); Vector3 val2 = camera.position + Vector3.down * 0.15f + camera.forward * Plugin.Config.SmoothCanvasDistance.Value; Quaternion val3 = Quaternion.LookRotation(camera.forward, val); ((Component)SmoothedCanvas).transform.position = Vector3.Slerp(((Component)SmoothedCanvas).transform.position, val2, 0.1f); ((Component)SmoothedCanvas).transform.rotation = Quaternion.Slerp(((Component)SmoothedCanvas).transform.rotation, val3, 0.1f); } } public void PauseGame() { pause.Show(); } public void ResumeGame(bool instant = false) { pause.Hide(instant); } private static void DisableEventSystem() { GameObject obj = GameObject.Find("EventSystem"); InputSystemUIInputModule val = ((obj != null) ? obj.GetComponent() : null); if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = false; } } private void SetupOverlayCanvas() { //IL_0040: 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_0078: 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_008e: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00dc: Unknown result type (might be due to invalid IL or missing references) OverlayCanvas = GameObject.Find("VR Overlay Canvas").GetComponent(); OverlayCanvas.worldCamera = CameraOverlay.instance.overlayCamera; OverlayCanvas.renderMode = (RenderMode)1; ((Component)WorldSpaceUIParent.instance).transform.localScale = Vector3.one * 0.005f; TumbleUI instance = TumbleUI.instance; RectTransform component = ((Component)instance).GetComponent(); ((Component)component).transform.parent = ((Component)OverlayCanvas).transform; component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.anchoredPosition = Vector2.zero; component.sizeDelta = Vector2.zero; ((Component)component).transform.localPosition = Vector3.down * 130f; ((Component)component).transform.localRotation = Quaternion.identity; foreach (Transform item in (Transform)component) { Object.Destroy((Object)(object)((Component)item).gameObject); } Transform transform = Object.Instantiate(AssetCollection.VRTumble, (Transform)(object)component).transform; instance.parts1[0] = ((Component)transform.Find("Top 1")).gameObject; instance.parts1[1] = ((Component)transform.Find("Bottom 1")).gameObject; instance.parts1[2] = ((Component)transform.Find("Left 1")).gameObject; instance.parts1[3] = ((Component)transform.Find("Right 1")).gameObject; instance.parts2[0] = ((Component)transform.Find("Top 2")).gameObject; instance.parts2[1] = ((Component)transform.Find("Bottom 2")).gameObject; instance.parts2[2] = ((Component)transform.Find("Left 2")).gameObject; instance.parts2[3] = ((Component)transform.Find("Right 2")).gameObject; instance.images1 = instance.parts1.Select((GameObject part) => part.GetComponent()).ToArray(); instance.images2 = instance.parts2.Select((GameObject part) => part.GetComponent()).ToArray(); } private void SetupSmoothedCanvas() { //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_0012: 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) //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_005f: 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_006f: 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_007f: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("VR Smoothed Canvas - Container") { layer = 5 }; val.transform.parent = camera.parent.parent.parent; smoothCanvasContainer = val.transform; GameObject val2 = new GameObject("VR Smoothed Canvas") { layer = 5 }; val2.transform.parent = smoothCanvasContainer; val2.transform.localScale = Vector3.one * 0.003f; val2.transform.localPosition = Vector3.zero; val2.transform.localEulerAngles = Vector3.zero; SmoothedCanvas = val2.AddComponent(); SmoothedCanvas.renderMode = (RenderMode)2; ((Component)SmoothedCanvas).gameObject.AddComponent(); RectTransform component = ((Component)SmoothedCanvas).GetComponent(); component.sizeDelta = new Vector2(712f, 400f); Transform val3 = ((Component)HUDCanvas.instance).transform.Find("HUD/Game Hud"); Transform val4 = ((Component)HUDCanvas.instance).transform.Find("HUD/Chat Local"); GameObject obj = GameObject.Find("UI/UI/Canvas/DebugConsole"); Transform obj2 = ((obj != null) ? obj.transform : null); val3.SetParent((Transform)(object)component, false); val4.SetParent((Transform)(object)component, false); if (obj2 != null) { obj2.SetParent((Transform)(object)component, false); } } private void SetupPauseMenu() { //IL_0005: 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_002a: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("VR Pause Menu / Chat"); val.transform.parent = ((Component)camera).transform.parent.parent; val.transform.localPosition = Vector3.down * 3000f; val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one * 0.01f; val.layer = 5; Canvas val2 = val.AddComponent(); Transform transform = ((Component)MenuHolder.instance).transform; RectTransform component = ((Component)transform).GetComponent(); ((Component)val2).gameObject.AddComponent(); val2.renderMode = (RenderMode)2; val2.sortingOrder = 5; transform.SetParent(((Component)val2).transform, false); transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; transform.localScale = Vector3.one; ((Component)transform).gameObject.AddComponent(); Vector2 val3 = -(component.sizeDelta * 0.5f) + new Vector2(50f, 0f); pause = ((Component)val2).gameObject.AddComponent(); pause.positionOffset = new Vector3(val3.x * 0.01f, val3.y * 0.01f, 0f); GameObject val4 = new GameObject("Chat Holder"); val4.transform.parent = ((Component)val2).transform; RectTransform val5 = val4.AddComponent(); val5.sizeDelta = new Vector2(720f, 450f); val5.pivot = Vector2.zero; ((Transform)val5).localPosition = Vector3.zero; ((Transform)val5).localRotation = Quaternion.identity; ((Transform)val5).localScale = Vector3.one; ((Component)val5).gameObject.AddComponent(); Transform val6 = ((Component)HUDCanvas.instance).transform.Find("HUD/Chat"); if (SemiFunc.IsMultiplayer()) { val6.SetParent((Transform)(object)val5, false); } else { ((Component)val6).gameObject.SetActive(false); } } private void SetupInfoHUD() { //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) SemiUI component = ((Component)GoalUI.instance).GetComponent(); SemiUI component2 = ((Component)HaulUI.instance).GetComponent(); SemiUI component3 = ((Component)HealthUI.instance).GetComponent(); SemiUI component4 = ((Component)EnergyUI.instance).GetComponent(); SemiUI component5 = ((Component)StatsUI.instance).GetComponent(); SemiUI component6 = ((Component)LevelUI.instance).GetComponent(); ((Component)component).transform.SetParent((Transform)(object)VRSession.Instance.Player.Rig.infoHud, false); ((Component)component2).transform.SetParent((Transform)(object)VRSession.Instance.Player.Rig.infoHud, false); ((Component)component3).transform.SetParent((Transform)(object)VRSession.Instance.Player.Rig.infoHud, false); ((Component)component4).transform.SetParent((Transform)(object)VRSession.Instance.Player.Rig.infoHud, false); ((Component)component5).transform.SetParent((Transform)(object)VRSession.Instance.Player.Rig.infoHud, false); ((Component)component6).transform.SetParent((Transform)(object)VRSession.Instance.Player.Rig.infoHud, false); component.DisableScanlines(); component2.DisableScanlines(); component3.DisableScanlines(); component4.DisableScanlines(); component5.DisableScanlines(); component6.DisableScanlines(); component.SetUIAnchoredPosition(new Vector2(0f, -30f)); component2.SetUIAnchoredPosition(Vector2.zero); component3.SetUIAnchoredPosition(new Vector2(30f, 0f)); component4.SetUIAnchoredPosition(new Vector2(30f, -30f)); component5.SetUIAnchoredPosition(new Vector2(50f, 50f)); component6.SetUIAnchoredPosition(new Vector2(50f, 50f)); } } public class LoadingUI : MonoBehaviour { [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LoadingUI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; LoadingUI loadingUI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; loadingUI.RestorePosition(); <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; loadingUI.RestorePosition(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static LoadingUI instance; private static Vector3 lastLocalPosition; private static float lastLocalRotation; private Transform camera; private void Awake() { instance = this; camera = ((Component)Camera.main).transform; RestorePosition(); } private void OnDestroy() { instance = null; } [IteratorStateMachine(typeof(d__6))] private IEnumerator Start() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { <>4__this = this }; } private void OnDisable() { //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_0016: Unknown result type (might be due to invalid IL or missing references) lastLocalPosition = ((Component)this).transform.localPosition; lastLocalRotation = ((Component)this).transform.localEulerAngles.y; } public void ResetPosition() { //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_0010: 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_0018: 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_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_004c: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00b7: 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) Vector3 val = camera.localRotation * Vector3.forward; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized.y = 0f; ((Vector3)(ref normalized)).Normalize(); Vector3 val2 = ((Component)camera).transform.localPosition + normalized * 5f + Vector3.up * 0.15f; val = new Vector3(camera.localPosition.x, val2.y, camera.localPosition.z) - val2; Vector3 val3 = -((Vector3)(ref val)).normalized; ((Component)this).transform.localPosition = val2; ((Component)this).transform.localRotation = Quaternion.LookRotation(val3); } private void RestorePosition() { //IL_0006: 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) ((Component)this).transform.localPosition = lastLocalPosition; ((Component)this).transform.localEulerAngles = lastLocalRotation * Vector3.up; } } public class MainMenu : MonoBehaviour { [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //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_0061: 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_0072: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if ((Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)305)) && Input.GetKeyDown((KeyCode)99)) { Lobby currentLobby = SteamManager.instance.currentLobby; string text2 = (GUIUtility.systemCopyBuffer = $"steam://joinlobby/3241660/{((Lobby)(ref currentLobby)).Id}/{((Lobby)(ref currentLobby)).Owner.Id}"); Logger.LogInfo("Copied lobby link: " + text2); } } else { <>1__state = -1; } <>2__current = null; <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MainMenu <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; MainMenu mainMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; DisableEventSystem(); mainMenu.SetupMainCamera(); mainMenu.SetupMainCanvas(); mainMenu.SetupControllers(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Camera mainCamera; private Canvas mainCanvas; private void Awake() { Actions.Instance["ResetHeight"].performed += OnResetHeight; if ((Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelLobbyMenu) { ((MonoBehaviour)this).StartCoroutine(LobbyLinkCopy()); } } private void OnDestroy() { Actions.Instance["ResetHeight"].performed -= OnResetHeight; } [IteratorStateMachine(typeof(d__4))] private IEnumerator Start() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } private static void DisableEventSystem() { GameObject obj = GameObject.Find("EventSystem"); InputSystemUIInputModule val = ((obj != null) ? obj.GetComponent() : null); if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = false; } } private void SetupMainCamera() { mainCamera = CameraUtils.Instance.MainCamera; Camera component = ((Component)((Component)mainCamera).transform.Find("Camera Top")).GetComponent(); component.depth = 1f; component.targetTexture = null; } private void SetupMainCanvas() { //IL_0036: 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_006f: 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) mainCanvas = ((Component)HUDCanvas.instance).GetComponent(); mainCanvas.renderMode = (RenderMode)2; ((Component)mainCanvas).transform.position = new Vector3(-45f, -0.75f, 6f); ((Component)mainCanvas).transform.eulerAngles = new Vector3(0f, 50f, 0f); ((Component)mainCanvas).transform.localScale = Vector3.one * 0.03f; ((Component)((Component)mainCanvas).transform.Find("HUD")).gameObject.AddComponent(); Object.Destroy((Object)(object)((Component)mainCanvas).GetComponent()); ((Component)mainCanvas).gameObject.AddComponent(); ((Component)((Component)mainCanvas).transform.Find("HUD/Game Hud")).gameObject.SetActive(false); ((Component)((Component)mainCanvas).transform.Find("HUD/Chat Local")).gameObject.SetActive(false); if ((Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelLobbyMenu) { ((Transform)((Component)((Component)mainCanvas).transform.Find("HUD/Chat")).GetComponent()).SetParent(((Component)mainCanvas).transform.Find("HUD"), false); } else { ((Component)((Component)mainCanvas).transform.Find("HUD/Chat")).gameObject.SetActive(false); } MenuSelectionBoxTop val = Object.FindObjectOfType(true); ((Component)val).transform.parent.parent = ((Component)val).transform.parent.parent.parent; } private void SetupControllers() { ((Component)((Component)mainCamera).transform.parent).gameObject.AddComponent(); } [IteratorStateMachine(typeof(d__9))] private static IEnumerator LobbyLinkCopy() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0); } private static void OnResetHeight(CallbackContext obj) { VRCameraAim.instance.SetPlayerAim(0f, forceInitial: true); } } public class PasswordUI : MonoBehaviour { private MenuPagePassword passwordPage; private NonNativeKeyboard keyboard; private void Awake() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) passwordPage = ((Component)this).GetComponent(); LoadingUI instance = LoadingUI.instance; ((Component)instance).gameObject.AddComponent(); ((Component)instance).gameObject.AddComponent(); ((Component)passwordPage).transform.SetParent(((Component)instance).transform); ((Component)passwordPage).transform.localPosition = Vector3.zero; ((Component)passwordPage).transform.localRotation = Quaternion.identity; ((Component)passwordPage).transform.localScale = Vector3.one; ((Component)passwordPage).GetComponent().pivot = Vector2.one * 0.5f; ((Component)Object.FindObjectOfType()).transform.parent.SetParent(((Component)instance).transform); keyboard = Object.Instantiate(AssetCollection.Keyboard).GetComponent(); ((Component)keyboard).transform.position = ((Component)instance).transform.position + Vector3.down * 1.5f; ((Component)keyboard).transform.rotation = ((Component)instance).transform.rotation * Quaternion.Euler(15f, 0f, 0f); keyboard.PresentKeyboard(); keyboard.OnKeyboardValueKeyPressed += OnKeyboardKeyPressed; keyboard.OnKeyboardFunctionKeyPressed += OnKeyboardFunctionKeyPressed; if (!Object.op_Implicit((Object)(object)XRRayInteractorManager.Instance)) { new GameObject("Controllers").AddComponent(); } XRRayInteractorManager.Instance.SetLineSortingOrder(15); } private void OnDestroy() { keyboard.OnKeyboardValueKeyPressed -= OnKeyboardKeyPressed; keyboard.OnKeyboardFunctionKeyPressed -= OnKeyboardFunctionKeyPressed; } public void OnConfirm() { keyboard.Close(); XRRayInteractorManager.Instance?.SetLineSortingOrder(0); } private void OnKeyboardKeyPressed(KeyboardValueKey key) { MenuPagePassword obj = passwordPage; obj.password += (keyboard.IsShifted ? key.ShiftValue : key.Value); } private void OnKeyboardFunctionKeyPressed(KeyboardKeyFunc key) { switch (key.ButtonFunction) { case KeyboardKeyFunc.Function.Enter: passwordPage.ConfirmButton(); break; case KeyboardKeyFunc.Function.Backspace: passwordPage.password = passwordPage.password.Remove(Mathf.Max(passwordPage.password.Length - 1, 0)); break; } } } public class PauseUI : MonoBehaviour { public static PauseUI? instance; public Vector3 positionOffset; private Vector3 targetPos; private Quaternion targetRot; private Transform camera; private XRRayInteractorManager interactor; private bool isOpen; private float darkness; private void Awake() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) instance = this; camera = ((Component)Camera.main).transform; interactor = ((Component)((Component)camera).transform.parent).gameObject.AddComponent(); interactor.SetVisible(visible: false); MenuSelectionBoxTop obj = Object.FindObjectOfType(); ((Component)obj).transform.parent.SetParent(((Component)this).transform, false); ((Component)obj).transform.parent.localPosition = Vector3.zero; ((Component)obj).transform.parent.localRotation = Quaternion.identity; ((Component)obj).transform.parent.localScale = Vector3.one; } private void OnEnable() { Actions.Instance["ResetHeight"].performed += OnResetHeight; } private void OnDisable() { Actions.Instance["ResetHeight"].performed -= OnResetHeight; } private void OnDestroy() { instance = null; } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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) ((Component)this).transform.localPosition = Vector3.Lerp(((Component)this).transform.localPosition, targetPos, 8f * Time.deltaTime); ((Component)this).transform.localRotation = Quaternion.Slerp(((Component)this).transform.localRotation, targetRot, 8f * Time.deltaTime); } private void LateUpdate() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) darkness = Mathf.Lerp(darkness, isOpen ? 0.75f : 0f, 6f * Time.deltaTime); if (darkness < 0.01f) { darkness = 0f; } if (darkness > 0f) { ((Graphic)FadeOverlay.Instance.Image).color = new Color(0f, 0f, 0f, darkness); interactor.SetLineSortingOrder(6); } else { interactor.SetLineSortingOrder(4); } } public void Show() { if (!isOpen) { isOpen = true; ResetPosition(instant: true); interactor.SetVisible(visible: true); } } public void Hide(bool instant) { isOpen = false; interactor.SetVisible(visible: false); if (instant) { MenuManager.instance.PageCloseAll(); darkness = 0f; } } public void ResetPosition(bool instant = false) { //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_0010: 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_0018: 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_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_004c: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) Vector3 val = camera.localRotation * Vector3.forward; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized.y = 0f; ((Vector3)(ref normalized)).Normalize(); Vector3 val2 = ((Component)camera).transform.localPosition + normalized * 5f + Vector3.up * 0.15f; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(camera.localPosition.x, val2.y, camera.localPosition.z); val = val3 - val2; targetRot = Quaternion.LookRotation(-((Vector3)(ref val)).normalized); targetPos = val2 + targetRot * positionOffset; if (instant) { ((Component)this).transform.localPosition = targetPos; ((Component)this).transform.localRotation = targetRot; } } private void OnResetHeight(CallbackContext ctx) { if (((CallbackContext)(ref ctx)).performed && isOpen) { ResetPosition(); } } } public class ValuableDiscoverGraphic : MonoBehaviour { private static readonly int BaseColor = Shader.PropertyToID("_BaseColor"); private static readonly int EdgeColor = Shader.PropertyToID("_EdgeColor"); public Renderer renderer; private ValuableDiscoverGraphic baseGraphic; internal PhysGrabObject target; private State state; private bool discovered; private float waitTimer; private float animLerp; private Vector3 targetCenter; private Vector3 targetSize; private void Awake() { baseGraphic = ValuableDiscover.instance.graphicPrefab.GetComponent(); } private void Start() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 ((Component)this).transform.localScale = Vector3.zero; State val = state; float num = (((int)val == 1) ? 0.5f : (((int)val != 2) ? 1f : 3f)); waitTimer = num; } private void Update() { //IL_0018: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Invalid comparison between Unknown and I4 //IL_00ea: 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) if (Object.op_Implicit((Object)(object)target)) { Bounds val = default(Bounds); ((Bounds)(ref val))..ctor(target.centerPoint, Vector3.zero); MeshRenderer[] componentsInChildren = ((Component)target).GetComponentsInChildren(); foreach (MeshRenderer val2 in componentsInChildren) { ((Bounds)(ref val)).Encapsulate(((Renderer)val2).bounds); } ((Bounds)(ref val)).Expand(0.05f); targetCenter = ((Bounds)(ref val)).center; targetSize = ((Bounds)(ref val)).size; if (VREyeTracking.LookingAt(((Bounds)(ref val)).center, 0.5f, 0.5f) && !discovered) { if ((int)state == 1) { baseGraphic.sound.Play(target.centerPoint, 0.3f, 1f, 1f, 1f); } else { baseGraphic.sound.Play(target.centerPoint, 1f, 1f, 1f, 1f); } renderer.enabled = true; discovered = true; } } else { waitTimer = 0f; } ((Component)this).transform.position = targetCenter; if (waitTimer > 0f) { animLerp = Mathf.Clamp01(animLerp + baseGraphic.introSpeed * Time.deltaTime); ((Component)this).transform.localScale = Vector3.LerpUnclamped(Vector3.zero, targetSize, baseGraphic.introCurve.Evaluate(animLerp)); if (!(animLerp < 1f)) { waitTimer -= Time.deltaTime; if (waitTimer <= 0f) { animLerp = 0f; } } } else { animLerp = Mathf.Clamp01(animLerp + baseGraphic.outroSpeed * Time.deltaTime); ((Component)this).transform.localScale = Vector3.LerpUnclamped(targetSize, Vector3.zero, baseGraphic.outroCurve.Evaluate(animLerp)); if (animLerp >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public void ReminderSetup() { //IL_0002: 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) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_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_0045: Unknown result type (might be due to invalid IL or missing references) state = (State)1; Color colorReminderMiddle = baseGraphic.ColorReminderMiddle; Color colorReminderCorner = baseGraphic.ColorReminderCorner; renderer.material.SetColor(BaseColor, colorReminderMiddle); renderer.material.SetColor(EdgeColor, colorReminderCorner); } public void BadSetup() { //IL_0002: 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) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_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_0045: Unknown result type (might be due to invalid IL or missing references) state = (State)2; Color colorBadMiddle = baseGraphic.ColorBadMiddle; Color colorBadCorner = baseGraphic.ColorBadCorner; renderer.material.SetColor(BaseColor, colorBadMiddle); renderer.material.SetColor(EdgeColor, colorBadCorner); } public void CustomSetup(State newState, Color baseColor, Color edgeColor) { //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_0017: 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) state = newState; renderer.material.SetColor(BaseColor, baseColor); renderer.material.SetColor(EdgeColor, edgeColor); } } public class XRRayInteractorManager : MonoBehaviour { private enum ActiveController { Left, Right } private XRRayInteractor leftInteractor; private XRRayInteractor rightInteractor; private ActionBasedController leftActions; private ActionBasedController rightActions; private LineRenderer leftRenderer; private LineRenderer rightRenderer; private ActiveController activeController; public static XRRayInteractorManager? Instance { get; private set; } private void Awake() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0095: Unknown result type (might be due to invalid IL or missing references) Instance = this; (ActionBasedController, XRRayInteractor, LineRenderer) tuple = CreateInteractorController("Left"); leftActions = tuple.Item1; leftInteractor = tuple.Item2; leftRenderer = tuple.Item3; tuple = CreateInteractorController("Right"); rightActions = tuple.Item1; rightInteractor = tuple.Item2; rightRenderer = tuple.Item3; InputActionProperty uiPressAction = leftActions.uiPressAction; ((InputActionProperty)(ref uiPressAction)).action.performed += LeftControllerPressed; uiPressAction = rightActions.uiPressAction; ((InputActionProperty)(ref uiPressAction)).action.performed += RightControllerPressed; UpdateActiveController(ActiveController.Right); } private void OnDestroy() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0035: Unknown result type (might be due to invalid IL or missing references) Instance = null; InputActionProperty uiPressAction = leftActions.uiPressAction; ((InputActionProperty)(ref uiPressAction)).action.performed -= LeftControllerPressed; uiPressAction = rightActions.uiPressAction; ((InputActionProperty)(ref uiPressAction)).action.performed -= RightControllerPressed; } public void SetVisible(bool visible) { ((Behaviour)((Component)leftInteractor).GetComponent()).enabled = visible; ((Behaviour)((Component)rightInteractor).GetComponent()).enabled = visible; } public void SetLineSortingOrder(int sortingOrder) { ((Renderer)leftRenderer).sortingOrder = sortingOrder; ((Renderer)rightRenderer).sortingOrder = sortingOrder; } private void LeftControllerPressed(CallbackContext obj) { UpdateActiveController(ActiveController.Left); } private void RightControllerPressed(CallbackContext obj) { UpdateActiveController(ActiveController.Right); } public Vector2 GetUIHitPosition(RectTransform? rect) { //IL_0014: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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) //IL_0051: 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) //IL_005d: Unknown result type (might be due to invalid IL or missing references) RaycastResult val = default(RaycastResult); if (!GetActiveInteractor().Item1.TryGetCurrentUIRaycastResult(ref val)) { return Vector2.one * -1000f; } Vector3 val2 = ((rect == null) ? ((Component)((RaycastResult)(ref val)).gameObject.GetComponentInParent()).transform : ((Component)((Component)rect).GetComponentInParent()).transform).InverseTransformPoint(val.worldPosition); return new Vector2(val2.x, val2.y); } public RectTransform GetUIHitRectTransform() { RaycastResult val = default(RaycastResult); if (GetActiveInteractor().Item1.TryGetCurrentUIRaycastResult(ref val)) { return ((RaycastResult)(ref val)).gameObject.GetComponent(); } return ((Component)HUDCanvas.instance).GetComponent(); } public bool GetTriggerDown() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) InputActionProperty uiPressAction = GetActiveInteractor().Item2.uiPressAction; return ((InputActionProperty)(ref uiPressAction)).action.WasPressedThisFrame(); } public bool GetTriggerButton() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) InputActionProperty uiPressAction = GetActiveInteractor().Item2.uiPressAction; return ((InputActionProperty)(ref uiPressAction)).action.IsPressed(); } public float GetUIScrollX() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) InputActionProperty uiScrollAction = GetActiveInteractor().Item2.uiScrollAction; return ((InputActionProperty)(ref uiScrollAction)).action.ReadValue().x; } public float GetUIScrollY() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) InputActionProperty uiScrollAction = GetActiveInteractor().Item2.uiScrollAction; return ((InputActionProperty)(ref uiScrollAction)).action.ReadValue().y; } private void UpdateActiveController(ActiveController newValue) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //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_0088: 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_009e: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) activeController = newValue; XRRayInteractor val = ((newValue == ActiveController.Left) ? rightInteractor : leftInteractor); XRRayInteractor obj = ((newValue == ActiveController.Left) ? leftInteractor : rightInteractor); XRInteractorLineVisual component = ((Component)val).GetComponent(); XRInteractorLineVisual component2 = ((Component)obj).GetComponent(); component.lineLength = 1f; component2.lineLength = 20f; Gradient val2 = new Gradient(); val2.mode = (GradientMode)0; val2.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0.05f, 0f), new GradientAlphaKey(0.05f, 0.8f), new GradientAlphaKey(0f, 1f) }; val2.colorKeys = (GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }; Gradient invalidColorGradient = (component.validColorGradient = val2); component.invalidColorGradient = invalidColorGradient; invalidColorGradient = new Gradient(); invalidColorGradient.mode = (GradientMode)0; invalidColorGradient.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(0.2f, 0f), new GradientAlphaKey(0.2f, 1f) }; invalidColorGradient.colorKeys = (GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }; component2.invalidColorGradient = invalidColorGradient; invalidColorGradient = new Gradient(); invalidColorGradient.mode = (GradientMode)0; invalidColorGradient.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 1f) }; invalidColorGradient.colorKeys = (GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }; component2.validColorGradient = invalidColorGradient; } public (XRRayInteractor, ActionBasedController) GetActiveInteractor() { return activeController switch { ActiveController.Left => (leftInteractor, leftActions), ActiveController.Right => (rightInteractor, rightActions), _ => throw new ArgumentOutOfRangeException(), }; } private (ActionBasedController, XRRayInteractor, LineRenderer) CreateInteractorController(string hand) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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) //IL_002f: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00c4: 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) GameObject val = new GameObject(hand + " Controller"); val.transform.parent = ((Component)this).transform; val.layer = 5; ActionBasedController val2 = val.AddComponent(); XRRayInteractor val3 = val.AddComponent(); XRInteractorLineVisual val4 = val.AddComponent(); LineRenderer component = val.GetComponent(); val3.raycastMask = LayerMask.op_Implicit(32); val4.lineBendRatio = 1f; Gradient val5 = new Gradient(); val5.mode = (GradientMode)0; val5.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(0.1f, 0f), new GradientAlphaKey(0.1f, 1f) }; val5.colorKeys = (GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }; val4.invalidColorGradient = val5; ((Behaviour)val4).enabled = true; val4.lineLength = 20f; ((Renderer)component).sortingOrder = 4; ((Renderer)component).material = AssetCollection.DefaultLine; AddActionBasedControllerBinds(val2, hand); return (val2, val3, component); } private static void AddActionBasedControllerBinds(ActionBasedController controller, string hand) { //IL_002b: 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_0087: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) ((XRBaseController)controller).enableInputTracking = true; controller.positionAction = new InputActionProperty((hand == "Left") ? Actions.Instance.LeftHandPosition : Actions.Instance.RightHandPosition); controller.rotationAction = new InputActionProperty((hand == "Left") ? Actions.Instance.LeftHandRotation : Actions.Instance.RightHandRotation); controller.trackingStateAction = new InputActionProperty((hand == "Left") ? Actions.Instance.LeftHandTrackingState : Actions.Instance.RightHandTrackingState); ((XRBaseController)controller).enableInputActions = true; controller.selectAction = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/Select", false)); controller.selectActionValue = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/Select Value", false)); controller.activateAction = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/Activate", false)); controller.activateActionValue = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/Activate Value", false)); controller.uiPressAction = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/UI Press", false)); controller.uiPressActionValue = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/UI Press Value", false)); controller.uiScrollAction = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/UI Scroll", false)); controller.rotateAnchorAction = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/Rotate Anchor", false)); controller.translateAnchorAction = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/Translate Anchor", false)); controller.scaleToggleAction = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/Scale Toggle", false)); controller.scaleDeltaAction = new InputActionProperty(AssetCollection.DefaultXRActions.FindAction(hand + "/Scale Delta", false)); } } } namespace RepoXR.UI.Settings { public class FloatMenuSlider : MonoBehaviour { [Serializable] public class CustomOption { public string customOptionText; public UnityEvent onOption; public int customValueInt; } public Transform barSize; public Transform barPointer; public RectTransform barSizeRectTransform; public Transform settingsBar; public TextMeshProUGUI segmentText; public TextMeshProUGUI segmentMaskText; public RectTransform maskRectTransform; public float startValue; public float endValue; public string stringAtStartOfValue; public string stringAtEndOfValue; public float buttonSegmentJump = 1f; public float pointerSegmentJump = 1f; public bool displayPercentage; public bool isInteger; public bool hasBar = true; public bool wrapAround; public bool hasCustomOptions; [Space] public UnityEvent onChange; public List customOptions; public float currentValue; private float prevCurrentValue; private bool valueChangedImpulse; private bool hovering; private MenuSelectableElement menuSelectableElement; private RectTransform rectTransform; private MenuPage parentPage; private Vector3 originalPosition; private bool startPositionSetup; private int settingSegments; private float PercentageValue => Mathf.InverseLerp(startValue, endValue, currentValue); private string DisplayValue { get { if (!displayPercentage) { return $"{currentValue}"; } return $"{PercentageValue * 100f}"; } } private void Start() { rectTransform = ((Component)this).GetComponent(); parentPage = ((Component)this).GetComponentInParent(); menuSelectableElement = ((Component)this).GetComponent(); barSizeRectTransform = ((Component)barSize).GetComponent(); settingSegments = Mathf.RoundToInt(endValue - startValue); if (hasCustomOptions) { settingSegments = Mathf.Max(customOptions.Count - 1, 1); startValue = 0f; endValue = customOptions.Count - 1; buttonSegmentJump = 1f; if (Mathf.Max(customOptions.Count - 1, 1) != settingSegments) { Debug.LogWarning((object)"Segment text count is not equal to setting segments count"); } else { int index = Mathf.RoundToInt(currentValue); string text = customOptions[index].customOptionText; if (text.Length > 16) { text = text.Substring(0, 16) + "..."; } ((TMP_Text)segmentText).text = text; } } else { ((TMP_Text)segmentText).text = stringAtStartOfValue + DisplayValue + stringAtEndOfValue; } ((TMP_Text)segmentText).enableAutoSizing = false; ((TMP_Text)segmentMaskText).enableAutoSizing = false; if (!hasBar && Object.op_Implicit((Object)(object)segmentText)) { Object.Destroy((Object)(object)((Component)segmentText).gameObject); } prevCurrentValue = currentValue; SetStartPositions(); } public void SetStartPositions() { //IL_0015: 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_003b: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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) if (!startPositionSetup) { ((Transform)barSizeRectTransform).localPosition = new Vector3(((Transform)barSizeRectTransform).localPosition.x + 3f, ((Transform)barSizeRectTransform).localPosition.y, ((Transform)barSizeRectTransform).localPosition.z); originalPosition = ((Transform)rectTransform).position; originalPosition = new Vector3(originalPosition.x, originalPosition.y - 1.01f, originalPosition.z); startPositionSetup = true; } } private void Update() { //IL_0050: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) if (!Mathf.Approximately(prevCurrentValue, currentValue) || valueChangedImpulse) { valueChangedImpulse = false; onChange.Invoke(); prevCurrentValue = currentValue; } if (hasBar) { settingsBar.localScale = Vector3.Lerp(settingsBar.localScale, new Vector3(PercentageValue, settingsBar.localScale.y, settingsBar.localScale.z), 20f * Time.deltaTime); maskRectTransform.sizeDelta = new Vector2(barSizeRectTransform.sizeDelta.x * PercentageValue, maskRectTransform.sizeDelta.y); } if (SemiFunc.UIMouseHover(parentPage, barSizeRectTransform, menuSelectableElement.menuID, 5f, 5f, (MenuScrollBox)null, (ScrollRect)null)) { if (!hovering) { MenuManager.instance.MenuEffectHover(SemiFunc.MenuGetPitchFromYPos(rectTransform), -1f); } hovering = true; SemiFunc.MenuSelectionBoxTargetSet(parentPage, barSizeRectTransform, new Vector2(-3f, 0f), new Vector2(20f, 10f)); if (hasBar) { PointerLogic(); } else if (XRRayInteractorManager.Instance?.GetTriggerDown() ?? Input.GetMouseButtonDown(0)) { MenuManager.instance.MenuEffectClick((MenuClickEffectType)0, parentPage, -1f, -1f, false); OnIncrease(); } } else { hovering = false; if (((Component)barPointer).gameObject.activeSelf) { barPointer.localPosition = new Vector3(-999f, barPointer.localPosition.y, barPointer.localPosition.z); ((Component)barPointer).gameObject.SetActive(false); } } if (Object.op_Implicit((Object)(object)segmentMaskText) && ((TMP_Text)segmentMaskText).text != ((TMP_Text)segmentText).text) { ((TMP_Text)segmentMaskText).text = ((TMP_Text)segmentText).text; } } private void PointerLogic() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)barPointer)) { return; } if (!((Component)barPointer).gameObject.activeSelf) { ((Component)barPointer).gameObject.SetActive(true); } Vector2 val = SemiFunc.UIMouseGetLocalPositionWithinRectTransform(barSizeRectTransform); float num = (endValue - startValue) / pointerSegmentJump; float num2 = Mathf.Clamp01(val.x / barSizeRectTransform.sizeDelta.x); num2 = Mathf.Round(num2 * num) / num; float num3 = Mathf.Clamp(((Transform)barSizeRectTransform).localPosition.x + num2 * barSizeRectTransform.sizeDelta.x, ((Transform)barSizeRectTransform).localPosition.x, ((Transform)barSizeRectTransform).localPosition.x + barSizeRectTransform.sizeDelta.x); barPointer.localPosition = new Vector3(num3 - 2f, barPointer.localPosition.y, barPointer.localPosition.z); if (XRRayInteractorManager.Instance?.GetTriggerButton() ?? Input.GetMouseButton(0)) { prevCurrentValue = currentValue; currentValue = Mathf.Lerp(startValue, endValue, num2); currentValue = startValue + (float)Mathf.RoundToInt((currentValue - startValue) / pointerSegmentJump) * pointerSegmentJump; currentValue = Mathf.Clamp(currentValue, startValue, endValue); if (!Mathf.Approximately(prevCurrentValue, currentValue)) { MenuManager.instance.MenuEffectClick((MenuClickEffectType)4, parentPage, -1f, -1f, false); } int num4 = Mathf.RoundToInt(currentValue); if (hasCustomOptions && num4 < customOptions.Count) { ((TMP_Text)segmentText).text = customOptions[num4].customOptionText; } else { ((TMP_Text)segmentText).text = stringAtStartOfValue + DisplayValue + stringAtEndOfValue; } if (hasCustomOptions) { UpdateSegmentTextAndValue(); } } } private void UpdateSegmentTextAndValue() { if (hasCustomOptions) { int num = Mathf.RoundToInt(currentValue); if (num < customOptions.Count) { string text = customOptions[num].customOptionText; if (text.Length > 16) { text = text.Substring(0, 16) + "..."; } ((TMP_Text)segmentText).text = text; } } else { ((TMP_Text)segmentText).text = stringAtStartOfValue + DisplayValue + stringAtEndOfValue; } } public void OnIncrease() { valueChangedImpulse = true; if (wrapAround) { currentValue = (Mathf.Approximately(currentValue, endValue) ? startValue : (currentValue + buttonSegmentJump)); } else { currentValue += buttonSegmentJump; } currentValue = startValue + (float)Mathf.RoundToInt((currentValue - startValue) / buttonSegmentJump) * buttonSegmentJump; currentValue = Mathf.Clamp(currentValue, startValue, endValue); UpdateSegmentTextAndValue(); } public void OnDecrease() { valueChangedImpulse = true; if (wrapAround) { currentValue = (Mathf.Approximately(currentValue, startValue) ? endValue : (currentValue - buttonSegmentJump)); } else { currentValue -= buttonSegmentJump; } currentValue = startValue + (float)Mathf.RoundToInt((currentValue - startValue) / buttonSegmentJump) * buttonSegmentJump; currentValue = Mathf.Clamp(currentValue, startValue, endValue); UpdateSegmentTextAndValue(); } public void SetBarScaleInstant() { //IL_0012: 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_002c: Unknown result type (might be due to invalid IL or missing references) settingsBar.localScale = new Vector3(PercentageValue, settingsBar.localScale.y, settingsBar.localScale.z); } } public class SettingOption : MonoBehaviour { public string settingCategory; public string settingName; public string? settingDisplayName; public TextMeshProUGUI settingText; public RectTransform rectTransform; private void Start() { ((TMP_Text)settingText).text = settingDisplayName ?? Utils.ToHumanReadable(settingName); } public void FetchBoolOption() { ((Component)this).GetComponent().startSettingFetch = (bool)Plugin.Config.File[settingCategory, settingName].BoxedValue; } public void UpdateBool(bool value) { Plugin.Config.File[settingCategory, settingName].BoxedValue = value; } public void UpdateInt(int value) { Plugin.Config.File[settingCategory, settingName].BoxedValue = value; } public void UpdateFloat(float value) { Plugin.Config.File[settingCategory, settingName].BoxedValue = value; } public void UpdateSlider() { FloatMenuSlider component = ((Component)this).GetComponent(); if (component.isInteger) { UpdateInt(Mathf.RoundToInt(component.currentValue)); } else { UpdateFloat(component.currentValue); } } } public class RuntimeSettingOption : MonoBehaviour { public RectTransform rectTransform; public TextMeshProUGUI runtimeText; private FloatMenuSlider slider; private OpenXR.Runtimes runtimes; private void Awake() { slider = ((Component)this).GetComponent(); runtimes = OpenXR.GetRuntimes(); slider.hasBar = false; slider.wrapAround = true; FloatMenuSlider floatMenuSlider = slider; List list = new List(); list.Add(new FloatMenuSlider.CustomOption { customOptionText = "System Default" }); list.AddRange(runtimes.Select((OpenXR.Runtime runtime) => new FloatMenuSlider.CustomOption { customOptionText = runtime.Name })); floatMenuSlider.customOptions = list; slider.currentValue = (runtimes.TryGetRuntimeByPath(Plugin.Config.OpenXRRuntimeFile.Value, out var runtime2) ? (MiscHelpers.IndexOf((IEnumerable)runtimes, runtime2) + 1) : 0); UpdateSlider(); } public void UpdateSlider() { OpenXR.Runtime runtime; if (slider.currentValue == 0f) { Plugin.Config.OpenXRRuntimeFile.Value = ""; ((TMP_Text)runtimeText).text = "System Default"; } else if (runtimes.TryGetRuntime(slider.customOptions[(int)slider.currentValue].customOptionText, out runtime)) { Plugin.Config.OpenXRRuntimeFile.Value = runtime.Path; ((TMP_Text)runtimeText).text = runtime.Name; } } } } namespace RepoXR.UI.Menu { public class InputKeyboard : MonoBehaviour { public static InputKeyboard instance; public MenuTextInput menuInput; private NonNativeKeyboard keyboard; private float animLerp; private bool closing; private void Awake() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)instance)) { Object.Destroy((Object)(object)((Component)instance).gameObject); } instance = this; keyboard = ((Component)this).GetComponentInChildren(true); keyboard.SubmitOnEnter = false; ((Component)this).transform.localScale = Vector3.zero; } private void Start() { keyboard.OnKeyboardValueKeyPressed += OnKeyPressed; keyboard.OnKeyboardFunctionKeyPressed += OnFunctionKeyPressed; keyboard.PresentKeyboard(); } private void OnDestroy() { keyboard.OnKeyboardValueKeyPressed -= OnKeyPressed; keyboard.OnKeyboardFunctionKeyPressed -= OnFunctionKeyPressed; } private void Update() { //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_008c: Unknown result type (might be due to invalid IL or missing references) float num = animLerp; if (!(num < 1f) || closing) { if (num > 0f && closing) { animLerp -= Time.deltaTime * 4f; } } else { animLerp += Time.deltaTime * 4f; } animLerp = Mathf.Clamp01(animLerp); ((Component)this).transform.localScale = Vector3.LerpUnclamped(Vector3.zero, Vector3.one, AssetCollection.KeyboardAnimation.Evaluate(animLerp)); if (animLerp == 0f && closing) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void Close() { closing = true; } private void OnKeyPressed(KeyboardValueKey key) { MenuTextInput obj = menuInput; obj.textCurrent += (keyboard.IsShifted ? key.ShiftValue : key.Value); } private void OnFunctionKeyPressed(KeyboardKeyFunc key) { switch (key.ButtonFunction) { case KeyboardKeyFunc.Function.Backspace: menuInput.textCurrent = menuInput.textCurrent.Remove(Mathf.Max(menuInput.textCurrent.Length - 1, 0)); break; case KeyboardKeyFunc.Function.Enter: { MenuPageServerListCreateNew componentInParent = ((Component)menuInput).GetComponentInParent(); if (componentInParent != null) { componentInParent.ButtonConfirm(); break; } MenuPageServerListSearch componentInParent2 = ((Component)menuInput).GetComponentInParent(); if (componentInParent2 != null) { componentInParent2.ButtonConfirm(); } break; } } } } internal static class MenuHelper { public enum RepoXRMenuPage { VRSettings = 37449, VRSettingsCategory, VRShowcase } public static void RegisterCustomMenus(MenuManager manager) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //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_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_0066: Expected O, but got Unknown manager.menuPages.AddRange(new <>z__ReadOnlyArray((MenuPages[])(object)new MenuPages[3] { new MenuPages { menuPageIndex = (MenuPageIndex)37449, menuPage = AssetCollection.MenuSettings }, new MenuPages { menuPageIndex = (MenuPageIndex)37450, menuPage = AssetCollection.MenuSettingsCategory }, new MenuPages { menuPageIndex = (MenuPageIndex)37451, menuPage = AssetCollection.MenuShowcase } })); } public static void PageOpenOnTop(RepoXRMenuPage page) { MenuManager.instance.PageOpenOnTop((MenuPageIndex)page); } public static MenuPage PageAddOnTop(RepoXRMenuPage page) { MenuManager.instance.PageAddOnTop((MenuPageIndex)page); return MenuManager.instance.addedPagesOnTop.Find((MenuPage p) => (int)p.menuPageIndex == (int)page && (int)p.currentPageState != 2); } } public class SettingsCategoryPage : MonoBehaviour { public string categoryName; public TextMeshProUGUI categoryText; public Transform scrollerTransform; private void Start() { //IL_0044: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)categoryText).text = categoryName; float num = -50f; if (categoryName == "General") { RectTransform rectTransform = Object.Instantiate(AssetCollection.RuntimeSetting, scrollerTransform).GetComponent().rectTransform; rectTransform.anchoredPosition += new Vector2(0f, num); num -= 30f; } foreach (var (val3, val4) in Plugin.Config.File) { if (val3.Section != categoryName) { continue; } PropertyInfo propertyInfo = AccessTools.Property(typeof(Config), val3.Key); if ((object)propertyInfo == null) { continue; } ConfigDescriptorAttribute customAttribute = propertyInfo.GetCustomAttribute(); if (customAttribute == null) { continue; } SettingOption component = ((val4.SettingType == typeof(bool)) ? Object.Instantiate(AssetCollection.BoolSetting, scrollerTransform) : Object.Instantiate(AssetCollection.SliderSetting, scrollerTransform)).GetComponent(); component.settingCategory = categoryName; component.settingName = val3.Key; component.settingDisplayName = customAttribute.CustomName; RectTransform rectTransform2 = component.rectTransform; rectTransform2.anchoredPosition += new Vector2(0f, num); MenuTwoOptions component2 = ((Component)component).GetComponent(); if (component2 != null) { ((Behaviour)component2).enabled = true; } if (val4.SettingType == typeof(bool)) { MenuTwoOptions component3 = ((Component)component).GetComponent(); component3.option1Text = customAttribute.TrueText; component3.option2Text = customAttribute.FalseText; } else if (val4.SettingType != typeof(bool)) { FloatMenuSlider component4 = ((Component)component).GetComponent(); component4.displayPercentage = customAttribute.Percentage; component4.stringAtEndOfValue = (customAttribute.Percentage ? "%" : customAttribute.Suffix); component4.buttonSegmentJump = customAttribute.StepSize; component4.pointerSegmentJump = customAttribute.PointerSize; if (val4.SettingType.IsEnum) { string[] names = Enum.GetNames(val4.SettingType); foreach (string input in names) { component4.customOptions.Add(new FloatMenuSlider.CustomOption { customOptionText = Utils.ToHumanReadable(input) }); } component4.hasCustomOptions = true; component4.currentValue = (int)val4.BoxedValue; component4.isInteger = true; component4.hasBar = !customAttribute.EnumDisableBar; component4.wrapAround = true; num -= 30f; continue; } AcceptableValueBase acceptableValues = val4.Description.AcceptableValues; if (!(acceptableValues is AcceptableValueRange val5)) { if (!(acceptableValues is AcceptableValueRange val6)) { num -= 30f; continue; } component4.startValue = val6.MinValue; component4.endValue = val6.MaxValue; component4.currentValue = (int)val4.BoxedValue; component4.isInteger = true; } else { component4.startValue = val5.MinValue; component4.endValue = val5.MaxValue; component4.currentValue = (float)val4.BoxedValue; } } num -= 30f; } } } public class SettingsPage : MonoBehaviour { private void Start() { MenuManager.instance.PageCloseAllAddedOnTop(); MenuHelper.PageAddOnTop(MenuHelper.RepoXRMenuPage.VRShowcase); } public void ButtonEventOpenCategory(string category) { MenuManager.instance.PageCloseAllAddedOnTop(); ((Component)MenuHelper.PageAddOnTop(MenuHelper.RepoXRMenuPage.VRSettingsCategory)).GetComponent().categoryName = category; } public void ButtonEventBack() { if ((Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelMainMenu) { MenuManager.instance.PageCloseAllExcept((MenuPageIndex)0); MenuManager.instance.PageSetCurrent((MenuPageIndex)0, MenuPageMain.instance.menuPage); } else if ((Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelLobbyMenu) { MenuManager.instance.PageCloseAllExcept((MenuPageIndex)8); MenuManager.instance.PageSetCurrent((MenuPageIndex)8, MenuPageLobby.instance.menuPage); } else { MenuManager.instance.PageCloseAll(); MenuManager.instance.PageOpen((MenuPageIndex)1, false); } } } public class ShowcasePage : MonoBehaviour { public TextMeshProUGUI versionText; public TextMeshProUGUI commitText; private void Awake() { ((TMP_Text)versionText).text = "v1.2.2"; ((TMP_Text)commitText).text = "Commit: " + Plugin.GetCommitHash(); } public void MadeByClicked() { Application.OpenURL("https://github.com/DaXcess"); } public void GitHubClicked() { Application.OpenURL("https://github.com/DaXcess/RepoXR"); } public void DiscordClicked() { Application.OpenURL("https://discord.gg/2DxNgpPZUF"); } public void KoFiClicked() { Application.OpenURL("https://ko-fi.com/daxcess"); } } } namespace RepoXR.UI.Expressions { public class ExpressionRadial : MonoBehaviour { public static ExpressionRadial instance; public Transform handTransform; [SerializeField] protected AnimationCurve animationCurve; [SerializeField] protected Transform canvasTransform; [SerializeField] protected Transform previewTransform; [SerializeField] protected Image previewBackground; [SerializeField] protected ExpressionPart[] parts; private PlayerExpression playerExpression; private HapticManager.Hand currentHand = HapticManager.Hand.Both; internal bool isActive; private bool isOverridden; private float animationLerp; private float overrideAnimationLerp = 1f; private int hoveredPart = -1; internal bool closedLastPress; private void Awake() { instance = this; ((Component)PlayerExpressionsUI.instance).transform.SetParent(previewTransform, false); playerExpression = PlayerExpressionsUI.instance.playerExpression; ReloadParts(); } private void OnDestroy() { instance = null; } private void Update() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Invalid comparison between Unknown and I4 //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) UpdateBindingHand(); if (currentHand == HapticManager.Hand.Both) { return; } if (closedLastPress) { closedLastPress = false; } if (VRInputSystem.Instance.ExpressionPressed() || (isActive && SemiFunc.InputDown((InputKey)7))) { if (!isActive) { isActive = true; ResetPosition(); if ((int)ChatManager.instance.chatState == 1) { ChatManager.instance.StateSet((ChatState)0); } MenuManager.instance.MenuEffectClick((MenuClickEffectType)1, (MenuPage)null, -1f, -1f, true); } else if (isActive) { isActive = false; closedLastPress = true; MenuManager.instance.MenuEffectClick((MenuClickEffectType)0, (MenuPage)null, -1f, -1f, true); } } if (isActive) { ((SemiUI)PlayerExpressionsUI.instance).Show(); } animationLerp += Time.deltaTime * (float)((isActive || isOverridden) ? 4 : (-4)); animationLerp = Mathf.Clamp01(animationLerp); overrideAnimationLerp += Time.deltaTime * (float)((!isActive && isOverridden) ? (-4) : 4); overrideAnimationLerp = Mathf.Clamp01(overrideAnimationLerp); ((Component)this).transform.localScale = Vector3.LerpUnclamped(Vector3.zero, Vector3.one, animationCurve.Evaluate(animationLerp)); CollectionExtensions.Do((IEnumerable)parts, (Action)delegate(ExpressionPart part) { //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_0021: Unknown result type (might be due to invalid IL or missing references) ((Component)part).transform.localScale = Vector3.LerpUnclamped(Vector3.zero, Vector3.one, animationCurve.Evaluate(overrideAnimationLerp)); }); bool flag = DataManager.instance.activeExpressions.Count > 0 || playerExpression.overrideExpressions.Count > 0; Color val = SemiFunc.PlayerGetColorMain(PlayerAvatar.instance); ((Graphic)previewBackground).color = Color.Lerp(((Graphic)previewBackground).color, new Color(val.r, val.g, val.b, 0.003921569f * (float)(flag ? 50 : 0)), 8f * Time.deltaTime); OverrideLogic(); HoverLogic(); ActivateLogic(); } public static bool ExpressionActive(InputKey input) { //IL_0000: 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) //IL_0005: Expected I4, but got Unknown ExpressionPart.Expression item = (ExpressionPart.Expression)(input - 26); return DataManager.instance.activeExpressions.Contains(item); } private void ResetPosition(bool overrideOnly = false) { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)CameraUtils.Instance.MainCamera).transform; if (isActive) { if (overrideOnly) { return; } ((Component)this).transform.position = handTransform.position; ((Component)this).transform.LookAt(transform.position); } if (overrideOnly) { PlayerExpressionsUI val = PlayerExpressionsUI.instance; Vector3 forward = transform.forward; float num = ((!val.shrinkActive) ? (val.shrinkCurve.Evaluate(val.shrinkLerp) * -0.15f) : 0f); ((Component)this).transform.position = transform.position + forward * 0.5f + transform.up * (-0.15f + num); ((Component)this).transform.LookAt(transform.position); } } private void ReloadParts() { ExpressionPart[] array = parts; foreach (ExpressionPart expressionPart in array) { expressionPart.SetActive(DataManager.instance.activeExpressions.Contains(expressionPart.expression)); } } private void UpdateBindingHand() { //IL_0035: 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_003e: 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) int num = Mathf.Max(InputActionRebindingExtensions.GetBindingIndex(Actions.Instance["Chat"], VRInputSystem.Instance.CurrentControlScheme, (string)null), 0); InputBinding val = Actions.Instance["Chat"].bindings[num]; if (Utils.GetControlHand(((InputBinding)(ref val)).effectivePath, out var hand) && currentHand != hand) { currentHand = hand; handTransform = ((hand == HapticManager.Hand.Left) ? VRSession.Instance.Player.Rig.leftArmTarget : VRSession.Instance.Player.Rig.rightArmTarget); } } private void OverrideLogic() { isOverridden = playerExpression.overrideExpressions.Count > 0; if (isOverridden) { ResetPosition(overrideOnly: true); } } private void HoverLogic() { //IL_000f: 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_001f: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (isActive) { Vector3 val = Vector3.ProjectOnPlane(handTransform.position - canvasTransform.position, canvasTransform.forward); float num = Vector3.SignedAngle(canvasTransform.up, val, -canvasTransform.forward); if (num < 0f) { num += 360f; } int num2 = (int)num * parts.Length / 360; if (num2 != hoveredPart) { HapticManager.Impulse(currentHand, HapticManager.Type.Impulse, 0.03f); } hoveredPart = num2; for (int i = 0; i < parts.Length; i++) { parts[i].SetHovered(i == hoveredPart); } } } private void ActivateLogic() { if (!isActive || hoveredPart < 0 || playerExpression.overrideExpressions.Any((OverrideExpression expr) => expr.index - 1 == hoveredPart) || Object.op_Implicit((Object)(object)MenuManager.instance.currentMenuPage)) { return; } string name = ((currentHand == HapticManager.Hand.Left) ? "ExpressionLeft" : "ExpressionRight"); if (Actions.Instance[name].WasPressedThisFrame()) { MenuManager.instance.MenuEffectClick((MenuClickEffectType)4, (MenuPage)null, -1f, -1f, true); HapticManager.Impulse(currentHand, HapticManager.Type.Impulse); ExpressionPart expressionPart = parts[hoveredPart]; if (expressionPart.Toggle()) { DataManager.instance.activeExpressions.Add(expressionPart.expression); } else { DataManager.instance.activeExpressions.Remove(expressionPart.expression); } } } } public class ExpressionPart : MonoBehaviour { public enum Expression { Angry, Sad, Suspicious, EyesClosed, Crazy, Happy } public Expression expression; public AnimationCurve triggerAnimation; private Image background; private TextMeshProUGUI text; private PlayerExpression playerExpression; private Vector3 currentScale; private bool isHovered; private bool isActive; private float animTimer = 1f; private void Awake() { background = ((Component)this).GetComponent(); text = ((Component)this).GetComponentInChildren(); playerExpression = PlayerExpressionsUI.instance.playerExpression; } private void Update() { //IL_0005: 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_0048: 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_0036: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) Color val = SemiFunc.PlayerGetColorMain(PlayerAvatar.instance); bool flag = isActive || playerExpression.overrideExpressions.Any((OverrideExpression expr) => expr.index - 1 == (int)expression); Color val2 = (flag ? Utils.GetTextColor(val) : Utils.GetTextColor(val, 0.6f, 0.85f)); Color val3 = (flag ? Color.Lerp(val, Color.white, 0.4f) : (isHovered ? Color.Lerp(val, Color.white, 0.2f) : Color.Lerp(val, Color.black, 0.2f))); val2.a = (flag ? 1f : 0.85f); val3.a = (flag ? 0.5f : (isHovered ? 0.3f : 0.2f)); ((Graphic)text).color = Color.Lerp(((Graphic)text).color, val2, 8f * Time.deltaTime); ((Graphic)background).color = Color.Lerp(((Graphic)background).color, val3, 8f * Time.deltaTime); currentScale = Vector3.Lerp(currentScale, Vector3.one * (isHovered ? 1.1f : 1f), 8f * Time.deltaTime); Vector3 val4 = currentScale; if (animTimer < 1f) { animTimer += Time.deltaTime * 4f; animTimer = Mathf.Clamp01(animTimer); Vector3 val5 = Vector3.one * (triggerAnimation.Evaluate(animTimer) * 0.15f); val4 += (flag ? val5 : (-val5)); } if (ExpressionRadial.instance.isActive) { ((Component)this).transform.localScale = val4; } } public void SetHovered(bool hovered) { isHovered = hovered; } public bool Toggle() { isActive = !isActive; animTimer = 0f; return isActive; } public void SetActive(bool active) { isActive = active; } } } namespace RepoXR.UI.Controls { public class ControlOption : MonoBehaviour { [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ControlOption <>4__this; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown int num = <>1__state; ControlOption controlOption = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = 5; break; case 1: <>1__state = -1; ((TMP_Text)controlOption.controlText).text = $"[. {5__2} .]"; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; case 2: <>1__state = -1; 5__2--; break; } if (5__2 >= 0) { ((TMP_Text)controlOption.controlText).text = $"[ .{5__2}. ]"; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [SerializeField] protected TextMeshProUGUI controlName; [SerializeField] protected TextMeshProUGUI controlText; private PlayerInput playerInput; private RebindManager manager; private RemappableControl control; private Coroutine? rebindTimerCoroutine; private int bindingIndex; public InputAction? action { get { RemappableControl remappableControl = control; if (remappableControl == null) { return null; } return remappableControl.currentInput.action; } } private void Awake() { playerInput = VRInputSystem.Instance.GetPlayerInput(); } public void StartRebind() { manager.StartRebind(this, bindingIndex); } public void DeleteBinding() { if (!string.IsNullOrEmpty(playerInput.currentControlScheme)) { InputActionRebindingExtensions.ApplyBindingOverride(action, bindingIndex, ""); ReloadBinding(); manager.SaveBindings(); } } public void SetBindToggle(bool toggle) { VRInputSystem.Instance.InputToggleRebind(action.name, toggle); } public void FetchToggle() { if (action != null) { ((Component)this).GetComponentInChildren().startSettingFetch = VRInputSystem.Instance.InputToggleGet(action.name); } } public void Setup(RebindManager rebindManager, RemappableControl remappableControl) { manager = rebindManager; control = remappableControl; ((TMP_Text)controlName).text = control.controlName; } public void ReloadBinding() { //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_0099: Unknown result type (might be due to invalid IL or missing references) if (rebindTimerCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(rebindTimerCoroutine); } bindingIndex = Mathf.Max(control.bindingIndex, 0) + Mathf.Max(InputActionRebindingExtensions.GetBindingIndex(control.currentInput.action, playerInput.currentControlScheme, (string)null), 0); if (string.IsNullOrEmpty(playerInput.currentControlScheme)) { ((TMP_Text)controlText).text = " DISCONNECTED"; return; } InputBinding val = control.currentInput.action.bindings[bindingIndex]; string effectivePath = ((InputBinding)(ref val)).effectivePath; if (string.IsNullOrEmpty(effectivePath)) { ((TMP_Text)controlText).text = "NOT BOUND"; } else { ((TMP_Text)controlText).text = Utils.GetControlSpriteString(effectivePath); } } public void StartRebindTimer() { rebindTimerCoroutine = ((MonoBehaviour)this).StartCoroutine(RebindTimer()); } [IteratorStateMachine(typeof(d__17))] private IEnumerator RebindTimer() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this }; } } public class VRMenuKeybindToggle : MonoBehaviour { public string inputAction; public void EnableToggle() { VRInputSystem.Instance.InputToggleRebind(inputAction, toggle: true); } public void DisableToggle() { VRInputSystem.Instance.InputToggleRebind(inputAction, toggle: false); } public void FetchSetting() { ((Component)this).GetComponent().startSettingFetch = VRInputSystem.Instance.InputToggleGet(inputAction); } } } namespace RepoXR.ThirdParty.MRTK { public class CapsLockHighlight : MonoBehaviour { [SerializeField] private Image m_Highlight; private NonNativeKeyboard m_Keyboard; private void Start() { m_Keyboard = ((Component)this).GetComponentInParent(); UpdateState(); } private void Update() { UpdateState(); } private void UpdateState() { bool enabled = false; if ((Object)(object)m_Keyboard != (Object)null) { enabled = m_Keyboard.IsCapsLocked; } if ((Object)(object)m_Highlight != (Object)null) { ((Behaviour)m_Highlight).enabled = enabled; } } } [RequireComponent(typeof(Button))] public class KeyboardKeyFunc : MonoBehaviour { public enum Function { Enter, Tab, ABC, Symbol, Previous, Next, Close, Dictate, Shift, CapsLock, Space, Backspace, UNDEFINED } [SerializeField] [FormerlySerializedAs("m_ButtonFunction")] private Function buttonFunction = Function.UNDEFINED; private NonNativeKeyboard m_Keyboard; public Function ButtonFunction => buttonFunction; private void Awake() { m_Keyboard = ((Component)this).GetComponentInParent(); } private void Start() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown Button component = ((Component)this).GetComponent