using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using Sodalite;
using Sodalite.Api;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
internal class TronTrailSection
{
public Vector3 point;
public Vector3 upDir;
public float time;
public TronTrailSection()
{
}
public TronTrailSection(Vector3 p, float t)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
point = p;
time = t;
}
}
[RequireComponent(typeof(MeshFilter))]
public class LightsaberTrail : MonoBehaviour
{
public float height = 2f;
public float time = 2f;
public bool alwaysUp = false;
public float minDistance = 0.1f;
public float timeTransitionSpeed = 1f;
public float desiredTime = 2f;
public Color startColor = Color.white;
public Color endColor = new Color(1f, 1f, 1f, 0f);
private Vector3 position;
private float now = 0f;
private TronTrailSection currentSection;
private Matrix4x4 localSpaceTransform;
private Mesh mesh;
private Vector3[] vertices;
private Color[] colors;
private Vector2[] uv;
private MeshRenderer meshRenderer;
private Material trailMaterial;
private List<TronTrailSection> sections = new List<TronTrailSection>();
private void Awake()
{
Component component = ((Component)this).GetComponent(typeof(MeshFilter));
MeshFilter val = (MeshFilter)(object)((component is MeshFilter) ? component : null);
mesh = val.mesh;
ref MeshRenderer reference = ref meshRenderer;
Component component2 = ((Component)this).GetComponent(typeof(MeshRenderer));
reference = (MeshRenderer)(object)((component2 is MeshRenderer) ? component2 : null);
trailMaterial = ((Renderer)meshRenderer).material;
}
public void StartTrail(float timeToTweenTo, float fadeInTime)
{
desiredTime = timeToTweenTo;
if (time != desiredTime)
{
timeTransitionSpeed = Mathf.Abs(desiredTime - time) / fadeInTime;
}
if (time <= 0f)
{
time = 0.01f;
}
}
public void SetTime(float trailTime, float timeToTweenTo, float tweenSpeed)
{
time = trailTime;
desiredTime = timeToTweenTo;
timeTransitionSpeed = tweenSpeed;
if (time <= 0f)
{
ClearTrail();
}
}
public void FadeOut(float fadeTime)
{
desiredTime = 0f;
if (time > 0f)
{
timeTransitionSpeed = time / fadeTime;
}
}
public void SetTrailColor(Color color)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
trailMaterial.SetColor("_TintColor", color);
}
public void Iterate(float itterateTime)
{
//IL_0008: 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_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: 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_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: 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)
position = ((Component)this).transform.position;
now = itterateTime;
if (sections.Count != 0)
{
Vector3 val = sections[0].point - position;
if (!(((Vector3)(ref val)).sqrMagnitude > minDistance * minDistance))
{
return;
}
}
TronTrailSection tronTrailSection = new TronTrailSection();
tronTrailSection.point = position;
if (alwaysUp)
{
tronTrailSection.upDir = Vector3.up;
}
else
{
tronTrailSection.upDir = ((Component)this).transform.TransformDirection(Vector3.up);
}
tronTrailSection.time = now;
sections.Insert(0, tronTrailSection);
}
public void UpdateTrail(float currentTime, float deltaTime)
{
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0178: 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_0184: 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_018e: 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_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: 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_01dd: 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_01e8: Unknown result type (might be due to invalid IL or missing references)
//IL_01f7: 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_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Unknown result type (might be due to invalid IL or missing references)
mesh.Clear();
while (sections.Count > 0 && currentTime > sections[sections.Count - 1].time + time)
{
sections.RemoveAt(sections.Count - 1);
}
if (sections.Count < 2)
{
return;
}
vertices = (Vector3[])(object)new Vector3[sections.Count * 2];
colors = (Color[])(object)new Color[sections.Count * 2];
uv = (Vector2[])(object)new Vector2[sections.Count * 2];
currentSection = sections[0];
localSpaceTransform = ((Component)this).transform.worldToLocalMatrix;
for (int i = 0; i < sections.Count; i++)
{
currentSection = sections[i];
float num = 0f;
if (i != 0)
{
num = Mathf.Clamp01((currentTime - currentSection.time) / time);
}
Vector3 upDir = currentSection.upDir;
ref Vector3 reference = ref vertices[i * 2];
reference = ((Matrix4x4)(ref localSpaceTransform)).MultiplyPoint(currentSection.point);
ref Vector3 reference2 = ref vertices[i * 2 + 1];
reference2 = ((Matrix4x4)(ref localSpaceTransform)).MultiplyPoint(currentSection.point + upDir * height);
ref Vector2 reference3 = ref uv[i * 2];
reference3 = new Vector2(num, 0f);
ref Vector2 reference4 = ref uv[i * 2 + 1];
reference4 = new Vector2(num, 1f);
Color val = Color.Lerp(startColor, endColor, num);
colors[i * 2] = val;
colors[i * 2 + 1] = val;
}
int[] array = new int[(sections.Count - 1) * 2 * 3];
for (int j = 0; j < array.Length / 6; j++)
{
array[j * 6] = j * 2;
array[j * 6 + 1] = j * 2 + 1;
array[j * 6 + 2] = j * 2 + 2;
array[j * 6 + 3] = j * 2 + 2;
array[j * 6 + 4] = j * 2 + 1;
array[j * 6 + 5] = j * 2 + 3;
}
mesh.vertices = vertices;
mesh.colors = colors;
mesh.uv = uv;
mesh.triangles = array;
if (time > desiredTime)
{
time -= deltaTime * timeTransitionSpeed;
if (time <= desiredTime)
{
time = desiredTime;
}
}
else if (time < desiredTime)
{
time += deltaTime * timeTransitionSpeed;
if (time >= desiredTime)
{
time = desiredTime;
}
}
}
public void ClearTrail()
{
desiredTime = 0f;
time = 0f;
if ((Object)(object)mesh != (Object)null)
{
mesh.Clear();
sections.Clear();
}
}
}
[RequireComponent(typeof(LightsaberTrail))]
public class LightsaberTrailController : MonoBehaviour
{
private LightsaberTrail lightsaberTrail;
private void Start()
{
lightsaberTrail = ((Component)this).GetComponent<LightsaberTrail>();
}
private void Update()
{
lightsaberTrail.Iterate(Time.time);
lightsaberTrail.UpdateTrail(Time.time, 0f);
}
}
namespace JerryAr.PlayerCrouch_System
{
[BepInPlugin("JerryAr.PlayerCrouch_System", "PlayerCrouch_System", "0.0.1")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class PlayerCrouch_SystemPlugin : BaseUnityPlugin
{
private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
internal static ManualLogSource Logger;
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
LoadAssets();
}
private void LoadAssets()
{
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "JerryAr.PlayerCrouch_System");
OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.PlayerCrouch_System", "", "playercrouchsystem", "", "");
}
}
}
namespace JerryPC
{
public class PlayerCrouch : MonoBehaviour
{
public bool adjustable;
public Collider grab;
public FVRInteractiveObject grabitem;
public GameObject grabobj;
public GameObject grabmove;
public GameObject blocker;
public GameObject lifter;
public Collider lftcol;
public Collider blkcol;
public GameObject thisObj;
public GameObject raypos1;
public GameObject raypos2;
public GameObject raypos3;
public GameObject raypos4;
public LayerMask lm1;
public LayerMask lm2;
public float cd = 1f;
public Vector3 pos1;
public Vector3 pos2;
public Vector3 pos3;
public Vector3 pos4;
private void FixedUpdate()
{
//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_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0055: Unknown result type (might be due to invalid IL or missing references)
//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_0189: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: 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_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: 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_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_0409: Unknown result type (might be due to invalid IL or missing references)
//IL_040e: Unknown result type (might be due to invalid IL or missing references)
//IL_042b: Unknown result type (might be due to invalid IL or missing references)
//IL_0430: Unknown result type (might be due to invalid IL or missing references)
//IL_044a: Unknown result type (might be due to invalid IL or missing references)
//IL_044f: Unknown result type (might be due to invalid IL or missing references)
//IL_0458: Unknown result type (might be due to invalid IL or missing references)
//IL_045d: Unknown result type (might be due to invalid IL or missing references)
//IL_0467: Unknown result type (might be due to invalid IL or missing references)
//IL_0471: Unknown result type (might be due to invalid IL or missing references)
//IL_048e: Unknown result type (might be due to invalid IL or missing references)
//IL_0493: Unknown result type (might be due to invalid IL or missing references)
//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0513: Unknown result type (might be due to invalid IL or missing references)
//IL_0518: Unknown result type (might be due to invalid IL or missing references)
//IL_0535: Unknown result type (might be due to invalid IL or missing references)
//IL_053a: Unknown result type (might be due to invalid IL or missing references)
//IL_0554: Unknown result type (might be due to invalid IL or missing references)
//IL_0559: Unknown result type (might be due to invalid IL or missing references)
//IL_0562: Unknown result type (might be due to invalid IL or missing references)
//IL_0567: Unknown result type (might be due to invalid IL or missing references)
//IL_0571: Unknown result type (might be due to invalid IL or missing references)
//IL_057b: Unknown result type (might be due to invalid IL or missing references)
//IL_0598: Unknown result type (might be due to invalid IL or missing references)
//IL_059d: Unknown result type (might be due to invalid IL or missing references)
//IL_05ba: Unknown result type (might be due to invalid IL or missing references)
//IL_05bf: Unknown result type (might be due to invalid IL or missing references)
//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
//IL_05de: Unknown result type (might be due to invalid IL or missing references)
//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0600: Unknown result type (might be due to invalid IL or missing references)
//IL_0613: Unknown result type (might be due to invalid IL or missing references)
//IL_0618: Unknown result type (might be due to invalid IL or missing references)
//IL_0620: Unknown result type (might be due to invalid IL or missing references)
//IL_0625: Unknown result type (might be due to invalid IL or missing references)
//IL_062d: Unknown result type (might be due to invalid IL or missing references)
//IL_0632: Unknown result type (might be due to invalid IL or missing references)
//IL_063a: Unknown result type (might be due to invalid IL or missing references)
//IL_063f: Unknown result type (might be due to invalid IL or missing references)
//IL_0663: Unknown result type (might be due to invalid IL or missing references)
//IL_0668: Unknown result type (might be due to invalid IL or missing references)
//IL_0681: Unknown result type (might be due to invalid IL or missing references)
//IL_0686: Unknown result type (might be due to invalid IL or missing references)
//IL_0694: Unknown result type (might be due to invalid IL or missing references)
//IL_0699: Unknown result type (might be due to invalid IL or missing references)
//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
//IL_06c9: Unknown result type (might be due to invalid IL or missing references)
//IL_06e6: Unknown result type (might be due to invalid IL or missing references)
//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
//IL_070f: Unknown result type (might be due to invalid IL or missing references)
//IL_071f: Unknown result type (might be due to invalid IL or missing references)
//IL_072f: Unknown result type (might be due to invalid IL or missing references)
//IL_07ab: Unknown result type (might be due to invalid IL or missing references)
//IL_07d4: Unknown result type (might be due to invalid IL or missing references)
//IL_07fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0802: Unknown result type (might be due to invalid IL or missing references)
//IL_081a: Unknown result type (might be due to invalid IL or missing references)
//IL_081f: Unknown result type (might be due to invalid IL or missing references)
//IL_083c: Unknown result type (might be due to invalid IL or missing references)
//IL_0841: Unknown result type (might be due to invalid IL or missing references)
//IL_084a: Unknown result type (might be due to invalid IL or missing references)
//IL_0878: Unknown result type (might be due to invalid IL or missing references)
//IL_087d: Unknown result type (might be due to invalid IL or missing references)
//IL_088b: Unknown result type (might be due to invalid IL or missing references)
//IL_08b9: Unknown result type (might be due to invalid IL or missing references)
//IL_08be: Unknown result type (might be due to invalid IL or missing references)
//IL_08cc: Unknown result type (might be due to invalid IL or missing references)
//IL_073f: Unknown result type (might be due to invalid IL or missing references)
//IL_074f: Unknown result type (might be due to invalid IL or missing references)
//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02da: Unknown result type (might be due to invalid IL or missing references)
//IL_075f: Unknown result type (might be due to invalid IL or missing references)
//IL_076f: Unknown result type (might be due to invalid IL or missing references)
//IL_0309: Unknown result type (might be due to invalid IL or missing references)
//IL_030e: Unknown result type (might be due to invalid IL or missing references)
//IL_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
//IL_03db: Unknown result type (might be due to invalid IL or missing references)
//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
Vector3 highestPosition = GetHighestPosition(pos1, pos2, pos3, pos4);
if (cd > 0f)
{
cd -= 1f;
}
if (cd < 0f)
{
thisObj.transform.SetParent((Transform)null);
Object.DontDestroyOnLoad((Object)(object)thisObj);
}
if (adjustable)
{
grab.enabled = true;
}
else if (!adjustable)
{
blkcol.enabled = false;
lftcol.enabled = false;
grab.enabled = false;
}
if (!GM.CurrentMovementManager.m_isGrounded)
{
blocker.SetActive(false);
}
else if (GM.CurrentMovementManager.m_isGrounded)
{
blocker.SetActive(true);
}
if (grabmove.transform.localPosition.y > 0.25f)
{
grabmove.transform.localPosition = new Vector3(0f, 0.25f, 0f);
}
if (grabmove.transform.localPosition.y < -0.25f)
{
grabmove.transform.localPosition = new Vector3(0f, -0.25f, 0f);
}
if (grabmove.transform.localPosition.y >= 0f)
{
lftcol.enabled = true;
blkcol.enabled = false;
}
if (grabmove.transform.localPosition.y < 0f)
{
lftcol.enabled = false;
blkcol.enabled = true;
}
if (!((Object)(object)GM.CurrentPlayerBody != (Object)null))
{
return;
}
if (grabitem.IsHeld)
{
if (((grabitem.m_hand.Input.TouchpadAxes.y >= 0.75f && !grabitem.m_hand.IsInStreamlinedMode) || (grabitem.m_hand.Input.BYButtonPressed && grabitem.m_hand.IsInStreamlinedMode)) && grabmove.transform.localPosition.y < 0.25f)
{
grabmove.transform.localPosition = new Vector3(0f, grabmove.transform.localPosition.y + 0.001f, 0f);
}
if (((grabitem.m_hand.Input.TouchpadAxes.y <= -0.75f && !grabitem.m_hand.IsInStreamlinedMode) || (grabitem.m_hand.Input.AXButtonPressed && grabitem.m_hand.IsInStreamlinedMode)) && grabmove.transform.localPosition.y > -0.25f)
{
grabmove.transform.localPosition = new Vector3(0f, grabmove.transform.localPosition.y - 0.001f, 0f);
}
}
Ray val = default(Ray);
((Ray)(ref val))..ctor(new Vector3(raypos1.transform.position.x, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position.y + 0.05f, raypos1.transform.position.z), Vector3.down);
RaycastHit val2 = default(RaycastHit);
Physics.Raycast(val, ref val2, 1000f, LayerMask.op_Implicit(lm1));
Ray val3 = default(Ray);
((Ray)(ref val3))..ctor(new Vector3(raypos2.transform.position.x, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position.y + 0.05f, raypos2.transform.position.z), Vector3.down);
RaycastHit val4 = default(RaycastHit);
Physics.Raycast(val3, ref val4, 1000f, LayerMask.op_Implicit(lm1));
Ray val5 = default(Ray);
((Ray)(ref val5))..ctor(new Vector3(raypos3.transform.position.x, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position.y + 0.05f, raypos3.transform.position.z), Vector3.down);
RaycastHit val6 = default(RaycastHit);
Physics.Raycast(val5, ref val6, 1000f, LayerMask.op_Implicit(lm1));
Ray val7 = default(Ray);
((Ray)(ref val7))..ctor(new Vector3(raypos4.transform.position.x, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position.y + 0.05f, raypos4.transform.position.z), Vector3.down);
RaycastHit val8 = default(RaycastHit);
Physics.Raycast(val7, ref val8, 1000f, LayerMask.op_Implicit(lm1));
pos1 = ((RaycastHit)(ref val2)).point;
pos2 = ((RaycastHit)(ref val4)).point;
pos3 = ((RaycastHit)(ref val6)).point;
pos4 = ((RaycastHit)(ref val8)).point;
lifter.transform.position = new Vector3(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position.x, GetHighestPosition(((RaycastHit)(ref val2)).point, ((RaycastHit)(ref val4)).point, ((RaycastHit)(ref val6)).point, ((RaycastHit)(ref val8)).point).y, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position.z);
if (pos1 == raypos1.transform.position || pos2 == raypos2.transform.position || pos3 == raypos3.transform.position || pos4 == raypos4.transform.position)
{
lifter.SetActive(false);
}
grabobj.transform.eulerAngles = ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.eulerAngles;
grabobj.transform.position = ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position;
thisObj.transform.position = new Vector3(((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position.x, ((Component)GM.CurrentMovementManager).gameObject.transform.position.y, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.position.z);
thisObj.transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.eulerAngles.y, 0f);
lifter.transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentPlayerBody.Torso).gameObject.transform.eulerAngles.y, 0f);
}
private Vector3 GetHighestPosition(params Vector3[] positions)
{
//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_007b: 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)
//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_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: 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)
if (positions == null || positions.Length == 0)
{
Debug.LogError((object)"pos are null!");
return Vector3.zero;
}
Vector3 result = positions[0];
for (int i = 0; i < positions.Length; i++)
{
Vector3 val = positions[i];
if (val.y > result.y)
{
result = val;
}
}
return result;
}
}
[BepInPlugin("JerryPC.JPC", "JPC", "1.0.0")]
[BepInDependency("nrgill28.Sodalite", "1.4.1")]
[BepInProcess("h3vr.exe")]
public class PlayerCrouchPlugin : BaseUnityPlugin
{
[NonSerialized]
public GameObject Prefab;
[NonSerialized]
public PlayerCrouch Component;
[NonSerialized]
public static bool Grabbable = false;
public float cd = 60f;
internal static ManualLogSource Logger { get; private set; }
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
Logger.LogMessage((object)"New harmony");
Logger.LogMessage((object)"Setted the fields");
Harmony.CreateAndPatchAll(typeof(PlayerCrouchPlugin), (string)null);
Logger.LogMessage((object)"Loaded sf System");
}
[HarmonyPatch(typeof(FVRWristMenu2), "Awake")]
[HarmonyPostfix]
public static void SPPC(FVRWristMenu2 __instance)
{
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Expected O, but got Unknown
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Expected O, but got Unknown
if ((Object)(object)__instance == (Object)null)
{
Logger.LogMessage((object)"No FVRWristMenu2");
}
bool flag = false;
string text = "ToggleCrouchSystem";
foreach (WristMenuButton button in WristMenuAPI.Buttons)
{
Logger.LogMessage((object)("CC " + button.Text));
if (button.Text == text)
{
flag = true;
break;
}
}
if (!flag)
{
WristMenuAPI.Buttons.Add(new WristMenuButton(text, new ButtonClickEvent(GrabToggle)));
}
}
private static void GrabToggle(object sender, ButtonClickEventArgs args)
{
Grabbable = !Grabbable;
}
public void FixedUpdate()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: 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)
if ((Object)(object)Component == (Object)null)
{
Scene activeScene = SceneManager.GetActiveScene();
if (((Scene)(ref activeScene)).name != "MainMenu3")
{
ItemSpawnerID spawnerID = IM.GetSpawnerID("PlayerCrouchSystem");
FVRObject mainObject = spawnerID.MainObject;
Prefab = Object.Instantiate<GameObject>(((AnvilAsset)mainObject).GetGameObject(), GM.CurrentMovementManager.Head.position, GM.CurrentMovementManager.Head.rotation);
if ((Object)(object)Prefab.GetComponentInChildren<PlayerCrouch>() != (Object)null)
{
Component = Prefab.GetComponentInChildren<PlayerCrouch>();
}
Logger.LogMessage((object)"Crouch System Deployed.");
}
}
if (Grabbable)
{
if ((Object)(object)Component != (Object)null)
{
Component.adjustable = true;
}
}
else if (!Grabbable && (Object)(object)Component != (Object)null)
{
Component.adjustable = false;
}
}
}
}