Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of RareSkeletonRunner v1.0.0
plugins/RareSkeletonMod.dll
Decompiled 2 hours agousing System; using System.Collections; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using Microsoft.CodeAnalysis; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using UnityEngine; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("RareSkeletonMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("RareSkeletonMod")] [assembly: AssemblyTitle("RareSkeletonMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 RareSkeletonMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.custom.rareskeleton", "Rare Skeleton Runner", "1.0.0")] public class RareSkeletonPlugin : BaseUnityPlugin { private ConfigEntry<int> _oneInXChance; private ConfigEntry<float> _checkIntervalSeconds; private ConfigEntry<KeyboardShortcut> _testTriggerKey; private ConfigEntry<float> _runSpeed; private ConfigEntry<float> _animationFPS; private ConfigEntry<float> _spriteScale; private ConfigEntry<bool> _streamerSafeMode; private ConfigEntry<bool> _useAltAudio; private ConfigEntry<float> _riffVolume; private Sprite[] _frames; private Sprite _modIconSprite; private Image _skeletonImage; private RectTransform _rectTransform; private Canvas _canvas; private AudioSource _audioSource; private AudioClip _streamerSafeClip; private AudioClip _primaryRiffClip; private AudioClip _altRiffClip; private float _checkTimer; private float _animTimer; private int _currentFrame; private bool _isRunning; private int _direction = 1; private void Awake() { BindConfigSettings(); string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string text = Path.Combine(directoryName, "skeleton.png"); string path = Path.Combine(directoryName, "icon.png"); if (File.Exists(path)) { _modIconSprite = LoadSingleSprite(path); } if (!File.Exists(text)) { ((BaseUnityPlugin)this).Logger.LogError((object)("[RareSkeleton] Could not find skeleton.png at: " + text)); return; } LoadSpritesheet(text); SetupCanvas(); SetupAudio(directoryName); SetupRiskOfOptions(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[RareSkeleton] Loaded successfully! Watching for skeletons..."); } private void BindConfigSettings() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown _oneInXChance = ((BaseUnityPlugin)this).Config.Bind<int>("Rarity", "OneInXChance", 3600, new ConfigDescription("The 1-in-X chance per check interval that the skeleton will appear (Range: 1 to 1,000,000). Lower = more frequent (e.g., 1 = guaranteed on next check, 60 = ~once a minute, 3600 = ~once an hour).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000000), Array.Empty<object>())); _checkIntervalSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Rarity", "CheckIntervalSeconds", 1f, new ConfigDescription("How often (in seconds) the mod rolls the dice to spawn the skeleton.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 60f), Array.Empty<object>())); _testTriggerKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Controls", "TriggerSkeletonKey", new KeyboardShortcut((KeyCode)289, Array.Empty<KeyCode>()), "Keybind to manually summon the skeleton across your screen at any time."); _runSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Appearance", "RunSpeed", 250f, new ConfigDescription("How fast the skeleton moves across the screen (in pixels per second).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3000f), Array.Empty<object>())); _animationFPS = ((BaseUnityPlugin)this).Config.Bind<float>("Appearance", "AnimationFPS", 24f, new ConfigDescription("Frame rate of the skeleton's running animation.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 60f), Array.Empty<object>())); _spriteScale = ((BaseUnityPlugin)this).Config.Bind<float>("Appearance", "SpriteScale", 4.5f, new ConfigDescription("Size multiplier for the skeleton sprite.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 15f), Array.Empty<object>())); _streamerSafeMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Audio", "StreamerSafeMode", true, "When enabled, plays a built-in, 100% copyright-free synthesized retro riff instead of external audio files."); _useAltAudio = ((BaseUnityPlugin)this).Config.Bind<bool>("Audio", "UseAltAudio", false, "If you have placed an alternative audio file in this mod's files, toggle this on to play it (audio file MUST be named exactly \"alt_riff.mp3\"). It is recommended that you keep the audio length below 5 seconds."); _riffVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "RiffVolume", 0.8f, new ConfigDescription("Volume of the skeleton audio (0.0 = muted, 1.0 = full volume).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); } private void SetupRiskOfOptions() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0065: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0070: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00e1: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown ModSettingsManager.SetModDescription("Adds a rare chance for a skeleton to run across your screen."); if ((Object)(object)_modIconSprite != (Object)null) { ModSettingsManager.SetModIcon(_modIconSprite); } else if (_frames != null && _frames.Length != 0) { ModSettingsManager.SetModIcon(_frames[0]); } ConfigEntry<int> oneInXChance = _oneInXChance; IntFieldConfig val = new IntFieldConfig(); ((NumericFieldConfig<int>)val).Min = 1; ((NumericFieldConfig<int>)val).Max = 1000000; ModSettingsManager.AddOption((BaseOption)new IntFieldOption(oneInXChance, val)); ModSettingsManager.AddOption((BaseOption)new SliderOption(_checkIntervalSeconds, new SliderConfig { min = 0.1f, max = 60f, FormatString = "{0:0.0}s" })); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(_testTriggerKey)); ModSettingsManager.AddOption((BaseOption)new SliderOption(_spriteScale, new SliderConfig { min = 0.5f, max = 15f, FormatString = "{0:0.0}x" })); ModSettingsManager.AddOption((BaseOption)new SliderOption(_runSpeed, new SliderConfig { min = 0f, max = 3000f, FormatString = "{0:0} px/s" })); ModSettingsManager.AddOption((BaseOption)new SliderOption(_animationFPS, new SliderConfig { min = 1f, max = 60f, FormatString = "{0:0} FPS" })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Test Skeleton Run", "Appearance", "Summons the skeleton across your screen right now to preview size and speed.", "Run!", (UnityAction)delegate { if (!_isRunning) { StartSkeletonRun(); } })); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(_streamerSafeMode)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(_useAltAudio)); ModSettingsManager.AddOption((BaseOption)new SliderOption(_riffVolume, new SliderConfig { min = 0f, max = 1f, FormatString = "{0:P0}" })); } private void SetupAudio(string pluginFolder) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown GameObject val = new GameObject("RareSkeletonAudio"); Object.DontDestroyOnLoad((Object)(object)val); _audioSource = val.AddComponent<AudioSource>(); _audioSource.playOnAwake = false; _streamerSafeClip = GenerateStreamerSafeRiff(); string[] array = new string[3] { "riff.mp3", "riff.wav", "riff.ogg" }; foreach (string path in array) { string path2 = Path.Combine(pluginFolder, path); if (File.Exists(path2)) { ((MonoBehaviour)this).StartCoroutine(LoadAudioFile(path2, delegate(AudioClip clip) { _primaryRiffClip = clip; })); break; } } string path3 = Path.Combine(pluginFolder, "alt_riff.mp3"); if (File.Exists(path3)) { ((MonoBehaviour)this).StartCoroutine(LoadAudioFile(path3, delegate(AudioClip clip) { _altRiffClip = clip; })); } } private AudioClip GenerateStreamerSafeRiff() { int num = 44100; float[] array = new float[5] { 146.83f, 196f, 174.61f, 146.83f, 146.83f }; float[] array2 = new float[5] { 0.16f, 0.16f, 0.16f, 0.16f, 0.42f }; float[] array3 = new float[5] { 0.04f, 0.04f, 0.04f, 0.06f, 0.05f }; float num2 = 0f; for (int i = 0; i < array.Length; i++) { num2 += array2[i] + array3[i]; } int num3 = Mathf.CeilToInt(num2 * (float)num); float[] array4 = new float[num3]; int num4 = 0; for (int j = 0; j < array.Length; j++) { int num5 = Mathf.CeilToInt(array2[j] * (float)num); int num6 = Mathf.CeilToInt(array3[j] * (float)num); float num7 = array[j]; for (int k = 0; k < num5 && num4 + k < num3; k++) { float num8 = (float)k / (float)num; float num9 = (float)k / (float)num5; float num10 = Mathf.Min(1f, num9 * 15f) * (1f - num9 * 0.7f); float num11 = Mathf.Sin(MathF.PI * 2f * num7 * num8); float num12 = Mathf.Sin(MathF.PI * 2f * num7 * 2f * num8) * 0.35f; array4[num4 + k] = Mathf.Clamp((num11 + num12) * num10 * 0.45f, -1f, 1f); } num4 += num5 + num6; } AudioClip obj = AudioClip.Create("StreamerSafeRiff", num3, 1, num, false); obj.SetData(array4, 0); return obj; } private IEnumerator LoadAudioFile(string path, Action<AudioClip> onLoaded) { AudioType val = (AudioType)13; string text = Path.GetExtension(path).ToLowerInvariant(); if (text == ".wav") { val = (AudioType)20; } else if (text == ".ogg") { val = (AudioType)14; } string absoluteUri = new Uri(path).AbsoluteUri; UnityWebRequest uwr = UnityWebRequestMultimedia.GetAudioClip(absoluteUri, val); try { yield return uwr.SendWebRequest(); if ((int)uwr.result == 1) { AudioClip content = DownloadHandlerAudioClip.GetContent(uwr); if ((Object)(object)content != (Object)null) { ((Object)content).name = Path.GetFileName(path); onLoaded?.Invoke(content); ((BaseUnityPlugin)this).Logger.LogInfo((object)("[RareSkeleton] Loaded custom audio: " + ((Object)content).name)); } } else { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[RareSkeleton] Failed to load audio at " + path + ": " + uwr.error)); } } finally { ((IDisposable)uwr)?.Dispose(); } } private Sprite LoadSingleSprite(string path) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } private void LoadSpritesheet(string path) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0047: 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_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_0063: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00f8: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); ((Texture)val).filterMode = (FilterMode)0; int num = 4; int num2 = 4; float num3 = (float)((Texture)val).width / (float)num; float num4 = (float)((Texture)val).height / (float)num2; Vector2Int[] array2 = (Vector2Int[])(object)new Vector2Int[14] { new Vector2Int(0, 0), new Vector2Int(1, 0), new Vector2Int(2, 0), new Vector2Int(0, 1), new Vector2Int(1, 1), new Vector2Int(2, 1), new Vector2Int(3, 1), new Vector2Int(0, 2), new Vector2Int(1, 2), new Vector2Int(2, 2), new Vector2Int(3, 2), new Vector2Int(0, 3), new Vector2Int(1, 3), new Vector2Int(2, 3) }; _frames = (Sprite[])(object)new Sprite[array2.Length]; Rect val2 = default(Rect); for (int i = 0; i < array2.Length; i++) { int x = ((Vector2Int)(ref array2[i])).x; int y = ((Vector2Int)(ref array2[i])).y; float num5 = (float)x * num3; float num6 = (float)(num2 - 1 - y) * num4; ((Rect)(ref val2))..ctor(num5, num6, num3, num4); _frames[i] = Sprite.Create(val, val2, new Vector2(0.5f, 0.5f)); } } private void SetupCanvas() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown GameObject val = new GameObject("RareSkeletonCanvas"); Object.DontDestroyOnLoad((Object)(object)val); _canvas = val.AddComponent<Canvas>(); _canvas.renderMode = (RenderMode)0; _canvas.sortingOrder = 32767; GameObject val2 = new GameObject("SkeletonRunner"); val2.transform.SetParent(val.transform, false); _skeletonImage = val2.AddComponent<Image>(); ((Graphic)_skeletonImage).raycastTarget = false; _skeletonImage.sprite = _frames[0]; ((Behaviour)_skeletonImage).enabled = false; _rectTransform = val2.GetComponent<RectTransform>(); UpdateSpriteSize(); } private void UpdateSpriteSize() { //IL_0039: 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_0050: 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_005f: Unknown result type (might be due to invalid IL or missing references) if (_frames != null && _frames.Length != 0 && (Object)(object)_rectTransform != (Object)null) { float value = _spriteScale.Value; RectTransform rectTransform = _rectTransform; Rect rect = _frames[0].rect; float num = ((Rect)(ref rect)).width * value; rect = _frames[0].rect; rectTransform.sizeDelta = new Vector2(num, ((Rect)(ref rect)).height * value); } } private void Update() { //IL_001d: 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) if (_frames == null || (Object)(object)_skeletonImage == (Object)null) { return; } KeyboardShortcut value = _testTriggerKey.Value; if (((KeyboardShortcut)(ref value)).IsDown() && !_isRunning) { StartSkeletonRun(); } if (!_isRunning) { _checkTimer += Time.unscaledDeltaTime; if (_checkTimer >= _checkIntervalSeconds.Value) { _checkTimer = 0f; if (Random.Range(0, _oneInXChance.Value) == 0) { StartSkeletonRun(); } } } else { AnimateAndMove(); } } private void StartSkeletonRun() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) _isRunning = true; _currentFrame = 0; _animTimer = 0f; _skeletonImage.sprite = _frames[0]; ((Behaviour)_skeletonImage).enabled = true; UpdateSpriteSize(); PlaySelectedAudio(); _direction = ((Random.value > 0.5f) ? 1 : (-1)); ((Transform)_rectTransform).localScale = new Vector3((float)_direction, 1f, 1f); float num = (float)Screen.width / 2f; float x = _rectTransform.sizeDelta.x; float num2 = ((_direction == 1) ? (0f - num - x * 0.25f) : (num + x * 0.25f)); float num3 = (float)Screen.height / 2f - _rectTransform.sizeDelta.y / 2f; float num4 = Random.Range(0f - num3, num3); _rectTransform.anchoredPosition = new Vector2(num2, num4); } private void PlaySelectedAudio() { if (!((Object)(object)_audioSource == (Object)null) && !(_riffVolume.Value <= 0f)) { AudioClip val = null; val = (_streamerSafeMode.Value ? _streamerSafeClip : ((_useAltAudio.Value && (Object)(object)_altRiffClip != (Object)null) ? _altRiffClip : ((!((Object)(object)_primaryRiffClip != (Object)null)) ? _streamerSafeClip : _primaryRiffClip))); if ((Object)(object)val != (Object)null) { _audioSource.PlayOneShot(val, _riffVolume.Value); } } } private void AnimateAndMove() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) _animTimer += Time.unscaledDeltaTime; if (_animTimer >= 1f / _animationFPS.Value) { _animTimer = 0f; _currentFrame++; if (_currentFrame >= _frames.Length) { _isRunning = false; ((Behaviour)_skeletonImage).enabled = false; return; } _skeletonImage.sprite = _frames[_currentFrame]; } Vector2 anchoredPosition = _rectTransform.anchoredPosition; anchoredPosition.x += _runSpeed.Value * (float)_direction * Time.unscaledDeltaTime; _rectTransform.anchoredPosition = anchoredPosition; float num = (float)Screen.width / 2f; float x = _rectTransform.sizeDelta.x; if ((_direction == 1 && anchoredPosition.x > num + x) || (_direction == -1 && anchoredPosition.x < 0f - num - x)) { _isRunning = false; ((Behaviour)_skeletonImage).enabled = false; } } } }