diff --git a/updateClass b/updateClass deleted file mode 100644 index e688ef6..0000000 --- a/updateClass +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Collections.Generic; -using HarmonyLib; -using BepInEx; -using UnityEngine; -using System.Reflection; -using UnityEngine.XR; -using Photon.Pun; -using System.IO; -using System.Net; -using Photon.Realtime; -using UnityEngine.Rendering; - -namespace FlyFastMod -{ - [BepInPlugin("org.Crafterbot.monkeytag.Fly", "FlyFast", "1.0")] - public class MyPatcher : BaseUnityPlugin - { - public void Awake() - { - var harmony = new Harmony("com.Crafterbot.monkeytag.FlyFast"); - harmony.PatchAll(Assembly.GetExecutingAssembly()); - } - } - - [HarmonyPatch(typeof(GorillaLocomotion.Player))] - [HarmonyPatch("Update", MethodType.Normal)] - - public class class1 - { - static bool fly = false; - static bool stop = false; - static bool grip1 = false; - static bool grip2 = false; - static bool trigger1 = false; - static bool trigger2 = false; - static void Postfix(GorillaLocomotion.Player __instance) - { - if (!PhotonNetwork.CurrentRoom.IsVisible || !PhotonNetwork.InRoom) - { - - List list = new List(); - InputDevices.GetDevicesWithCharacteristics(UnityEngine.XR.InputDeviceCharacteristics.HeldInHand | UnityEngine.XR.InputDeviceCharacteristics.Right | UnityEngine.XR.InputDeviceCharacteristics.Controller, list); - list[0].TryGetFeatureValue(CommonUsages.primaryButton, out fly); - InputDevices.GetDevicesWithCharacteristics(UnityEngine.XR.InputDeviceCharacteristics.HeldInHand | UnityEngine.XR.InputDeviceCharacteristics.Right | UnityEngine.XR.InputDeviceCharacteristics.Controller, list); - list[0].TryGetFeatureValue(CommonUsages.secondaryButton, out stop); - InputDevices.GetDevicesWithCharacteristics(UnityEngine.XR.InputDeviceCharacteristics.HeldInHand | UnityEngine.XR.InputDeviceCharacteristics.Right | UnityEngine.XR.InputDeviceCharacteristics.Controller, list); - list[0].TryGetFeatureValue(CommonUsages.gripButton, out grip1); - InputDevices.GetDevicesWithCharacteristics(UnityEngine.XR.InputDeviceCharacteristics.HeldInHand | UnityEngine.XR.InputDeviceCharacteristics.Left | UnityEngine.XR.InputDeviceCharacteristics.Controller, list); - list[0].TryGetFeatureValue(CommonUsages.gripButton, out grip2); - InputDevices.GetDevicesWithCharacteristics(UnityEngine.XR.InputDeviceCharacteristics.HeldInHand | UnityEngine.XR.InputDeviceCharacteristics.Left | UnityEngine.XR.InputDeviceCharacteristics.Controller, list); - list[0].TryGetFeatureValue(CommonUsages.triggerButton, out trigger1); - InputDevices.GetDevicesWithCharacteristics(UnityEngine.XR.InputDeviceCharacteristics.HeldInHand | UnityEngine.XR.InputDeviceCharacteristics.Right | UnityEngine.XR.InputDeviceCharacteristics.Controller, list); - list[0].TryGetFeatureValue(CommonUsages.triggerButton, out trigger2); - float speed = 1500; - if (grip1) - { - if (grip2) - { - speed = 3000; - } - else - { - speed = 1500; - } - } - else - { - speed = 1500; - } - - - if (trigger1 & trigger2 & grip1 & grip2) - { - if (fly) - { - speed = 6500; - } - } - - - - if (stop) - { - if (fly) - { - fly = false; - } - __instance.bodyCollider.attachedRigidbody.velocity = __instance.headCollider.transform.forward * Time.deltaTime * 0; - } - - - - - if (fly) - { - //if you grip down then you fly in that direction but if you dont then you fly normal - idea - __instance.bodyCollider.attachedRigidbody.velocity = __instance.headCollider.transform.forward * Time.deltaTime * speed; - __instance.bodyCollider.attachedRigidbody.useConeFriction = false; - __instance.bodyCollider.attachedRigidbody.useGravity = false; - - } - else - { - __instance.bodyCollider.attachedRigidbody.useConeFriction = true; - __instance.bodyCollider.attachedRigidbody.useGravity = true; - } - - - } - } - } -} -