using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Service;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("KnotTraining")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("KnotTraining")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("88F9C74C-FD33-4630-AED1-0D8357C98ACF")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Service
{
public class Format
{
public const string FORMAT = "0.##";
public static string GetValidColor(bool valid)
{
if (!valid)
{
return "grey";
}
return "yellow";
}
public static string String(string value, string color = "yellow")
{
return "<color=" + color + ">" + value + "</color>";
}
public static string String(string value, bool valid)
{
return "<color=" + GetValidColor(valid) + ">" + value + "</color>";
}
public static string Float(double value, string format = "0.##", string color = "yellow")
{
return String(value.ToString(format, CultureInfo.InvariantCulture), color);
}
public static string Meters(double value, string color = "yellow")
{
return String(value.ToString("0.##", CultureInfo.InvariantCulture) + " meters", color);
}
public static string Coordinates(Vector3 coordinates, string format = "F0", string color = "yellow")
{
return JoinRow(from value in ((Vector3)(ref coordinates)).ToString(format).Replace("(", "").Replace(")", "")
.Split(new char[1] { ',' })
select String(value.Trim(), color));
}
public static string JoinLines(IEnumerable<string> lines)
{
return string.Join("\n", lines.Where((string line) => line != ""));
}
public static string JoinRow(IEnumerable<string> lines)
{
return string.Join(", ", lines.Where((string line) => line != ""));
}
}
[HarmonyPatch(typeof(MessageHud), "Update")]
public class MessageHud_UpdateMessage : MonoBehaviour
{
public static Func<List<string>> GetMessage = () => new List<string> { "Default message. Overwrite this with own function." };
private static void Postfix(MessageHud __instance)
{
if ((Object)(object)Player.m_localPlayer == (Object)null || Hud.IsUserHidden())
{
return;
}
string text = __instance.m_messageText.text;
List<string> list = GetMessage();
if (list.Count != 0)
{
while (text.StartsWith(" \n"))
{
text = text.Substring(2);
}
int num = ((text != "") ? text.Split(new char[1] { '\n' }).Length : 0) + list.Count - 2;
for (int i = 0; i < num; i++)
{
list.Insert(0, " ");
}
if (text != "")
{
list.Insert(0, " ");
list.Insert(0, " ");
list.Add(" ");
list.Add(text);
}
__instance.m_messageText.text = Format.JoinLines(list);
((Graphic)__instance.m_messageText).CrossFadeAlpha(1f, 0f, true);
((Graphic)__instance.m_messageIcon).canvasRenderer.SetAlpha(0f);
((Graphic)__instance.m_messageIcon).CrossFadeAlpha(0f, 0f, true);
}
}
}
[HarmonyPatch(typeof(MessageHud), "UpdateMessage")]
public class MessageHud_GetBaseMessage : MonoBehaviour
{
private static string BaseMessage = "";
private static void Prefix(out string __state)
{
__state = MessageHud.instance.m_messageText.text;
}
private static void Postfix(MessageHud __instance, float ___m_msgQueueTimer, string __state)
{
if (__instance.m_messageText.text != __state)
{
BaseMessage = __instance.m_messageText.text;
}
if (___m_msgQueueTimer >= 4f)
{
BaseMessage = "";
}
__instance.m_messageText.text = BaseMessage;
}
}
}
namespace KnotTraining
{
public class Draw
{
public const string TriggerLayer = "character_trigger";
private static readonly Texture2D Texture = new Texture2D(1, 1);
private static Shader? lineShader;
private static string shaderName = "Sprites/Default";
private static readonly Dictionary<Color, Material> materials = new Dictionary<Color, Material>();
private static Dictionary<string, Color> colors = new Dictionary<string, Color>();
private static Dictionary<string, int> lineWidths = new Dictionary<string, int>();
private static Shader LineShader => lineShader ?? (lineShader = ((IEnumerable<Shader>)Resources.FindObjectsOfTypeAll<Shader>()).FirstOrDefault((Func<Shader, bool>)((Shader shader) => ((Object)shader).name == shaderName)) ?? ((IEnumerable<Shader>)Resources.FindObjectsOfTypeAll<Shader>()).FirstOrDefault((Func<Shader, bool>)((Shader shader) => ((Object)shader).name == "Sprites/Default")) ?? throw new Exception("Shader not found."));
private static int GetSegments(float angle)
{
return (int)Math.Floor(32f * angle / 360f);
}
private static Vector3 GetArcSegmentX(float angle, float radius)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(0f, Mathf.Sin((float)Math.PI / 180f * angle) * radius, Mathf.Cos((float)Math.PI / 180f * angle) * radius);
}
private static Vector3 GetArcSegmentY(float angle, float radius)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(Mathf.Sin((float)Math.PI / 180f * angle) * radius, 0f, Mathf.Cos((float)Math.PI / 180f * angle) * radius);
}
private static Vector3 GetArcSegmentZ(float angle, float radius)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(Mathf.Sin((float)Math.PI / 180f * angle) * radius, Mathf.Cos((float)Math.PI / 180f * angle) * radius, 0f);
}
private static Vector3[] GetArcSegmentsX(Vector3 position, float angle, float radius)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: 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)
float num = (0f - angle) / 2f;
int segments = GetSegments(angle);
Vector3[] array = (Vector3[])(object)new Vector3[segments + 1];
for (int i = 0; i <= segments; i++)
{
array[i] = position + GetArcSegmentX(num, radius);
num += angle / (float)segments;
}
return array;
}
private static Vector3[] GetArcSegmentsY(Vector3 position, float angle, float radius)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: 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)
float num = (0f - angle) / 2f;
int segments = GetSegments(angle);
Vector3[] array = (Vector3[])(object)new Vector3[segments + 1];
for (int i = 0; i <= segments; i++)
{
array[i] = position + GetArcSegmentY(num, radius);
num += angle / (float)segments;
}
return array;
}
private static Vector3[] GetArcSegmentsZ(Vector3 position, float angle, float radius)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: 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)
float num = (0f - angle) / 2f;
int segments = GetSegments(angle);
Vector3[] array = (Vector3[])(object)new Vector3[segments + 1];
for (int i = 0; i <= segments; i++)
{
array[i] = position + GetArcSegmentZ(num, radius);
num += angle / (float)segments;
}
return array;
}
private static void UpdateArcX(LineRenderer renderer, Vector3 position, float radius, float angle, float width)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
Vector3[] arcSegmentsX = GetArcSegmentsX(position, angle, radius - width / 2f);
renderer.positionCount = arcSegmentsX.Length;
renderer.SetPositions(arcSegmentsX);
}
public static void DrawArcX(GameObject obj, Vector3 position, float radius, float angle)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
UpdateArcX(CreateRenderer(obj), position, radius, angle, GetLineWidth(((Object)obj).name));
}
private static void UpdateArcY(LineRenderer renderer, Vector3 position, float radius, float angle, float width)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
Vector3[] arcSegmentsY = GetArcSegmentsY(position, angle, radius - width / 2f);
renderer.positionCount = arcSegmentsY.Length;
renderer.SetPositions(arcSegmentsY);
}
public static void DrawArcY(GameObject obj, Vector3 position, float radius, float angle)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
UpdateArcY(CreateRenderer(obj), position, radius, angle, GetLineWidth(((Object)obj).name));
}
private static void UpdateArcZ(LineRenderer renderer, Vector3 position, float radius, float angle, float width)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
Vector3[] arcSegmentsZ = GetArcSegmentsZ(position, angle, radius - width / 2f);
renderer.positionCount = arcSegmentsZ.Length;
renderer.SetPositions(arcSegmentsZ);
}
public static void DrawArcZ(GameObject obj, Vector3 position, float radius, float angle)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
UpdateArcZ(CreateRenderer(obj), position, radius, angle, GetLineWidth(((Object)obj).name));
}
public static GameObject DrawCircleY(string tag, GameObject parent, float radius)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
GameObject obj = CreateObject(parent, tag);
DrawArcY(CreateObject(obj, tag), Vector3.zero, radius, 360f);
AddMeshCollider(obj);
return obj;
}
public static GameObject DrawArc(string tag, MonoBehaviour parent, Vector3 position, float radius, float angle)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
GameObject obj = CreateObject(((Component)parent).gameObject, tag);
DrawArcY(CreateObject(obj, tag), position, radius, angle);
DrawArcX(CreateObject(obj, tag), position, radius, angle);
AddMeshCollider(obj);
return obj;
}
public static void SetShader(string name)
{
shaderName = name;
lineShader = null;
materials.Clear();
Visualization[] visualizations = Utils.GetVisualizations();
for (int i = 0; i < visualizations.Length; i++)
{
ChangeColor(((Component)visualizations[i]).gameObject);
}
}
public static void Init()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
Texture.SetPixel(0, 0, Color.gray);
}
private static GameObject CreateObject(GameObject parent, string tag, bool fixRotation = false)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Expected O, but got Unknown
//IL_002d: 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)
GameObject val = new GameObject();
val.layer = LayerMask.NameToLayer("character_trigger");
val.transform.parent = parent.transform;
val.transform.localPosition = Vector3.zero;
if (!fixRotation)
{
val.transform.localRotation = Quaternion.identity;
}
if (tag != "")
{
((Object)val).name = tag;
val.AddComponent<Visualization>().Tag = tag;
}
return val;
}
private static GameObject CreateLineRotater(GameObject parent, Vector3 start, Vector3 end)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//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_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: 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)
//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_004a: 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_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
GameObject val = new GameObject
{
name = ((Object)parent).name,
layer = LayerMask.NameToLayer("character_trigger")
};
val.transform.parent = parent.transform;
val.transform.localPosition = start;
val.transform.localRotation = Quaternion.FromToRotation(Vector3.forward, end - start);
return val;
}
private static Material GetMaterial(Color color)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
if (materials.ContainsKey(color))
{
return materials[color];
}
Material val = new Material(LineShader);
val.SetColor("_Color", color);
val.SetFloat("_BlendOp", 1f);
val.SetTexture("_MainTex", (Texture)(object)Texture);
materials[color] = val;
return val;
}
private static LineRenderer CreateRenderer(GameObject obj)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
LineRenderer obj2 = obj.AddComponent<LineRenderer>();
obj2.useWorldSpace = false;
((Renderer)obj2).sharedMaterial = GetMaterial(GetColor(((Object)obj).name));
((Renderer)obj2).shadowCastingMode = (ShadowCastingMode)0;
obj2.widthMultiplier = GetLineWidth(((Object)obj).name);
return obj2;
}
private static void ChangeColor(GameObject obj)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
LineRenderer component = obj.GetComponent<LineRenderer>();
if (Object.op_Implicit((Object)(object)component))
{
((Renderer)component).sharedMaterial = GetMaterial(GetColor(((Object)obj).name));
}
}
private static void ChangeLineWidth(GameObject obj)
{
float lineWidth = GetLineWidth(((Object)obj).name);
LineRenderer component = obj.GetComponent<LineRenderer>();
if (Object.op_Implicit((Object)(object)component))
{
component.widthMultiplier = lineWidth;
}
}
public static void AddMeshCollider(GameObject obj)
{
Array.ForEach(obj.GetComponentsInChildren<LineRenderer>(), delegate(LineRenderer renderer)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
MeshCollider obj2 = obj.AddComponent<MeshCollider>();
obj2.convex = true;
((Collider)obj2).isTrigger = true;
Mesh val = new Mesh();
renderer.BakeMesh(val, false);
obj2.sharedMesh = val;
});
}
public static void AddText(GameObject obj, string title, string text)
{
StaticText staticText = obj.AddComponent<StaticText>();
staticText.text = text;
staticText.title = title;
}
public static LineRenderer[] GetRenderers(MonoBehaviour obj, string tag)
{
return ((Component)obj).GetComponentsInChildren<LineRenderer>(true).Where(delegate(LineRenderer renderer)
{
Visualization component = ((Component)renderer).GetComponent<Visualization>();
return (Object)(object)component != (Object)null && component.Tag == tag;
}).ToArray();
}
public static Color GetColor(string tag)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
if (!colors.ContainsKey(tag))
{
return Color.red;
}
return colors[tag];
}
public static void SetColor(string tag, Color color)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
colors[tag] = color;
Visualization[] visualizations = Utils.GetVisualizations();
foreach (Visualization visualization in visualizations)
{
if (visualization.Tag == tag)
{
ChangeColor(((Component)visualization).gameObject);
}
}
}
public static float GetLineWidth(string tag)
{
return (float)Math.Max(5, lineWidths.ContainsKey(tag) ? lineWidths[tag] : 0) / 100f;
}
public static void SetLineWidth(string tag, int width)
{
lineWidths[tag] = width;
Visualization[] visualizations = Utils.GetVisualizations();
foreach (Visualization visualization in visualizations)
{
if (visualization.Tag == tag)
{
ChangeLineWidth(((Component)visualization).gameObject);
}
}
}
public static void AddSphereCollider(GameObject obj, float radius)
{
Array.ForEach(obj.GetComponentsInChildren<LineRenderer>(), delegate
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
SphereCollider obj2 = obj.AddComponent<SphereCollider>();
((Collider)obj2).isTrigger = true;
obj2.center = Vector3.zero;
obj2.radius = radius;
});
}
public static void UpdateSphereCollider(MonoBehaviour obj, float radius)
{
Array.ForEach(((Component)obj).GetComponentsInChildren<SphereCollider>(), delegate(SphereCollider collider)
{
collider.radius = radius;
});
}
public static void UpdateSphere(MonoBehaviour parent, float radius)
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
LineRenderer[] componentsInChildren = ((Component)parent).GetComponentsInChildren<LineRenderer>();
if (componentsInChildren.Length == 3)
{
float widthMultiplier = componentsInChildren[0].widthMultiplier;
UpdateArcX(componentsInChildren[0], Vector3.zero, radius, 360f, widthMultiplier);
UpdateArcY(componentsInChildren[1], Vector3.zero, radius, 360f, widthMultiplier);
UpdateArcZ(componentsInChildren[2], Vector3.zero, radius, 360f, widthMultiplier);
UpdateSphereCollider(parent, radius - widthMultiplier / 2f);
}
}
public static GameObject DrawSphere(string tag, MonoBehaviour parent, float radius)
{
return DrawSphere(tag, ((Component)parent).gameObject, radius);
}
public static GameObject DrawSphere(string tag, GameObject parent, float radius)
{
//IL_0010: 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)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
GameObject obj = CreateObject(parent, tag);
DrawArcX(CreateObject(obj, tag), Vector3.zero, radius, 360f);
float lineWidth = GetLineWidth(tag);
AddSphereCollider(obj, radius - lineWidth / 2f);
DrawArcY(CreateObject(obj, tag), Vector3.zero, radius, 360f);
DrawArcZ(CreateObject(obj, tag), Vector3.zero, radius, 360f);
return obj;
}
}
[BepInPlugin("knot.training", "KnotTraining", "1.0.0")]
public class Main : BaseUnityPlugin
{
private const string pluginGUID = "knot.training";
private const string pluginName = "KnotTraining";
private const string pluginVersion = "1.0.0";
private static GameObject? training = null;
private readonly Harmony HarmonyInstance = new Harmony("knot.training");
public static ManualLogSource logger = Logger.CreateLogSource("KnotTraining");
public static string Tag = "knot.training.KnotTraining";
private static Vector3 Position;
private static float Radius;
public static bool Enabled => Object.op_Implicit((Object)(object)training);
public void Awake()
{
logger.LogInfo((object)"KnotTraining mod loaded");
Assembly executingAssembly = Assembly.GetExecutingAssembly();
HarmonyInstance.PatchAll(executingAssembly);
MessageHud_UpdateMessage.GetMessage = GetMessage;
}
public static void Remove()
{
if (Object.op_Implicit((Object)(object)training))
{
Object.Destroy((Object)(object)training);
}
training = null;
}
public static void Refresh()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
Draw(Position, Radius);
}
public static void Draw(Vector3 position, float radius)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Expected O, but got Unknown
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
Position = position;
Radius = radius;
if (Object.op_Implicit((Object)(object)training))
{
Remove();
}
GameObject val = new GameObject();
val.layer = LayerMask.NameToLayer("character_trigger");
val.transform.position = position;
training = val;
KnotTraining.Draw.DrawSphere(Tag, val, radius);
}
private static string GetText()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Player.m_localPlayer == (Object)null)
{
return "--";
}
if (((Character)Player.m_localPlayer).GetNoiseRange() > 2f)
{
Draw(((Component)Player.m_localPlayer).transform.position, ((Character)Player.m_localPlayer).GetNoiseRange());
}
else if (Object.op_Implicit((Object)(object)training))
{
Remove();
}
return "Current noise distance " + ((Character)Player.m_localPlayer).GetNoiseRange().ToString("N");
}
public static List<string> GetMessage()
{
return new List<string> { GetText() };
}
}
public class Utils
{
public static Visualization[] GetVisualizations()
{
return Resources.FindObjectsOfTypeAll<Visualization>();
}
}
[HarmonyPatch(typeof(Player), "UpdateHover")]
public class Player_AddHoverForVisuals
{
private static void Postfix(ref GameObject ___m_hovering, ref GameObject ___m_hoveringCreature)
{
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: 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_0072: 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_007d: 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_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)___m_hovering) || Object.op_Implicit((Object)(object)___m_hoveringCreature) || !Main.Enabled)
{
return;
}
float num = 100f;
int mask = LayerMask.GetMask(new string[1] { "character_trigger" });
RaycastHit[] array = Physics.RaycastAll(((Component)GameCamera.instance).transform.position, ((Component)GameCamera.instance).transform.forward, num, mask);
RaycastHit[] array2 = Physics.RaycastAll(((Component)GameCamera.instance).transform.position + ((Component)GameCamera.instance).transform.forward * num, -((Component)GameCamera.instance).transform.forward, num, mask);
RaycastHit[] array3 = CollectionExtensions.AddRangeToArray<RaycastHit>(array, array2);
Array.Sort(array3, (RaycastHit x, RaycastHit y) => ((RaycastHit)(ref x)).distance.CompareTo(((RaycastHit)(ref y)).distance));
RaycastHit[] array4 = array3;
for (int i = 0; i < array4.Length; i++)
{
RaycastHit val = array4[i];
if ((Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponent<Visualization>() != (Object)null)
{
___m_hovering = ((Component)((RaycastHit)(ref val)).collider).gameObject;
break;
}
}
}
}
public class StaticText : MonoBehaviour, Hoverable
{
public string title = "";
public string text = "";
public string GetHoverText()
{
return Format.String(title) + "\n" + text;
}
public string GetHoverName()
{
return title;
}
}
public class Visualization : MonoBehaviour
{
public string Tag = "";
}
}