using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
using UnityEngine;
using UnityEngine.Networking;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("FlorpifySkulls")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("FlorpifySkulls")]
[assembly: AssemblyTitle("FlorpifySkulls")]
[assembly: AssemblyVersion("1.0.0.0")]
[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.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
public static class FlorpGod
{
public enum RotateAxis
{
X,
Y,
Z
}
public enum GodModeTarget
{
Both,
Red,
Blue
}
private class FloatState : MonoBehaviour
{
public float offset;
public float bobTime;
}
private class Billboard : MonoBehaviour
{
private void LateUpdate()
{
//IL_001b: 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)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
Camera main = Camera.main;
if (Object.op_Implicit((Object)(object)main))
{
((Component)this).transform.forward = ((Component)this).transform.position - ((Component)main).transform.position;
}
}
}
private static Sprite haloSprite;
private static Material haloMaterial;
private static GameObject starsPrefab;
private static bool ready;
public static float FloatHeight = 1.2f;
public static float FloatSpeed = 2.25f;
public static float BobAmount = 0.05f;
public static float BobSpeed = 1.5f;
public static bool FloatEnabled = true;
public static bool BobEnabled = true;
public static bool RotateEnabled = false;
public static float RotateSpeed = 30f;
public static RotateAxis RotateAxisMode = RotateAxis.Y;
public static GodModeTarget TargetMode = GodModeTarget.Both;
public static bool HideFxWhenHeld = true;
private static readonly Vector3 WORLD_UP = new Vector3(0f, 1f, 0f);
private static readonly Vector3 HALO_POS = new Vector3(-0.005f, 0f, 0.035f);
private static readonly float HALO_SCALE = 1.05f;
private static readonly float FX_SCALE = 1E-05f;
private static readonly Color RAYS_NORMAL = new Color(0.7f, 0.9f, 1f, 0.75f);
public static void Reset(Transform mesh)
{
FloatState component = ((Component)mesh).GetComponent<FloatState>();
if ((Object)(object)component != (Object)null)
{
component.offset = 0f;
component.bobTime = 0f;
}
}
public static void Update(Transform mesh, Vector3 baseLocalPos)
{
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: 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)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
FloatState floatState = ((Component)mesh).GetComponent<FloatState>();
if (!Object.op_Implicit((Object)(object)floatState))
{
floatState = ((Component)mesh).gameObject.AddComponent<FloatState>();
}
float num = (FloatEnabled ? FloatHeight : 0f);
floatState.offset = Mathf.Lerp(floatState.offset, num, Time.deltaTime * FloatSpeed);
bool flag = floatState.offset >= FloatHeight * 0.98f;
floatState.bobTime += Time.deltaTime * BobSpeed;
float num2 = ((BobEnabled && flag) ? (Mathf.Sin(floatState.bobTime) * BobAmount) : 0f);
Transform parent = mesh.parent;
if (!Object.op_Implicit((Object)(object)parent))
{
mesh.localPosition = baseLocalPos + WORLD_UP * (floatState.offset + num2);
return;
}
Vector3 val = parent.TransformPoint(baseLocalPos) + WORLD_UP * (floatState.offset + num2);
mesh.localPosition = parent.InverseTransformPoint(val);
}
public static void Attach(Transform parent, bool isRed, bool held, bool hideWhenHeld)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
if (held && hideWhenHeld)
{
Remove(parent);
return;
}
if (!ready)
{
Load();
}
if (!ready)
{
return;
}
Transform val = parent.Find("FlorpGodFX");
Transform val2;
if (!Object.op_Implicit((Object)(object)val))
{
val = new GameObject("FlorpGodFX").transform;
val.SetParent(parent, false);
((Component)val).gameObject.AddComponent<Billboard>();
CreateSprite(val, "Halo", 1000).localScale = Vector3.one * HALO_SCALE;
val2 = new GameObject("FX").transform;
val2.SetParent(val, false);
CreateSprite(val2, "Rays", 999);
if (Object.op_Implicit((Object)(object)starsPrefab))
{
((Object)Object.Instantiate<GameObject>(starsPrefab, val2)).name = "Stars";
}
}
else
{
val2 = val.Find("FX");
}
val.localPosition = HALO_POS;
object obj;
if (val2 == null)
{
obj = null;
}
else
{
Transform obj2 = val2.Find("Rays");
obj = ((obj2 != null) ? ((Component)obj2).GetComponent<SpriteRenderer>() : null);
}
SpriteRenderer val3 = (SpriteRenderer)obj;
if (Object.op_Implicit((Object)(object)val3))
{
val3.color = RAYS_NORMAL;
}
if (Object.op_Implicit((Object)(object)val2))
{
val2.localScale = Vector3.one * FX_SCALE;
}
}
public static void Remove(Transform parent)
{
Transform val = parent.Find("FlorpGodFX");
if (Object.op_Implicit((Object)(object)val))
{
Object.Destroy((Object)(object)((Component)val).gameObject);
}
}
private static void Load()
{
MonoBehaviour val = ((IEnumerable<MonoBehaviour>)Resources.FindObjectsOfTypeAll<MonoBehaviour>()).FirstOrDefault((Func<MonoBehaviour, bool>)((MonoBehaviour x) => ((object)x).GetType().Name == "Idol"));
if (Object.op_Implicit((Object)(object)val))
{
object? obj = ((object)val).GetType().GetField("halo", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(val);
SpriteRenderer val2 = (SpriteRenderer)((obj is SpriteRenderer) ? obj : null);
if (Object.op_Implicit((Object)(object)val2))
{
haloSprite = val2.sprite;
haloMaterial = ((Renderer)val2).sharedMaterial;
starsPrefab = FindChildWithComponentName(((Component)val).gameObject, "ParticleSystem");
ready = true;
}
}
}
private static GameObject FindChildWithComponentName(GameObject root, string name)
{
Transform[] componentsInChildren = root.GetComponentsInChildren<Transform>(true);
foreach (Transform val in componentsInChildren)
{
Component[] components = ((Component)val).GetComponents<Component>();
foreach (Component val2 in components)
{
if (Object.op_Implicit((Object)(object)val2) && ((object)val2).GetType().Name == name)
{
return ((Component)val).gameObject;
}
}
}
return null;
}
private static Transform CreateSprite(Transform parent, string name, int order)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name);
val.transform.SetParent(parent, false);
SpriteRenderer obj = val.AddComponent<SpriteRenderer>();
obj.sprite = haloSprite;
((Renderer)obj).material = haloMaterial;
((Renderer)obj).sortingOrder = order;
return val.transform;
}
}
[BepInPlugin("com.silentsmilee.florpifyskulls", "Florpify Skulls", "1.0.4")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public sealed class FlorpifySkulls : BaseUnityPlugin
{
private static Mesh florpMesh;
private static Material[] baseMats;
private static Material[] redMats;
private static Material[] blueMats;
private static bool florpReady;
private static bool matsDirty;
public static Color RedTint;
public static Color BlueTint;
public static float RedTintIntensity;
public static float BlueTintIntensity;
private static readonly Vector3 RED_POS;
private static readonly Vector3 BLUE_POS;
public static Vector3 Rot;
public static float Scale;
public static Vector3 HeldPos;
public static Vector3 HeldRot;
public static float HeldScale;
private PluginConfiguratorUI pluginUI;
private Skull[] cache = (Skull[])(object)new Skull[0];
private bool IsEnabled
{
get
{
if (pluginUI != null)
{
return pluginUI.IsEnabled;
}
return true;
}
}
private bool IsOptimizeEnabled
{
get
{
if (pluginUI != null)
{
return pluginUI.IsOptimizeEnabled;
}
return true;
}
}
private bool IsGodModeEnabled
{
get
{
if (pluginUI != null)
{
return pluginUI.IsGodModeEnabled;
}
return false;
}
}
private void Awake()
{
pluginUI = new PluginConfiguratorUI(enabledDefault: true, lowQualityDefault: true, godModeDefault: false);
pluginUI.Setup();
((MonoBehaviour)this).StartCoroutine(DownloadFlorp());
}
private void Update()
{
if (!IsEnabled || !florpReady)
{
return;
}
bool flag = false;
if (matsDirty)
{
RebuildTintMaterials();
flag = true;
}
Skull[] array;
if (IsOptimizeEnabled)
{
if (cache.Length == 0 || (Time.frameCount & 7) == 0)
{
cache = Object.FindObjectsOfType<Skull>();
}
array = cache;
}
else
{
array = Object.FindObjectsOfType<Skull>();
}
Skull[] array2 = array;
foreach (Skull val in array2)
{
if (Object.op_Implicit((Object)(object)val))
{
ApplyFlorp(val, flag);
}
}
if (flag)
{
matsDirty = false;
}
}
private void ApplyFlorp(Skull skull, bool forceMaterials)
{
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: 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)
//IL_0214: Unknown result type (might be due to invalid IL or missing references)
//IL_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_0229: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01db: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0200: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
Transform val = null;
Transform[] componentsInChildren = ((Component)skull).GetComponentsInChildren<Transform>(true);
for (int i = 0; i < componentsInChildren.Length; i++)
{
if (((Object)componentsInChildren[i]).name == "NewSkull")
{
val = componentsInChildren[i];
break;
}
}
if (!Object.op_Implicit((Object)(object)val))
{
return;
}
MeshFilter component = ((Component)val).GetComponent<MeshFilter>();
MeshRenderer component2 = ((Component)val).GetComponent<MeshRenderer>();
if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2))
{
return;
}
bool flag = ((Object)skull).name.ToLower().Contains("red");
bool flag2 = Object.op_Implicit((Object)(object)((Component)skull).transform.root) && ((Object)((Component)skull).transform.root).name == "Player";
if ((Object)(object)component.sharedMesh != (Object)(object)florpMesh || forceMaterials)
{
component.sharedMesh = florpMesh;
Material[] sharedMaterials = (flag ? redMats : blueMats);
((Renderer)component2).sharedMaterials = sharedMaterials;
}
bool flag3 = IsGodModeEnabled && IsGodModeForColor(flag);
if (flag2)
{
FlorpGod.Reset(val);
val.localPosition = HeldPos;
val.localRotation = Quaternion.Euler(HeldRot);
val.localScale = Vector3.one * HeldScale;
}
else
{
Vector3 val2 = (flag ? RED_POS : BLUE_POS);
if (flag3)
{
FlorpGod.Update(val, val2);
}
else
{
val.localPosition = val2;
}
if (flag3 && FlorpGod.FloatEnabled && FlorpGod.RotateEnabled)
{
Vector3 val3 = (Vector3)(FlorpGod.RotateAxisMode switch
{
FlorpGod.RotateAxis.X => Vector3.right,
FlorpGod.RotateAxis.Y => Vector3.up,
FlorpGod.RotateAxis.Z => Vector3.forward,
_ => Vector3.up,
});
Quaternion val4 = Quaternion.Euler(Rot);
Quaternion val5 = (Object.op_Implicit((Object)(object)val.parent) ? val.parent.rotation : Quaternion.identity) * val4;
Quaternion val6 = Quaternion.AngleAxis(Time.time * FlorpGod.RotateSpeed, val3);
val.rotation = val6 * val5;
}
else
{
val.localRotation = Quaternion.Euler(Rot);
}
val.localScale = Vector3.one * Scale;
}
if (flag3)
{
FlorpGod.Attach(val, flag, flag2, FlorpGod.HideFxWhenHeld);
}
else
{
FlorpGod.Remove(val);
}
}
private static bool IsGodModeForColor(bool isRed)
{
return FlorpGod.TargetMode switch
{
FlorpGod.GodModeTarget.Blue => !isRed,
FlorpGod.GodModeTarget.Red => isRed,
_ => true,
};
}
private static Material Tint(Material src, Color tint, float intensity)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: 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_003d: 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_006d: Unknown result type (might be due to invalid IL or missing references)
Material val = new Material(src);
Color val2 = Color.Lerp(Color.white, tint, Mathf.Clamp01(intensity));
if (val.HasProperty("_BaseColor"))
{
val.SetColor("_BaseColor", Color.Lerp(val.GetColor("_BaseColor"), val2, 0.95f));
}
else if (val.HasProperty("_Color"))
{
val.SetColor("_Color", Color.Lerp(val.GetColor("_Color"), val2, 0.95f));
}
return val;
}
public static void SetRedTint(Color tint)
{
//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)
RedTint = tint;
matsDirty = true;
}
public static void SetBlueTint(Color tint)
{
//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)
BlueTint = tint;
matsDirty = true;
}
private static void RebuildTintMaterials()
{
if (baseMats != null && baseMats.Length != 0)
{
redMats = baseMats.Select((Material m) => Tint(m, RedTint, RedTintIntensity)).ToArray();
blueMats = baseMats.Select((Material m) => Tint(m, BlueTint, BlueTintIntensity)).ToArray();
}
}
public static void SetRedTintIntensity(float intensity)
{
RedTintIntensity = intensity;
matsDirty = true;
}
public static void SetBlueTintIntensity(float intensity)
{
BlueTintIntensity = intensity;
matsDirty = true;
}
static FlorpifySkulls()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: 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_005a: 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_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_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: 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)
RedTint = new Color(1f, 0.55f, 0.55f);
BlueTint = new Color(0.55f, 0.75f, 1f);
RedTintIntensity = 1f;
BlueTintIntensity = 1f;
RED_POS = new Vector3(-0.19f, 0.03f, -0.2f);
BLUE_POS = new Vector3(-0.07f, 0.02f, -0.22f);
Rot = new Vector3(1f, 16f, 87f);
Scale = 2.8f;
HeldPos = new Vector3(-0.23f, -0.05f, 0.03f);
HeldRot = new Vector3(14f, 58f, 120f);
HeldScale = 2.7f;
}
private IEnumerator DownloadFlorp()
{
string text = "https://raw.githubusercontent.com/robotboy89/FileHoster/refs/heads/main/cubes.obj";
string texUrl = "https://raw.githubusercontent.com/robotboy89/FileHoster/refs/heads/main/texture.png";
UnityWebRequest objReq = UnityWebRequest.Get(text);
yield return objReq.SendWebRequest();
if ((int)objReq.result != 1)
{
Debug.LogError((object)("[FlorpifySkulls] Failed to download OBJ: " + objReq.error));
yield break;
}
UnityWebRequest texReq = UnityWebRequestTexture.GetTexture(texUrl);
yield return texReq.SendWebRequest();
if ((int)texReq.result != 1)
{
Debug.LogError((object)("[FlorpifySkulls] Failed to download texture: " + texReq.error));
yield break;
}
florpMesh = OBJLoader.Parse(objReq.downloadHandler.text);
Texture2D content = DownloadHandlerTexture.GetContent(texReq);
Shader val = Shader.Find("Universal Render Pipeline/Lit");
if (!Object.op_Implicit((Object)(object)val))
{
val = Shader.Find("Standard");
}
Material val2 = new Material(val);
val2.SetTexture("_MainTex", (Texture)(object)content);
val2.SetTexture("_BaseMap", (Texture)(object)content);
if (val2.HasProperty("_EmissionColor"))
{
val2.EnableKeyword("_EMISSION");
}
baseMats = (Material[])(object)new Material[1] { val2 };
RebuildTintMaterials();
florpReady = true;
Debug.Log((object)"[FlorpifySkulls] Florp loaded successfully!");
}
}
internal enum HandPreset
{
Original,
Improved
}
internal sealed class PluginConfiguratorUI
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static OnClick <>9__47_0;
public static OnClick <>9__47_1;
public static BoolValueChangeEventDelegate <>9__47_4;
public static BoolValueChangeEventDelegate <>9__47_6;
public static FloatValueChangeEventDelegate <>9__47_8;
public static FloatValueChangeEventDelegate <>9__47_9;
public static FloatValueChangeEventDelegate <>9__47_10;
public static FloatValueChangeEventDelegate <>9__47_11;
public static BoolValueChangeEventDelegate <>9__47_12;
public static FloatValueChangeEventDelegate <>9__47_14;
public static EnumValueChangeEventDelegate<FlorpGod.RotateAxis> <>9__47_15;
public static EnumValueChangeEventDelegate<FlorpGod.GodModeTarget> <>9__47_16;
public static BoolValueChangeEventDelegate <>9__47_17;
internal void <Setup>b__47_0()
{
Application.OpenURL(SUGGEST_FEATURES_URL);
}
internal void <Setup>b__47_1()
{
Application.OpenURL(REPORT_ISSUE_URL);
}
internal void <Setup>b__47_4(BoolValueChangeEvent e)
{
FlorpGod.FloatEnabled = e.value;
}
internal void <Setup>b__47_6(BoolValueChangeEvent e)
{
FlorpGod.BobEnabled = e.value;
}
internal void <Setup>b__47_8(FloatValueChangeEvent e)
{
FlorpGod.FloatHeight = e.value;
}
internal void <Setup>b__47_9(FloatValueChangeEvent e)
{
FlorpGod.FloatSpeed = e.value;
}
internal void <Setup>b__47_10(FloatValueChangeEvent e)
{
FlorpGod.BobAmount = e.value;
}
internal void <Setup>b__47_11(FloatValueChangeEvent e)
{
FlorpGod.BobSpeed = e.value;
}
internal void <Setup>b__47_12(BoolValueChangeEvent e)
{
FlorpGod.RotateEnabled = e.value;
}
internal void <Setup>b__47_14(FloatValueChangeEvent e)
{
FlorpGod.RotateSpeed = e.value;
}
internal void <Setup>b__47_15(EnumValueChangeEvent<FlorpGod.RotateAxis> e)
{
FlorpGod.RotateAxisMode = e.value;
}
internal void <Setup>b__47_16(EnumValueChangeEvent<FlorpGod.GodModeTarget> e)
{
FlorpGod.TargetMode = e.value;
}
internal void <Setup>b__47_17(BoolValueChangeEvent e)
{
FlorpGod.HideFxWhenHeld = e.value;
}
}
private readonly bool enabledDefault;
private readonly bool lowQualityDefault;
private readonly bool godModeDefault;
private PluginConfigurator pluginConfig;
private BoolField enabledField;
private BoolField optimizeField;
private BoolField godModeField;
private ConfigDivision tweaksDivision;
private ConfigDivision godModeDivision;
private FloatField floatHeightField;
private FloatField floatSpeedField;
private FloatField bobAmountField;
private FloatField bobSpeedField;
private BoolField floatToggleField;
private ConfigDivision floatDivision;
private ConfigPanel floatSettingsPanel;
private BoolField bobToggleField;
private ConfigDivision bobDivision;
private BoolField rotateField;
private ConfigDivision rotateDivision;
private FloatField rotateSpeedField;
private EnumField<FlorpGod.RotateAxis> rotateAxisField;
private ConfigHeader enabledForHeader;
private EnumField<FlorpGod.GodModeTarget> enabledForField;
private BoolField hideFxHeldField;
private ConfigPanel modelSettingsPanel;
private ConfigHeader handHeader;
private ConfigHeader colorHeader;
private EnumField<HandPreset> handPresetField;
private ColorField redColorField;
private ColorField blueColorField;
private static readonly Vector3 ORIGINAL_HELD_POS = new Vector3(-0.23f, -0.05f, 0.03f);
private static readonly Vector3 ORIGINAL_HELD_ROT = new Vector3(14f, 58f, 120f);
private static readonly float ORIGINAL_HELD_SCALE = 2.7f;
private static readonly Vector3 IMPROVED_HELD_POS = new Vector3(-0.23f, 0.03f, -0.02f);
private static readonly Vector3 IMPROVED_HELD_ROT = new Vector3(11f, 21f, 96f);
private static readonly float IMPROVED_HELD_SCALE = 2.5f;
private static readonly string SUGGEST_FEATURES_URL = "https://forms.gle/9wBdwnXJkwK1xT1F9";
private static readonly string REPORT_ISSUE_URL = "https://github.com/Silentsmi1e/FlorpifySkulls/issues/new";
private static readonly string ICON_URL = "https://raw.githubusercontent.com/Silentsmi1e/FlorpifySkulls/refs/heads/main/SilentSmilee-FlorpifySkulls-1.0.3/icon.png";
public bool IsEnabled
{
get
{
if (enabledField == null)
{
return enabledDefault;
}
return enabledField.value;
}
}
public bool IsOptimizeEnabled
{
get
{
if (optimizeField == null)
{
return lowQualityDefault;
}
return optimizeField.value;
}
}
public bool IsGodModeEnabled
{
get
{
if (godModeField == null)
{
return godModeDefault;
}
return godModeField.value;
}
}
public PluginConfiguratorUI(bool enabledDefault, bool lowQualityDefault, bool godModeDefault)
{
this.enabledDefault = enabledDefault;
this.lowQualityDefault = lowQualityDefault;
this.godModeDefault = godModeDefault;
}
public void Setup()
{
//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_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Expected O, but got Unknown
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Expected O, but got Unknown
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Expected O, but got Unknown
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Expected O, but got Unknown
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Expected O, but got Unknown
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Expected O, but got Unknown
//IL_022e: Unknown result type (might be due to invalid IL or missing references)
//IL_0238: Expected O, but got Unknown
//IL_024e: Unknown result type (might be due to invalid IL or missing references)
//IL_0258: Expected O, but got Unknown
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Expected O, but got Unknown
//IL_029e: Unknown result type (might be due to invalid IL or missing references)
//IL_02a8: Expected O, but got Unknown
//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: Expected O, but got Unknown
//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
//IL_02f3: Expected O, but got Unknown
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_031d: Expected O, but got Unknown
//IL_033d: Unknown result type (might be due to invalid IL or missing references)
//IL_0347: Expected O, but got Unknown
//IL_035d: Unknown result type (might be due to invalid IL or missing references)
//IL_0367: Expected O, but got Unknown
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Expected O, but got Unknown
//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
//IL_03b7: Expected O, but got Unknown
//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
//IL_03e7: Expected O, but got Unknown
//IL_0407: Unknown result type (might be due to invalid IL or missing references)
//IL_0411: Expected O, but got Unknown
//IL_0431: Unknown result type (might be due to invalid IL or missing references)
//IL_043b: Expected O, but got Unknown
//IL_0381: Unknown result type (might be due to invalid IL or missing references)
//IL_0386: Unknown result type (might be due to invalid IL or missing references)
//IL_038c: Expected O, but got Unknown
//IL_0455: Unknown result type (might be due to invalid IL or missing references)
//IL_045a: Unknown result type (might be due to invalid IL or missing references)
//IL_0460: Expected O, but got Unknown
//IL_047f: Unknown result type (might be due to invalid IL or missing references)
//IL_0484: Unknown result type (might be due to invalid IL or missing references)
//IL_048a: Expected O, but got Unknown
//IL_04a9: Unknown result type (might be due to invalid IL or missing references)
//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
//IL_04b4: Expected O, but got Unknown
//IL_0539: Unknown result type (might be due to invalid IL or missing references)
//IL_0543: Expected O, but got Unknown
//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
//IL_04de: Expected O, but got Unknown
//IL_0589: Unknown result type (might be due to invalid IL or missing references)
//IL_0593: Expected O, but got Unknown
//IL_05b9: Unknown result type (might be due to invalid IL or missing references)
//IL_05c3: Expected O, but got Unknown
//IL_05e3: Unknown result type (might be due to invalid IL or missing references)
//IL_05ed: Expected O, but got Unknown
//IL_055d: Unknown result type (might be due to invalid IL or missing references)
//IL_0562: Unknown result type (might be due to invalid IL or missing references)
//IL_0568: Expected O, but got Unknown
//IL_0607: Unknown result type (might be due to invalid IL or missing references)
//IL_060c: Unknown result type (might be due to invalid IL or missing references)
//IL_0612: Expected O, but got Unknown
//IL_068f: Unknown result type (might be due to invalid IL or missing references)
//IL_0699: Expected O, but got Unknown
//IL_06b3: Unknown result type (might be due to invalid IL or missing references)
//IL_072d: Unknown result type (might be due to invalid IL or missing references)
//IL_0737: Expected O, but got Unknown
//IL_077e: Unknown result type (might be due to invalid IL or missing references)
//IL_079b: Unknown result type (might be due to invalid IL or missing references)
//IL_07a5: Expected O, but got Unknown
//IL_07b6: Unknown result type (might be due to invalid IL or missing references)
//IL_07c0: Expected O, but got Unknown
//IL_07ce: Unknown result type (might be due to invalid IL or missing references)
//IL_07d8: Expected O, but got Unknown
//IL_07ff: Unknown result type (might be due to invalid IL or missing references)
//IL_085b: Unknown result type (might be due to invalid IL or missing references)
//IL_0865: Expected O, but got Unknown
//IL_088c: Unknown result type (might be due to invalid IL or missing references)
//IL_08a7: Unknown result type (might be due to invalid IL or missing references)
//IL_08ac: Unknown result type (might be due to invalid IL or missing references)
//IL_08b6: Expected O, but got Unknown
//IL_08d6: Unknown result type (might be due to invalid IL or missing references)
//IL_08e0: Expected O, but got Unknown
//IL_08f1: Unknown result type (might be due to invalid IL or missing references)
//IL_08f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0900: Expected O, but got Unknown
//IL_0920: Unknown result type (might be due to invalid IL or missing references)
//IL_092a: Expected O, but got Unknown
//IL_0937: Unknown result type (might be due to invalid IL or missing references)
//IL_0941: Expected O, but got Unknown
//IL_094e: Unknown result type (might be due to invalid IL or missing references)
//IL_0958: Expected O, but got Unknown
//IL_0965: Unknown result type (might be due to invalid IL or missing references)
//IL_096f: Expected O, but got Unknown
//IL_097c: Unknown result type (might be due to invalid IL or missing references)
//IL_0986: Expected O, but got Unknown
//IL_0751: Unknown result type (might be due to invalid IL or missing references)
//IL_0756: Unknown result type (might be due to invalid IL or missing references)
//IL_075c: Expected O, but got Unknown
pluginConfig = PluginConfigurator.Create("Florpify Skulls", "com.silentsmilee.florpifyskulls");
pluginConfig.SetIconWithURL(ICON_URL);
ButtonArrayField val = new ButtonArrayField(pluginConfig.rootPanel, "top_links", 2, new float[2] { 0.5f, 0.5f }, new string[2] { "Suggest Features", "Report Issue" }, 8f)
{
buttonHeight = 70f
};
val.SetTextSize(0, 28);
val.SetTextSize(1, 28);
ButtonClickEvent obj = val.OnClickEventHandler(0);
object obj2 = <>c.<>9__47_0;
if (obj2 == null)
{
OnClick val2 = delegate
{
Application.OpenURL(SUGGEST_FEATURES_URL);
};
<>c.<>9__47_0 = val2;
obj2 = (object)val2;
}
obj.onClick += (OnClick)obj2;
ButtonClickEvent obj3 = val.OnClickEventHandler(1);
object obj4 = <>c.<>9__47_1;
if (obj4 == null)
{
OnClick val3 = delegate
{
Application.OpenURL(REPORT_ISSUE_URL);
};
<>c.<>9__47_1 = val3;
obj4 = (object)val3;
}
obj3.onClick += (OnClick)obj4;
new ConfigHeader(pluginConfig.rootPanel, "Main", 36)
{
textSize = 36,
textColor = new Color(0.35f, 0.7f, 1f, 1f)
};
enabledField = new BoolField(pluginConfig.rootPanel, "Enabled", "enabled", enabledDefault);
tweaksDivision = new ConfigDivision(pluginConfig.rootPanel, "florp_tweaks");
((ConfigField)tweaksDivision).hidden = !enabledField.value;
enabledField.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)tweaksDivision).hidden = !e.value;
};
new ConfigHeader((ConfigPanel)(object)tweaksDivision, "Florp Tweaks", 24)
{
textSize = 24,
textColor = new Color(0.75f, 0.9f, 1f, 1f)
};
godModeField = new BoolField((ConfigPanel)(object)tweaksDivision, "Florp God Mode", "godmode_enabled", godModeDefault);
godModeDivision = new ConfigDivision((ConfigPanel)(object)tweaksDivision, "godmode_settings");
((ConfigField)godModeDivision).hidden = !godModeField.value;
godModeField.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)godModeDivision).hidden = !e.value;
};
floatToggleField = new BoolField((ConfigPanel)(object)godModeDivision, "Float", "float_toggle", FlorpGod.FloatEnabled);
BoolField obj5 = floatToggleField;
object obj6 = <>c.<>9__47_4;
if (obj6 == null)
{
BoolValueChangeEventDelegate val4 = delegate(BoolValueChangeEvent e)
{
FlorpGod.FloatEnabled = e.value;
};
<>c.<>9__47_4 = val4;
obj6 = (object)val4;
}
obj5.onValueChange += (BoolValueChangeEventDelegate)obj6;
FlorpGod.FloatEnabled = floatToggleField.value;
floatDivision = new ConfigDivision((ConfigPanel)(object)godModeDivision, "float_settings");
((ConfigField)floatDivision).hidden = !floatToggleField.value;
floatToggleField.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)floatDivision).hidden = !e.value;
};
floatSettingsPanel = new ConfigPanel((ConfigPanel)(object)floatDivision, "Open Settings", "float_settings_panel");
floatHeightField = new FloatField(floatSettingsPanel, "Float Height", "float_height", FlorpGod.FloatHeight, 0f, 10f);
floatSpeedField = new FloatField(floatSettingsPanel, "Float Speed", "float_speed", FlorpGod.FloatSpeed, 0f, 20f);
bobToggleField = new BoolField(floatSettingsPanel, "Bob", "bob_toggle", FlorpGod.BobEnabled);
BoolField obj7 = bobToggleField;
object obj8 = <>c.<>9__47_6;
if (obj8 == null)
{
BoolValueChangeEventDelegate val5 = delegate(BoolValueChangeEvent e)
{
FlorpGod.BobEnabled = e.value;
};
<>c.<>9__47_6 = val5;
obj8 = (object)val5;
}
obj7.onValueChange += (BoolValueChangeEventDelegate)obj8;
FlorpGod.BobEnabled = bobToggleField.value;
bobDivision = new ConfigDivision(floatSettingsPanel, "bob_settings");
((ConfigField)bobDivision).hidden = !bobToggleField.value;
bobToggleField.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)bobDivision).hidden = !e.value;
};
bobAmountField = new FloatField((ConfigPanel)(object)bobDivision, "Bob Amount", "bob_amount", FlorpGod.BobAmount, 0f, 1f);
bobSpeedField = new FloatField((ConfigPanel)(object)bobDivision, "Bob Speed", "bob_speed", FlorpGod.BobSpeed, 0f, 10f);
FloatField obj9 = floatHeightField;
object obj10 = <>c.<>9__47_8;
if (obj10 == null)
{
FloatValueChangeEventDelegate val6 = delegate(FloatValueChangeEvent e)
{
FlorpGod.FloatHeight = e.value;
};
<>c.<>9__47_8 = val6;
obj10 = (object)val6;
}
obj9.onValueChange += (FloatValueChangeEventDelegate)obj10;
FloatField obj11 = floatSpeedField;
object obj12 = <>c.<>9__47_9;
if (obj12 == null)
{
FloatValueChangeEventDelegate val7 = delegate(FloatValueChangeEvent e)
{
FlorpGod.FloatSpeed = e.value;
};
<>c.<>9__47_9 = val7;
obj12 = (object)val7;
}
obj11.onValueChange += (FloatValueChangeEventDelegate)obj12;
FloatField obj13 = bobAmountField;
object obj14 = <>c.<>9__47_10;
if (obj14 == null)
{
FloatValueChangeEventDelegate val8 = delegate(FloatValueChangeEvent e)
{
FlorpGod.BobAmount = e.value;
};
<>c.<>9__47_10 = val8;
obj14 = (object)val8;
}
obj13.onValueChange += (FloatValueChangeEventDelegate)obj14;
FloatField obj15 = bobSpeedField;
object obj16 = <>c.<>9__47_11;
if (obj16 == null)
{
FloatValueChangeEventDelegate val9 = delegate(FloatValueChangeEvent e)
{
FlorpGod.BobSpeed = e.value;
};
<>c.<>9__47_11 = val9;
obj16 = (object)val9;
}
obj15.onValueChange += (FloatValueChangeEventDelegate)obj16;
FlorpGod.FloatHeight = floatHeightField.value;
FlorpGod.FloatSpeed = floatSpeedField.value;
FlorpGod.BobAmount = bobAmountField.value;
FlorpGod.BobSpeed = bobSpeedField.value;
rotateField = new BoolField(floatSettingsPanel, "Rotate", "rotate_enabled", FlorpGod.RotateEnabled);
BoolField obj17 = rotateField;
object obj18 = <>c.<>9__47_12;
if (obj18 == null)
{
BoolValueChangeEventDelegate val10 = delegate(BoolValueChangeEvent e)
{
FlorpGod.RotateEnabled = e.value;
};
<>c.<>9__47_12 = val10;
obj18 = (object)val10;
}
obj17.onValueChange += (BoolValueChangeEventDelegate)obj18;
FlorpGod.RotateEnabled = rotateField.value;
rotateDivision = new ConfigDivision(floatSettingsPanel, "rotate_settings");
((ConfigField)rotateDivision).hidden = !rotateField.value;
rotateField.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)rotateDivision).hidden = !e.value;
};
rotateSpeedField = new FloatField((ConfigPanel)(object)rotateDivision, "Rotate Speed", "rotate_speed", FlorpGod.RotateSpeed, 0f, 360f);
FloatField obj19 = rotateSpeedField;
object obj20 = <>c.<>9__47_14;
if (obj20 == null)
{
FloatValueChangeEventDelegate val11 = delegate(FloatValueChangeEvent e)
{
FlorpGod.RotateSpeed = e.value;
};
<>c.<>9__47_14 = val11;
obj20 = (object)val11;
}
obj19.onValueChange += (FloatValueChangeEventDelegate)obj20;
FlorpGod.RotateSpeed = rotateSpeedField.value;
rotateAxisField = new EnumField<FlorpGod.RotateAxis>((ConfigPanel)(object)rotateDivision, "Rotate Axis", "rotate_axis", FlorpGod.RotateAxisMode);
rotateAxisField.onValueChange += delegate(EnumValueChangeEvent<FlorpGod.RotateAxis> e)
{
FlorpGod.RotateAxisMode = e.value;
};
FlorpGod.RotateAxisMode = rotateAxisField.value;
enabledForHeader = new ConfigHeader((ConfigPanel)(object)godModeDivision, "Enabled For:", 18);
enabledForHeader.textColor = new Color(0.85f, 0.95f, 1f, 1f);
enabledForField = new EnumField<FlorpGod.GodModeTarget>((ConfigPanel)(object)godModeDivision, "Target", "godmode_target", FlorpGod.TargetMode);
enabledForField.onValueChange += delegate(EnumValueChangeEvent<FlorpGod.GodModeTarget> e)
{
FlorpGod.TargetMode = e.value;
};
FlorpGod.TargetMode = enabledForField.value;
hideFxHeldField = new BoolField((ConfigPanel)(object)godModeDivision, "Hide Effects When Held", "hide_fx_held", FlorpGod.HideFxWhenHeld);
BoolField obj21 = hideFxHeldField;
object obj22 = <>c.<>9__47_17;
if (obj22 == null)
{
BoolValueChangeEventDelegate val12 = delegate(BoolValueChangeEvent e)
{
FlorpGod.HideFxWhenHeld = e.value;
};
<>c.<>9__47_17 = val12;
obj22 = (object)val12;
}
obj21.onValueChange += (BoolValueChangeEventDelegate)obj22;
FlorpGod.HideFxWhenHeld = hideFxHeldField.value;
new ConfigHeader((ConfigPanel)(object)godModeDivision, "--------------------", 18);
optimizeField = new BoolField((ConfigPanel)(object)tweaksDivision, "Low Quality Mode", "optimize", lowQualityDefault);
modelSettingsPanel = new ConfigPanel((ConfigPanel)(object)tweaksDivision, "Florp Model Settings", "florp_model_settings");
handHeader = new ConfigHeader(modelSettingsPanel, "Hand Florp Orientation", 20);
handHeader.textSize = 20;
handHeader.textColor = new Color(0.85f, 0.95f, 1f, 1f);
handPresetField = new EnumField<HandPreset>(modelSettingsPanel, "Hand Preset", "hand_preset", HandPreset.Improved);
handPresetField.onValueChange += delegate(EnumValueChangeEvent<HandPreset> e)
{
ApplyHandPreset(e.value);
};
ApplyHandPreset(handPresetField.value);
colorHeader = new ConfigHeader(modelSettingsPanel, "Florp Colors", 20);
colorHeader.textSize = 20;
colorHeader.textColor = new Color(0.85f, 0.95f, 1f, 1f);
redColorField = new ColorField(modelSettingsPanel, "Red Flrop", "red_tint", FlorpifySkulls.RedTint);
FloatField redIntensityField = new FloatField(modelSettingsPanel, "Red Intensity", "red_tint_intensity", FlorpifySkulls.RedTintIntensity, 0f, 2f);
blueColorField = new ColorField(modelSettingsPanel, "Blue Flrop", "blue_tint", FlorpifySkulls.BlueTint);
FloatField blueIntensityField = new FloatField(modelSettingsPanel, "Blue Intensity", "blue_tint_intensity", FlorpifySkulls.BlueTintIntensity, 0f, 2f);
redColorField.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
FlorpifySkulls.SetRedTint(e.value);
FlorpifySkulls.SetRedTintIntensity(redIntensityField.value);
};
blueColorField.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
FlorpifySkulls.SetBlueTint(e.value);
FlorpifySkulls.SetBlueTintIntensity(blueIntensityField.value);
};
redIntensityField.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
FlorpifySkulls.SetRedTint(redColorField.value);
FlorpifySkulls.SetRedTintIntensity(e.value);
};
blueIntensityField.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
FlorpifySkulls.SetBlueTint(blueColorField.value);
FlorpifySkulls.SetBlueTintIntensity(e.value);
};
}
private void ApplyHandPreset(HandPreset preset)
{
//IL_0026: 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_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_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: 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_0016: Unknown result type (might be due to invalid IL or missing references)
if (preset != 0 && preset == HandPreset.Improved)
{
FlorpifySkulls.HeldPos = IMPROVED_HELD_POS;
FlorpifySkulls.HeldRot = IMPROVED_HELD_ROT;
FlorpifySkulls.HeldScale = IMPROVED_HELD_SCALE;
}
else
{
FlorpifySkulls.HeldPos = ORIGINAL_HELD_POS;
FlorpifySkulls.HeldRot = ORIGINAL_HELD_ROT;
FlorpifySkulls.HeldScale = ORIGINAL_HELD_SCALE;
}
}
}
public static class OBJLoader
{
public static Mesh Parse(string objText)
{
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Expected O, but got Unknown
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
List<Vector3> list = new List<Vector3>();
List<Vector2> list2 = new List<Vector2>();
List<Vector3> list3 = new List<Vector3>();
List<Vector3> list4 = new List<Vector3>();
List<Vector2> list5 = new List<Vector2>();
List<Vector3> list6 = new List<Vector3>();
List<int> list7 = new List<int>();
string[] array = objText.Split('\n');
for (int i = 0; i < array.Length; i++)
{
string text = array[i].Trim();
if (text.Length == 0 || text[0] == '#')
{
continue;
}
string[] array2 = text.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (array2.Length == 0)
{
continue;
}
string text2 = array2[0];
if (text2 == "v" && array2.Length >= 4)
{
list.Add(new Vector3(ParseFloat(array2[1]), ParseFloat(array2[2]), ParseFloat(array2[3])));
}
else if (text2 == "vt" && array2.Length >= 3)
{
list2.Add(new Vector2(ParseFloat(array2[1]), ParseFloat(array2[2])));
}
else if (text2 == "vn" && array2.Length >= 4)
{
list3.Add(new Vector3(ParseFloat(array2[1]), ParseFloat(array2[2]), ParseFloat(array2[3])));
}
else if (text2 == "f" && array2.Length >= 4)
{
int num = array2.Length - 1;
for (int j = 1; j < num - 1; j++)
{
AddFaceVert(array2[1], list, list2, list3, list4, list5, list6, list7);
AddFaceVert(array2[j + 1], list, list2, list3, list4, list5, list6, list7);
AddFaceVert(array2[j + 2], list, list2, list3, list4, list5, list6, list7);
}
}
}
Mesh val = new Mesh();
val.vertices = list4.ToArray();
val.triangles = list7.ToArray();
if (list5.Count == list4.Count)
{
val.uv = list5.ToArray();
}
if (list6.Count == list4.Count)
{
val.normals = list6.ToArray();
}
else
{
NormalSolver.RecalculateNormals(val, 60f);
}
val.RecalculateBounds();
return val;
}
private static float ParseFloat(string s)
{
return float.Parse(s, CultureInfo.InvariantCulture);
}
private static int ParseInt(string s)
{
int num = 0;
foreach (char c in s)
{
if (c < '0' || c > '9')
{
break;
}
num = num * 10 + (c - 48);
}
return num;
}
private static void AddFaceVert(string token, List<Vector3> verts, List<Vector2> uvs, List<Vector3> normals, List<Vector3> finalVerts, List<Vector2> finalUVs, List<Vector3> finalNormals, List<int> tris)
{
//IL_0034: 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)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
string[] array = token.Split('/');
int num = ParseInt(array[0]) - 1;
if (num >= 0 && num < verts.Count)
{
finalVerts.Add(verts[num]);
}
else
{
finalVerts.Add(Vector3.zero);
}
if (array.Length > 1 && array[1].Length > 0)
{
int num2 = ParseInt(array[1]) - 1;
if (num2 >= 0 && num2 < uvs.Count)
{
finalUVs.Add(uvs[num2]);
}
}
if (array.Length > 2 && array[2].Length > 0)
{
int num3 = ParseInt(array[2]) - 1;
if (num3 >= 0 && num3 < normals.Count)
{
finalNormals.Add(normals[num3]);
}
}
tris.Add(finalVerts.Count - 1);
}
}