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 UnityEngine;
[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]
namespace JerryGasterAR
{
public class GasterReceivers : MonoBehaviour
{
public ClosedBoltWeapon AR1;
public ClosedBoltWeapon AR2;
private void OnShotFired(FVRFireArm firearm)
{
if ((Object)(object)firearm == (Object)(object)AR1)
{
AR2.Bolt.SnapToRear();
}
if ((Object)(object)firearm == (Object)(object)AR2)
{
AR1.Bolt.SnapToRear();
}
}
private void Awake()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnShotFired);
}
private void Update()
{
//IL_0020: 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_005e: Unknown result type (might be due to invalid IL or missing references)
((Component)AR2).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
((Component)AR2).gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
if ((int)AR2.Bolt.CurPos == 0 && AR2.Chamber.IsFull && !AR2.Chamber.IsSpent)
{
AR2.Fire();
}
if ((Object)(object)((FVRFireArm)AR2).Magazine != (Object)null)
{
((FVRInteractiveObject)((FVRFireArm)AR2).Magazine).SetAllCollidersToLayer(false, "NoCol");
}
}
private void OnDestroy()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
if ((Object)(object)AR2 != (Object)null)
{
Object.Destroy((Object)(object)((Component)AR2).gameObject);
}
GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(OnShotFired);
}
}
}
namespace JerryAr.GastAR
{
[BepInPlugin("JerryAr.GastAR", "GastAR", "1.0.1")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class GastARPlugin : 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.GastAR");
OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.GastAR", "", "", "gastar", "");
}
}
}