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 MeatKit
{
public class HideInNormalInspectorAttribute : PropertyAttribute
{
}
}
namespace Nikpo.CP2077_Crusher
{
[BepInPlugin("Nikpo.CP2077_Crusher", "CP2077_Crusher", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class CP2077_CrusherPlugin : 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(), "Nikpo.CP2077_Crusher");
OtherLoader.RegisterDirectLoad(BasePath, "Nikpo.CP2077_Crusher", "", "", "cp77_militechcrusher", "");
}
}
}
namespace Nikpo
{
public class ObjectLevelRotation : MonoBehaviour
{
public void OnEnable()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
((Component)this).transform.rotation = Quaternion.identity;
}
}
public class ObjectLookAtPlayer : MonoBehaviour
{
private void Awake()
{
//IL_0011: 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_003e: Unknown result type (might be due to invalid IL or missing references)
((Component)this).transform.LookAt(GM.CurrentPlayerBody.Head.position);
((Component)this).transform.localEulerAngles = new Vector3(0f, ((Component)this).transform.localEulerAngles.y, 0f);
}
}
public class UILookAtPlayer : MonoBehaviour
{
public Transform canvasToCheck;
public float scaleFactor = 0.05f;
public float minScale = 0.5f;
public float maxScale = 2f;
public float dotFadeThreshold = -0.8f;
public float fadeSpeed = 0.1f;
public float dotProductValue;
private CanvasGroup canvasGroup;
private void Start()
{
canvasGroup = ((Component)this).GetComponent<CanvasGroup>();
}
private void LateUpdate()
{
//IL_0011: 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_0030: 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)
//IL_0063: 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_0078: 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_008c: 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)
//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_00a9: 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_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
((Component)this).transform.LookAt(GM.CurrentPlayerBody.Head.position);
float num = Vector3.Distance(((Component)this).transform.position, GM.CurrentPlayerBody.Head.position);
num *= scaleFactor;
num = Mathf.Clamp(num, minScale, maxScale);
((Component)this).transform.localScale = Vector3.one * num;
float x = ((Component)this).transform.localScale.x;
Vector3 forward = canvasToCheck.forward;
Vector3 normalized = ((Vector3)(ref forward)).normalized;
Vector3 forward2 = GM.CurrentPlayerBody.Head.forward;
Vector3 normalized2 = ((Vector3)(ref forward2)).normalized;
dotProductValue = Vector3.Dot(normalized, normalized2);
if (x <= minScale)
{
FadeOut();
}
else if (dotProductValue <= dotFadeThreshold)
{
FadeIn();
}
else
{
FadeOut();
}
}
private void FadeIn()
{
canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, 1f, fadeSpeed);
}
private void FadeOut()
{
canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, 0.2f, fadeSpeed);
}
}
}