using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("SpectatorCameraConfig")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("3rd person spectator camera for big headed scavengers")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2")]
[assembly: AssemblyProduct("SpectatorCameraConfig")]
[assembly: AssemblyTitle("SpectatorCameraConfig")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
namespace SpectatorCameraConfig
{
[BepInPlugin("SpectatorCameraConfig", "SpectatorCameraConfig", "1.0.2")]
public class SpectatorCameraConfig : BaseUnityPlugin
{
private readonly Harmony harmony = new Harmony("SpectatorCameraConfig");
private static SpectatorCameraConfig Instance;
public static ConfigEntry<float> Distance;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
Distance = ((BaseUnityPlugin)this).Config.Bind<float>("Camera Settings", "Distance", -1.5f, "Distance of the camera from the player.");
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin SpectatorCameraConfig is loaded!");
harmony.PatchAll();
}
private void OnDestroy()
{
harmony.UnpatchSelf();
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "SpectatorCameraConfig";
public const string PLUGIN_NAME = "SpectatorCameraConfig";
public const string PLUGIN_VERSION = "1.0.2";
}
}
namespace SpectatorCameraConfig.Patches
{
[HarmonyPatch(typeof(PlayerControllerB))]
internal class CameraPatch
{
[HarmonyPatch("LateUpdate")]
[HarmonyPostfix]
private static void LateUpdate(PlayerControllerB __instance)
{
//IL_0020: 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_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: 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_0046: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)__instance.spectatedPlayerScript != (Object)null)
{
Transform val = __instance.spectateCameraPivot.Find("SpectateCamera");
Vector3 position = val.position + ((Component)val).transform.forward * SpectatorCameraConfig.Distance.Value;
val.position = position;
}
}
}
}