using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
using cakeslice;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Inclinometer Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Inclinometer Mod")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("dda37b61-28b6-4e8e-9a39-1f1807261c65")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace KemyNavTools;
public class CompassPhysics : MonoBehaviour
{
private ShipItem shipItem;
private Transform compassCardTransform;
private Transform sightingVaneTransform;
[Header("Physics Smoothness")]
public float cardSmoothness = 2.5f;
public float vaneSmoothness = 5f;
private readonly Vector3 vaneUpRotation = new Vector3(0f, 0f, 0f);
private readonly Vector3 vaneFoldedRotation = new Vector3(270f, 0f, 0f);
private float currentVanePitch = 270f;
private void Start()
{
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
shipItem = ((Component)this).GetComponent<ShipItem>();
compassCardTransform = ((Component)this).transform.Find("CompassCard");
sightingVaneTransform = ((Component)this).transform.Find("SightingVane");
if ((Object)(object)sightingVaneTransform != (Object)null)
{
sightingVaneTransform.localRotation = Quaternion.Euler(vaneFoldedRotation);
}
}
private void LateUpdate()
{
//IL_002d: 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_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)shipItem == (Object)null))
{
if ((Object)(object)compassCardTransform != (Object)null)
{
float y = ((Component)this).transform.eulerAngles.y;
Quaternion val = Quaternion.Euler(0f, 0f - y, 0f);
compassCardTransform.localRotation = Quaternion.Slerp(compassCardTransform.localRotation, val, Time.deltaTime * cardSmoothness);
}
if ((Object)(object)sightingVaneTransform != (Object)null)
{
float num = (Object.op_Implicit((Object)(object)((PickupableItem)shipItem).held) ? vaneUpRotation.x : vaneFoldedRotation.x);
currentVanePitch = Mathf.MoveTowardsAngle(currentVanePitch, num, vaneSmoothness * 50f * Time.deltaTime);
sightingVaneTransform.localRotation = Quaternion.Euler(currentVanePitch, 0f, 0f);
}
}
}
}
public static class CompassSetup
{
public static void Configure(GameObject prefab)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)prefab == (Object)null))
{
prefab.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
Rigidbody val = prefab.GetComponent<Rigidbody>() ?? prefab.AddComponent<Rigidbody>();
val.mass = 2f;
val.isKinematic = true;
SaveablePrefab val2 = prefab.GetComponent<SaveablePrefab>() ?? prefab.AddComponent<SaveablePrefab>();
val2.prefabIndex = 831;
if ((Object)(object)prefab.GetComponent<CompassPhysics>() == (Object)null)
{
prefab.AddComponent<CompassPhysics>();
}
Outline[] componentsInChildren = prefab.GetComponentsInChildren<Outline>(true);
Outline[] array = componentsInChildren;
foreach (Outline val3 in array)
{
Object.DestroyImmediate((Object)(object)val3, true);
}
}
}
}
public class BinnaclePhysics : MonoBehaviour
{
private Component shipItemComponent;
private Transform gimbalRing1;
private Transform compassBody;
private Transform compassFace;
private Transform inclinometerArm;
[Header("Gimbal Responsiveness")]
public float gimbalSmoothness = 5f;
public float compassSmoothness = 2.5f;
public float inclinometerSmoothness = 18f;
private void Start()
{
shipItemComponent = (Component)(((object)((Component)this).GetComponent<ShipItemLight>()) ?? ((object)((Component)this).GetComponent<ShipItem>()));
inclinometerArm = ((Component)this).transform.Find("InclinometerArm");
gimbalRing1 = ((Component)this).transform.Find("GimbalRing1");
if ((Object)(object)gimbalRing1 != (Object)null)
{
compassBody = gimbalRing1.Find("CompassBody");
if ((Object)(object)compassBody != (Object)null)
{
compassFace = compassBody.Find("CompassFace");
}
}
if ((Object)(object)gimbalRing1 == (Object)null || (Object)(object)compassBody == (Object)null || (Object)(object)compassFace == (Object)null || (Object)(object)inclinometerArm == (Object)null)
{
InclinometerPlugin.DiagLogger.LogError((object)"[NAV SUITE] Binnacle is missing one or more required child transforms in its expanded hierarchy!");
}
}
private void LateUpdate()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: 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_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: 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_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0201: Unknown result type (might be due to invalid IL or missing references)
//IL_020f: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)shipItemComponent == (Object)null))
{
Vector3 val;
if ((Object)(object)gimbalRing1 != (Object)null)
{
val = Vector3.ProjectOnPlane(Vector3.up, ((Component)this).transform.right);
Vector3 normalized = ((Vector3)(ref val)).normalized;
float num = Vector3.SignedAngle(((Component)this).transform.up, normalized, ((Component)this).transform.right);
Quaternion val2 = Quaternion.Euler(num, 0f, 0f);
gimbalRing1.localRotation = Quaternion.Slerp(gimbalRing1.localRotation, val2, Time.deltaTime * gimbalSmoothness);
}
if ((Object)(object)compassBody != (Object)null)
{
val = Vector3.ProjectOnPlane(Vector3.up, gimbalRing1.forward);
Vector3 normalized2 = ((Vector3)(ref val)).normalized;
float num2 = Vector3.SignedAngle(gimbalRing1.up, normalized2, gimbalRing1.forward);
Quaternion val3 = Quaternion.Euler(0f, 0f, num2);
compassBody.localRotation = Quaternion.Slerp(compassBody.localRotation, val3, Time.deltaTime * gimbalSmoothness);
}
if ((Object)(object)compassFace != (Object)null)
{
float y = compassBody.eulerAngles.y;
Quaternion val4 = Quaternion.Euler(0f, 0f - y, 0f);
compassFace.localRotation = Quaternion.Slerp(compassFace.localRotation, val4, Time.deltaTime * compassSmoothness);
}
if ((Object)(object)inclinometerArm != (Object)null)
{
Vector3 right = ((Component)this).transform.right;
float num3 = Mathf.Atan2(Vector3.Dot(Vector3.up, right), Vector3.Dot(Vector3.up, Vector3.up)) * 57.29578f;
Quaternion val5 = Quaternion.Euler(0f, 0f, 0f - num3);
inclinometerArm.localRotation = Quaternion.Slerp(inclinometerArm.localRotation, val5, Time.deltaTime * inclinometerSmoothness);
}
}
}
}
public static class BinnacleSetup
{
public static void Configure(GameObject prefab)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)prefab == (Object)null))
{
prefab.transform.localScale = new Vector3(1f, 1f, 1f);
Rigidbody val = prefab.GetComponent<Rigidbody>() ?? prefab.AddComponent<Rigidbody>();
val.mass = 15f;
val.isKinematic = true;
SaveablePrefab val2 = prefab.GetComponent<SaveablePrefab>() ?? prefab.AddComponent<SaveablePrefab>();
val2.prefabIndex = 832;
if ((Object)(object)prefab.GetComponent<BinnaclePhysics>() == (Object)null)
{
prefab.AddComponent<BinnaclePhysics>();
}
Outline[] componentsInChildren = prefab.GetComponentsInChildren<Outline>(true);
Outline[] array = componentsInChildren;
foreach (Outline val3 in array)
{
Object.DestroyImmediate((Object)(object)val3, true);
}
}
}
}
public static class InclinometerSetup
{
public static void Configure(GameObject prefab)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)prefab == (Object)null))
{
prefab.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f);
Rigidbody val = prefab.GetComponent<Rigidbody>() ?? prefab.AddComponent<Rigidbody>();
val.mass = 3f;
val.isKinematic = true;
SaveablePrefab val2 = prefab.GetComponent<SaveablePrefab>() ?? prefab.AddComponent<SaveablePrefab>();
val2.prefabIndex = 830;
if ((Object)(object)prefab.GetComponent<InclinometerPhysics>() == (Object)null)
{
prefab.AddComponent<InclinometerPhysics>();
}
Outline[] componentsInChildren = prefab.GetComponentsInChildren<Outline>(true);
Outline[] array = componentsInChildren;
foreach (Outline val3 in array)
{
Object.DestroyImmediate((Object)(object)val3, true);
}
}
}
}
[BepInPlugin("com.larsonlogistics.sailwind.navsuite", "Navigation Suite Mod", "1.0.0")]
public class InclinometerPlugin : BaseUnityPlugin
{
public static ManualLogSource DiagLogger;
public static AssetBundle MainAssetBundle;
private static readonly string assetBundleName = "navigation_suite_assets";
private void Awake()
{
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Expected O, but got Unknown
DiagLogger = ((BaseUnityPlugin)this).Logger;
DiagLogger.LogInfo((object)"[NAV SUITE] Initialization lifecycle activated.");
string location = Assembly.GetExecutingAssembly().Location;
string directoryName = Path.GetDirectoryName(location);
string text = Path.Combine(directoryName, assetBundleName);
if (File.Exists(text))
{
MainAssetBundle = AssetBundle.LoadFromFile(text);
DiagLogger.LogInfo((object)"[NAV SUITE] Asset bundle successfully loaded.");
}
else
{
DiagLogger.LogError((object)("[NAV SUITE] Critical Error: Asset bundle missing at " + text));
}
Harmony val = new Harmony("com.larsonlogistics.sailwind.navsuite");
val.PatchAll();
}
private void OnDestroy()
{
if ((Object)(object)MainAssetBundle != (Object)null)
{
MainAssetBundle.Unload(false);
}
}
}
[HarmonyPatch(typeof(PrefabsDirectory), "PopulateShipItems")]
public static class PreloadDirectoryPatch
{
private const int INCLINOMETER_INDEX = 830;
private const int COMPASS_INDEX = 831;
private const int BINNACLE_INDEX = 832;
private static GameObject inclinometerPrefab;
private static GameObject compassPrefab;
private static GameObject binnaclePrefab;
public static GameObject InclinometerPrefabRef => inclinometerPrefab;
public static GameObject CompassPrefabRef => compassPrefab;
public static GameObject BinnaclePrefabRef => binnaclePrefab;
[HarmonyPrefix]
public static void Prefix(PrefabsDirectory __instance)
{
if (__instance.directory == null)
{
return;
}
try
{
if (__instance.directory.Length <= 832)
{
Array.Resize(ref __instance.directory, 842);
}
}
catch (Exception arg)
{
InclinometerPlugin.DiagLogger.LogError((object)$"[NAV SUITE] Prefix array resize failed: {arg}");
}
}
[HarmonyPostfix]
public static void Postfix(PrefabsDirectory __instance)
{
if ((Object)(object)InclinometerPlugin.MainAssetBundle == (Object)null)
{
return;
}
try
{
if ((Object)(object)inclinometerPrefab == (Object)null)
{
inclinometerPrefab = InclinometerPlugin.MainAssetBundle.LoadAsset<GameObject>("Inclinometer");
InclinometerSetup.Configure(inclinometerPrefab);
}
__instance.directory[830] = inclinometerPrefab;
if ((Object)(object)compassPrefab == (Object)null)
{
compassPrefab = InclinometerPlugin.MainAssetBundle.LoadAsset<GameObject>("BearingCompass");
if ((Object)(object)compassPrefab != (Object)null)
{
CompassSetup.Configure(compassPrefab);
}
else
{
InclinometerPlugin.DiagLogger.LogError((object)"[NAV SUITE] Critical Error: BearingCompass prefab not found in bundle!");
}
}
__instance.directory[831] = compassPrefab;
if ((Object)(object)binnaclePrefab == (Object)null)
{
binnaclePrefab = InclinometerPlugin.MainAssetBundle.LoadAsset<GameObject>("Binnacle");
if ((Object)(object)binnaclePrefab != (Object)null)
{
BinnacleSetup.Configure(binnaclePrefab);
}
else
{
InclinometerPlugin.DiagLogger.LogError((object)"[NAV SUITE] Critical Error: Binnacle prefab not found in bundle!");
}
}
__instance.directory[832] = binnaclePrefab;
}
catch (Exception arg)
{
InclinometerPlugin.DiagLogger.LogError((object)$"[NAV SUITE] Postfix directory mapping failed: {arg}");
}
}
}
[HarmonyPatch(typeof(IslandStreetlightsManager), "Awake")]
public static class StreetlightManagerSpawnPatch
{
[HarmonyPostfix]
public static void Postfix(IslandStreetlightsManager __instance)
{
if (!((Object)(object)__instance == (Object)null))
{
GameObject gameObject = ((Component)((Component)__instance).transform.root).gameObject;
string text = ((Object)gameObject).name.ToLower();
if (text.Contains("gold rock"))
{
ShopInjection.TrySpawnGRC(gameObject);
}
else if (text.Contains("island 15 m (fort)"))
{
ShopInjection.TrySpawnFortAestrin(gameObject);
}
else if (text.Contains("island 9 e (dragon cliffs)"))
{
ShopInjection.TrySpawnDragonCliffs(gameObject);
}
}
}
}
public static class ShopInjection
{
private static bool spawnedGRC;
private static bool spawnedAestrin;
private static bool spawnedDragonCliffs;
public static void TrySpawnGRC(GameObject sceneryRoot)
{
//IL_0037: 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_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
if (spawnedGRC || (Object)(object)sceneryRoot == (Object)null)
{
return;
}
try
{
DeploySpawner(sceneryRoot, "GRC_Inclinometer", PreloadDirectoryPatch.InclinometerPrefabRef, new Vector3(1520f, 7.52f, -380.5f), Quaternion.Euler(77.5f, 241f, 0f));
DeploySpawner(sceneryRoot, "GRC_Compass", PreloadDirectoryPatch.CompassPrefabRef, new Vector3(1522.568f, 7.52f, -383.791f), Quaternion.Euler(343.5f, 237.5f, 0f));
DeploySpawner(sceneryRoot, "GRC_Binnacle", PreloadDirectoryPatch.BinnaclePrefabRef, new Vector3(1521.5f, 5.55f, -378f), Quaternion.Euler(0f, -90f, 0f));
spawnedGRC = true;
InclinometerPlugin.DiagLogger.LogInfo((object)"[NAV SUITE] GRC shop spawners cleanly deployed via IslandStreetlightsManager.");
}
catch (Exception arg)
{
InclinometerPlugin.DiagLogger.LogError((object)$"[NAV SUITE] Failed GRC injection: {arg}");
}
}
public static void TrySpawnFortAestrin(GameObject sceneryRoot)
{
//IL_0037: 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_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
if (spawnedAestrin || (Object)(object)sceneryRoot == (Object)null)
{
return;
}
try
{
DeploySpawner(sceneryRoot, "FA_Compass", PreloadDirectoryPatch.CompassPrefabRef, new Vector3(-76.904f, 2.87f, 44.645f), Quaternion.Euler(271f, 180f, 0f));
DeploySpawner(sceneryRoot, "FA_Inclinometer", PreloadDirectoryPatch.InclinometerPrefabRef, new Vector3(-73.704f, 2.87f, 44.62f), Quaternion.Euler(0f, 180f, 0f));
DeploySpawner(sceneryRoot, "FA_Binnacle", PreloadDirectoryPatch.BinnaclePrefabRef, new Vector3(-72.504f, 2.17f, 44.82f), Quaternion.Euler(0f, 135f, 0f));
spawnedAestrin = true;
InclinometerPlugin.DiagLogger.LogInfo((object)"[NAV SUITE] Fort Aestrin shop spawners cleanly deployed via IslandStreetlightsManager.");
}
catch (Exception arg)
{
InclinometerPlugin.DiagLogger.LogError((object)$"[NAV SUITE] Failed Fort Aestrin injection: {arg}");
}
}
public static void TrySpawnDragonCliffs(GameObject sceneryRoot)
{
//IL_0037: 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_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
if (spawnedDragonCliffs || (Object)(object)sceneryRoot == (Object)null)
{
return;
}
try
{
DeploySpawner(sceneryRoot, "DC_Compass", PreloadDirectoryPatch.CompassPrefabRef, new Vector3(-91.312f, 5.272f, -541.35f), Quaternion.Euler(89f, 44.6f, 0f));
DeploySpawner(sceneryRoot, "DC_Inclinometer", PreloadDirectoryPatch.InclinometerPrefabRef, new Vector3(-91.329f, 4.762f, -541.365f), Quaternion.Euler(0f, 224.6f, 0f));
DeploySpawner(sceneryRoot, "DC_Binnacle", PreloadDirectoryPatch.BinnaclePrefabRef, new Vector3(-91.729f, 3.662f, -541.765f), Quaternion.Euler(0f, 134.6f, 0f));
spawnedDragonCliffs = true;
InclinometerPlugin.DiagLogger.LogInfo((object)"[NAV SUITE] Dragon Cliffs shop spawners cleanly deployed via IslandStreetlightsManager.");
}
catch (Exception arg)
{
InclinometerPlugin.DiagLogger.LogError((object)$"[NAV SUITE] Failed Dragon Cliffs injection: {arg}");
}
}
private static void DeploySpawner(GameObject sceneryRoot, string label, GameObject targetPrefab, Vector3 localPos, Quaternion localRot)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)targetPrefab == (Object)null))
{
GameObject val = new GameObject("shop item spawner (" + label + ")");
val.transform.parent = sceneryRoot.transform;
val.transform.localPosition = localPos;
val.transform.localRotation = localRot;
MeshFilter val2 = targetPrefab.GetComponent<MeshFilter>() ?? targetPrefab.GetComponentInChildren<MeshFilter>();
if ((Object)(object)val2 != (Object)null)
{
MeshFilter val3 = val.AddComponent<MeshFilter>();
val3.mesh = val2.mesh;
val.AddComponent<MeshRenderer>();
}
ShopItemSpawner val4 = val.AddComponent<ShopItemSpawner>();
val4.itemPrefab = targetPrefab;
}
}
public static void ResetFlags()
{
spawnedGRC = false;
spawnedAestrin = false;
spawnedDragonCliffs = false;
}
}
public class InclinometerPhysics : MonoBehaviour
{
private ShipItem shipItem;
private Transform indicatorArmTransform;
[Header("Pendulum Smoothness")]
public float swingSmoothness = 18f;
private void Start()
{
shipItem = ((Component)this).GetComponent<ShipItem>();
indicatorArmTransform = ((Component)this).transform.Find("Arm");
if ((Object)(object)indicatorArmTransform == (Object)null)
{
InclinometerPlugin.DiagLogger.LogError((object)"[NAV SUITE] Critical: Couldn't find the 'Arm' child component!");
}
}
private void LateUpdate()
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: 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_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_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: 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_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)shipItem == (Object)null) && !((Object)(object)indicatorArmTransform == (Object)null))
{
Vector3 right = ((Component)this).transform.right;
float num = Mathf.Atan2(Vector3.Dot(Vector3.up, right), Vector3.Dot(Vector3.up, Vector3.up)) * 57.29578f;
Quaternion val = Quaternion.Euler(0f, 0f, 0f - num);
indicatorArmTransform.localRotation = Quaternion.Slerp(indicatorArmTransform.localRotation, val, Time.deltaTime * swingSmoothness);
}
}
}