using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; 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 DM; using EzECS.Barriers; using FhpSLib.BundleModCore; using HarmonyLib; using Landfall.MonoBatch; using Landfall.TABS; using Landfall.TABS.AI; using Landfall.TABS.AI.Components; using Landfall.TABS.AI.Components.Modifiers; using Landfall.TABS.AI.Components.Tags; using Landfall.TABS.AI.Systems; using Landfall.TABS.GameMode; using Landfall.TABS.GameState; using SLMA; using TFBGames; using TMPro; using Unity.Collections; using Unity.Entities; using Unity.Jobs; using Unity.Mathematics; using UnityEngine; using UnityEngine.Events; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; using rwdseerfd; using rwdseerfd.unity脚本; using rwdseerfd.unity脚本存储文件夹.穆萨罗.圆形着火; using rwdseerfd.unity脚本存储文件夹.穆萨罗.旋风斩; using rwdseerfd.unity脚本存储文件夹.脚本1; using rwdseerfd.unity脚本存储文件夹.黑洞吸引; using rwdseerfd.角色类.恶魔巫师; using rwdseerfd.角色类.检测接口; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Mod name")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("made in SFT by FhpSlime")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3a45c3cf-230c-4310-952f-0887d4266a22")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] public class Item : MonoBehaviour { public enum kind { Weapon, Cloth, Skill, Unit, Projectile, Other } public string name; public kind Kind; } public class 隐藏项判定345t : MonoBehaviour { [CompilerGenerated] private sealed class <解锁项目判定嘻嘻额23>d__12 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 隐藏项判定345t <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <解锁项目判定嘻嘻额23>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(3f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.解锁项目判定(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private SecretUnlock secretUnlock23; public string finalUnlock = "BAjssdsssd"; private ISaveLoaderService Save; public string unlockDescription = "元素召唤师"; public Sprite unlockImage; private AudioSource LoopSource; public AudioClip hitClip; public string iceUnlock = "Aicedfgf"; public string fifirelUnlock = "Bfireasfghd"; public string flelelUnlock = "Cdaswdfef"; public void Start() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown secretUnlock23 = ((Component)this).GetComponent(); secretUnlock23.unlockEvent.AddListener(new UnityAction(启动携程目标解释判断)); unlockImage = UManager.元素法师3124; Save = ServiceLocator.GetService(); } private void 启动携程目标解释判断() { ((MonoBehaviour)this).StartCoroutine(解锁项目判定嘻嘻额23()); } [IteratorStateMachine(typeof(<解锁项目判定嘻嘻额23>d__12))] private IEnumerator 解锁项目判定嘻嘻额23() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <解锁项目判定嘻嘻额23>d__12(0) { <>4__this = this }; } private void 解锁项目判定() { Debug.Log((object)"触发解锁判断前"); if (Save.HasUnlockedSecret(iceUnlock) && Save.HasUnlockedSecret(fifirelUnlock) && Save.HasUnlockedSecret(flelelUnlock)) { Debug.Log((object)"已触发解锁判断"); UnlockSelf(); } } public void UnlockSelf() { if (!Save.HasUnlockedSecret(finalUnlock)) { Save.UnlockSecret(finalUnlock); ServiceLocator.GetService().OpenUnlockPanel(unlockDescription, unlockImage); PlacementUI val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { val.RedrawUI(finalUnlock); } LoopSource.PlayOneShot(hitClip); } } } public static class 添加音乐字典工具 { public static void 添加字典(SongInstance[] 所有音乐资源) { MusicHandler service = ServiceLocator.GetService(); if ((Object)(object)service == (Object)null) { Debug.LogError((object)"添加音乐字典工具: 未找到 MusicHandler 实例"); return; } Dictionary songs = service.m_songs; if (songs == null) { Debug.LogError((object)"添加音乐字典工具: m_songs 字典为空"); return; } foreach (SongInstance val in 所有音乐资源) { if (val == null || string.IsNullOrEmpty(val.songRef)) { Debug.LogWarning((object)"添加音乐字典工具: 跳过无效的音乐实例"); } else if (songs.ContainsKey(val.songRef)) { Debug.LogWarning((object)("添加音乐字典工具: 音乐键 '" + val.songRef + "' 已存在,将被覆盖")); songs[val.songRef] = val; } else { songs.Add(val.songRef, val); Debug.Log((object)("添加音乐字典工具: 已添加音乐 '" + val.songRef + "'")); } } Debug.Log((object)$"添加音乐字典工具: 完成,当前字典共 {songs.Count} 首音乐"); } public static void 添加单首音乐(string 音乐引用键, AudioClip 音频剪辑, SoundEffectInstance 音效配置 = null) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown if (string.IsNullOrEmpty(音乐引用键) || (Object)(object)音频剪辑 == (Object)null) { Debug.LogError((object)"添加音乐字典工具: 音乐引用键或音频剪辑为空"); return; } MusicHandler service = ServiceLocator.GetService(); if ((Object)(object)service == (Object)null) { Debug.LogError((object)"添加音乐字典工具: 未找到 MusicHandler 实例"); return; } SongInstance val = new SongInstance(); val.clip = 音频剪辑; val.songRef = 音乐引用键; val.positionInSong = 0; val.soundEffectInstance = 音效配置 ?? 创建默认音效配置(); service.m_songs[音乐引用键] = val; Debug.Log((object)("添加音乐字典工具: 已添加单首音乐 '" + 音乐引用键 + "'")); } public static void 批量添加音乐(string 音乐基础键名, AudioClip[] 音频剪辑数组) { for (int i = 0; i < 音频剪辑数组.Length; i++) { string 音乐引用键 = $"{音乐基础键名}/Track{i}"; AudioClip val = 音频剪辑数组[i]; if ((Object)(object)val != (Object)null) { 添加单首音乐(音乐引用键, val); } } } private static SoundEffectInstance 创建默认音效配置() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown try { return new SoundEffectInstance(); } catch { Debug.LogWarning((object)"添加音乐字典工具: 无法创建 SoundEffectInstance,将使用 null"); return null; } } public static void 从音效库添加音乐(SoundBank 音效库) { //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown if ((Object)(object)音效库 == (Object)null) { Debug.LogError((object)"添加音乐字典工具: SoundBank 为空"); return; } List list = new List(); SoundBankCategory[] categories = 音效库.Categories; foreach (SoundBankCategory val in categories) { if (val == null || val.soundEffects == null) { continue; } SoundEffectInstance[] soundEffects = val.soundEffects; foreach (SoundEffectInstance val2 in soundEffects) { if (val2 == null || val2.clipTypes == null) { continue; } SoundEffectVariations[] clipTypes = val2.clipTypes; foreach (SoundEffectVariations val3 in clipTypes) { if (val3 == null || val3.clips == null) { continue; } AudioClip[] clips = val3.clips; foreach (AudioClip val4 in clips) { if (!((Object)(object)val4 == (Object)null)) { SongInstance val5 = new SongInstance(); val5.clip = val4; val5.soundEffectInstance = val2; val5.songRef = val.categoryName + "/" + val2.soundRef; val5.positionInSong = 0; list.Add(val5); Debug.Log((object)("从音效库添加: " + val5.songRef)); } } } } } 添加字典(list.ToArray()); } public static bool 音乐是否存在(string 音乐引用键) { MusicHandler service = ServiceLocator.GetService(); if ((Object)(object)service == (Object)null) { return false; } return service.m_songs != null && service.m_songs.ContainsKey(音乐引用键); } public static void 移除音乐(string 音乐引用键) { MusicHandler service = ServiceLocator.GetService(); if (!((Object)(object)service == (Object)null) && service.m_songs != null && service.m_songs.Remove(音乐引用键)) { Debug.Log((object)("添加音乐字典工具: 已移除音乐 '" + 音乐引用键 + "'")); } } public static string[] 获取所有音乐键名() { MusicHandler service = ServiceLocator.GetService(); if ((Object)(object)service == (Object)null || service.m_songs == null) { return new string[0]; } return service.m_songs.Keys.ToArray(); } public static void 打印所有音乐() { MusicHandler service = ServiceLocator.GetService(); if ((Object)(object)service == (Object)null || service.m_songs == null) { Debug.Log((object)"音乐字典为空或未找到 MusicHandler"); return; } Debug.Log((object)$"=== 音乐字典共 {service.m_songs.Count} 首 ==="); foreach (KeyValuePair song in service.m_songs) { string key = song.Key; AudioClip clip = song.Value.clip; Debug.Log((object)("键: " + key + ", Clip: " + ((clip != null) ? ((Object)clip).name : null))); } } } namespace rwdseerfd { public static class asss兵编物体语言存储处 { public static string 蠕虫人上衣 = "warm_sahndd"; public static string 蠕虫人裤子 = "warm_kuai"; public static string 蠕虫人腿刺 = "warm_tuici"; public static string 蠕虫人臂刺 = "warm_bici"; public static string 蠕虫人护腿 = "warm_hutuui"; public static string 蠕虫头 = "warm_hard"; public static void 导入进游戏() { 多国语言部分2r.语言添加(蠕虫人上衣, "蠕虫人上衣#Worm Man Upper#ワームマン上衣#Wurm-Mann-Oberteil#Haut du Homme-Ver#Верхняя часть Червечеловека#Parte Superior de Hombre Gusano#Corpetto Uomo Verme"); 多国语言部分2r.语言添加(蠕虫人裤子, "蠕虫人裤子#Worm Man Pants#ワームマンパンツ#Wurm-Mann-Hose#Pantalon du Homme-Ver#Штаны Червечеловека#Pantalones de Hombre Gusano#Pantaloni Uomo Verme"); 多国语言部分2r.语言添加(蠕虫人腿刺, "蠕虫人腿刺#Worm Man Leg Spikes#ワームマンレッグスパイク#Wurm-Mann-Beinspitzen#Épines de Jambe du Homme-Ver#Шипы на ногах Червечеловека#Púas de Pierna de Hombre Gusano#Spine delle Gambe Uomo Verme"); 多国语言部分2r.语言添加(蠕虫人臂刺, "蠕虫人臂刺#Worm Man Arm Spikes#ワームマンアームスパイク#Wurm-Mann-Armspitzen#Épines de Bras du Homme-Ver#Шипы на руках Червечеловека#Púas de Brazo de Hombre Gusano#Spine delle Braccia Uomo Verme"); 多国语言部分2r.语言添加(蠕虫人护腿, "蠕虫人护腿#Worm Man Leggings#ワームマンレギンス#Wurm-Mann-Gamaschen#Jambieres du Homme-Ver#Поножи Червечеловека#Leotardos de Hombre Gusano#Gambali Uomo Verme"); 多国语言部分2r.语言添加(蠕虫头, "蠕虫头#Worm Head#ワームヘッド#Wurmkopf#Tête de Ver#Голова Червя#Cabeza de Gusano#Testa di Verme"); 多国语言部分2r.语言添加("UNIT_JIANSHENG", "剑圣#Sword Saint#剣聖#Schwertmeister#Maître d'épée#Мастер меча#Maestro de la Espada#Maestro di Spada"); } } internal class bubing { [HarmonyPatch(typeof(HealthHandler))] internal class TakeDamgePatch { [CompilerGenerated] private sealed class d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Unit originalTarget; public Unit damager; public float originalDamage; private float 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: { <>1__state = -1; if ((Object)(object)damager == (Object)null || (Object)(object)damager.data == (Object)null || damager.data.Dead) { return false; } 5__1 = originalDamage * 0.5f; DataHandler data = damager.data; data.health -= 5__1; Debug.Log((object)$"反弹伤害: {5__1}, 目标剩余血量: {damager.data.health}"); if (damager.data.health <= 0f) { damager.data.healthHandler.Die(originalTarget); } if ((Object)(object)UManager.反伤反馈1 != (Object)null) { TeamHolder.AddTeamHolder(Object.Instantiate(UManager.反伤反馈1, ((Component)damager.data.mainRig).transform.position, Quaternion.identity), ((Component)originalTarget).gameObject); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly HashSet processingUnits = new HashSet(); [HarmonyPatch("TakeDamage")] [HarmonyPrefix] public static bool TakeDamage_Prefix(HealthHandler __instance, Unit ___unit, float damage, Unit damager) { if ((Object)(object)___unit == (Object)null) { return true; } int instanceID = ((Object)___unit).GetInstanceID(); if (processingUnits.Contains(instanceID)) { Debug.LogWarning((object)("检测到递归调用,跳过补丁逻辑: " + ((Object)___unit).name)); return true; } processingUnits.Add(instanceID); try { 伤害补丁获取值 componentInChildren = ((Component)___unit).GetComponentInChildren<伤害补丁获取值>(); 护盾脚本 componentInChildren2 = ((Component)___unit).GetComponentInChildren<护盾脚本>(); if ((Object)(object)componentInChildren2 != (Object)null && componentInChildren2.是否启用护盾 && componentInChildren2.护盾值 > 0f) { componentInChildren2.护盾值 -= damage * 0.5f; bool flag = componentInChildren2.护盾值 <= 0f; if (!flag) { Debug.Log((object)$"护盾吸收了伤害,剩余护盾值: {componentInChildren2.护盾值}"); } return flag; } if ((Object)(object)componentInChildren != (Object)null && componentInChildren.是否启用) { return HandleDamagePatch(__instance, ___unit, damage, damager, componentInChildren); } return true; } finally { processingUnits.Remove(instanceID); } } private static bool HandleDamagePatch(HealthHandler __instance, Unit unit, float damage, Unit damager, 伤害补丁获取值 damagePatch) { if (unit.WasDamaged((Rigidbody)null, (Rigidbody)null)) { return false; } unit.WasDamaged(damage); if ((Object)(object)damager != (Object)null) { damager.DealDamage(damage); } float num = damage * damagePatch.伤害补丁乘数; DataHandler data = unit.data; data.health -= num; if (unit.data.health <= 0f) { __instance.Die(damager); return false; } if ((Object)(object)damager != (Object)null && !damager.data.Dead && damagePatch.是否反弹) { ((MonoBehaviour)__instance).StartCoroutine(DelayedDamageReflect(unit, damager, damage)); } return false; } [IteratorStateMachine(typeof(d__3))] private static IEnumerator DelayedDamageReflect(Unit originalTarget, Unit damager, float originalDamage) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { originalTarget = originalTarget, damager = damager, originalDamage = originalDamage }; } [HarmonyPatch("Die", new Type[] { typeof(Unit) })] [HarmonyPrefix] public static bool Die_Prefix(HealthHandler __instance, Unit damager, ref bool __result) { Traverse val = Traverse.Create((object)__instance).Field("unit"); Traverse val2 = Traverse.Create((object)__instance).Field("data"); if (!val.FieldExists() || !val2.FieldExists()) { return true; } Unit value = val.GetValue(); DataHandler value2 = val2.GetValue(); if ((Object)(object)value == (Object)null || (Object)(object)value2 == (Object)null) { return true; } 不死图腾效果123[] componentsInChildren = ((Component)((Component)value).transform.root).GetComponentsInChildren<不死图腾效果123>(); List<不死图腾效果123> list = componentsInChildren.Where((不死图腾效果123 t) => (Object)(object)t != (Object)null && t.是否启用).ToList(); if (list.Count == 0) { return true; } 不死图腾效果123 不死图腾效果124 = list.FirstOrDefault((不死图腾效果123 t) => t.无限执行); if ((Object)(object)不死图腾效果124 != (Object)null) { ExecuteRevival(value2, 不死图腾效果124); __result = false; return false; } 不死图腾效果123 不死图腾效果125 = list.FirstOrDefault((不死图腾效果123 t) => t.执行次数 > 0); if ((Object)(object)不死图腾效果125 != (Object)null) { ExecuteRevival(value2, 不死图腾效果125); 不死图腾效果125.执行次数--; __result = false; return false; } return true; } private static void ExecuteRevival(DataHandler data, 不死图腾效果123 totem) { data.health = data.maxHealth * 0.25f; totem.开启回血携程 = true; totem.播放粒子及音效(); } } [HarmonyPatch(typeof(HealthHandler))] [HarmonyPatch("TakeDamage")] public class HealthHandler_TakeDamage_最小化_Patch { [HarmonyPrefix] public static bool TakeDamage_Prefix(HealthHandler __instance, ref float damage, Unit damager = null, DamageType damageType = 0) { try { if (damage <= 0f) { return true; } 伤害免疫组件_最小化[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<伤害免疫组件_最小化>(); if (componentsInChildren.Length == 0) { return true; } float num = damage; 伤害免疫组件_最小化[] array = componentsInChildren; foreach (伤害免疫组件_最小化 伤害免疫组件_最小化2 in array) { if ((Object)(object)伤害免疫组件_最小化2 != (Object)null && 伤害免疫组件_最小化2.是否启用) { damage = 伤害免疫组件_最小化2.处理伤害(damage, ((object)(DamageType)(ref damageType)).ToString()); if (damage <= 0f) { break; } } } if (damage <= 0f) { Debug.Log((object)("伤害免疫补丁复数伤害:" + damage)); return true; } return true; } catch (Exception ex) { Debug.LogError((object)("伤害免疫补丁错误: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(HealthHandler))] [HarmonyPatch("Die", new Type[] { typeof(Unit) })] public class HealthHandler_Die_简单免疫补丁 { [HarmonyPrefix] public static bool Die_Prefix(HealthHandler __instance, ref bool __result, Unit damager = null) { try { 简单免疫死亡组件 componentInChildren = ((Component)__instance).GetComponentInChildren<简单免疫死亡组件>(); if ((Object)(object)componentInChildren != (Object)null) { Debug.Log((object)"正常免疫"); DataHandler component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if (component.health > 0f) { __result = false; return false; } } return true; } catch (Exception ex) { Debug.LogError((object)("简单免疫死亡补丁错误: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(Effect_IceArrow))] [HarmonyPatch("StandardDeath")] public class Effect_IceArrow_StandardDeath_Patch { [HarmonyPostfix] public static void Postfix(Effect_IceArrow __instance) { try { FieldInfo field = typeof(Effect_IceArrow).GetField("data", BindingFlags.Instance | BindingFlags.NonPublic); if (!(field == null)) { object? value = field.GetValue(__instance); DataHandler val = (DataHandler)((value is DataHandler) ? value : null); if (!((Object)(object)val == (Object)null)) { val.Dead = true; } } } catch (Exception ex) { Debug.LogError((object)("修改冰箭死亡状态时出错: " + ex.Message)); } } } [HarmonyPatch] public class InvincibleSystem { [HarmonyPatch(typeof(HealthHandler), "Die", new Type[] { typeof(Unit) })] [HarmonyPrefix] public static bool Patch_HealthHandler_Die_Unit(HealthHandler __instance) { return CheckInvincible(__instance); } [HarmonyPatch(typeof(HealthHandler), "Die", new Type[] { typeof(bool) })] [HarmonyPrefix] public static bool Patch_HealthHandler_Die_Bool(HealthHandler __instance) { return CheckInvincible(__instance); } [HarmonyPatch(typeof(DataHandler), "set_Dead")] [HarmonyPrefix] public static bool Patch_DataHandler_Dead(DataHandler __instance, bool value) { if (value && HasInvincible((Component)(object)__instance)) { return false; } return true; } private static bool HasInvincible(Component component) { if ((Object)(object)component == (Object)null) { return false; } 黑洞无敌补丁 component2 = component.GetComponent<黑洞无敌补丁>(); if ((Object)(object)component2 != (Object)null) { component2.触发死亡事件(); return true; } return (Object)(object)component2 != (Object)null; } private static bool CheckInvincible(HealthHandler handler) { if (HasInvincible((Component)(object)handler)) { return false; } return true; } } [HarmonyPatch(typeof(DamageOverTimeEffect), "Awake")] public static class DamageOverTimeEffect_Awake_Patch { private static void Postfix(DamageOverTimeEffect __instance) { if ((Object)(object)__instance == (Object)null) { return; } Traverse val = Traverse.Create((object)__instance).Field("unit"); object value = val.GetValue(); Unit val2 = (Unit)((value is Unit) ? value : null); if (!((Object)(object)val2 != (Object)null)) { return; } 恶魔防火标识 component = ((Component)val2).GetComponent<恶魔防火标识>(); if ((Object)(object)component != (Object)null) { string name = ((Object)__instance).name; if (name.Contains("火焰") || name.Contains("Fire") || name.Contains("fire") || name.Contains("燃烧") || name.Contains("Burn")) { Object.Destroy((Object)(object)((Component)((Component)__instance).transform).gameObject); } } } } } [UpdateBefore(typeof(PreUpdateBarrier))] public class 斧王嘲讽ECS : JobComponentSystem { private struct UnitFilter { public EntityArray Entities; [ReadOnly] public SharedComponentDataArray Teams; public ComponentDataArray Positions; public ComponentDataArray PredictedPositions; public ComponentDataArray Ranges; public ComponentDataArray UnitTags; [ReadOnly] public ComponentDataArray<被斧王嘲讽单位> TargetEnemyTag; [ReadOnly] public SubtractiveComponent IsInPool; public readonly int Length; public readonly int GroupIndex; } private struct TargetFilter { public EntityArray Entities; [ReadOnly] public SharedComponentDataArray Teams; public ComponentDataArray Position; [ReadOnly] public ComponentDataArray PredictedPositions; [ReadOnly] public ComponentDataArray TargetPriorities; [ReadOnly] public ComponentDataArray TargetThicknesses; public ComponentDataArray EnemiesTargetingMes; public ComponentDataArray _UnitTag; public ComponentDataArray<斧王专用标签> 单位为斧王; public SubtractiveComponent _IsDead; [ReadOnly] public SubtractiveComponent IsInPool; public readonly int Length; public readonly int GroupIndex; } private struct Job : IJob { public EntityArray UnitEntities; public ComponentDataArray UnitPositions; public ComponentDataArray UnitRanges; [ReadOnly] public EntityArray TargetEntities; [ReadOnly] public ComponentDataArray TargetPositions; [ReadOnly] public ComponentDataArray TargetPriorities; [ReadOnly] public ComponentDataArray TargetThicknesses; public NativeArray TargetsBeingTargetedBy; public Concurrent CommandBuffer; [ReadOnly] public ComponentDataFromEntity HasTargetTag; [ReadOnly] public ComponentDataFromEntity IsTargetTag; [ReadOnly] public SubtractiveComponent IsInPool; public void Execute() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0082: 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_00a3: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_01a8: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < ((EntityArray)(ref UnitEntities)).Length; i++) { Entity val = ((EntityArray)(ref UnitEntities))[i]; PredictedPosition val2 = UnitPositions[i]; Range val3 = UnitRanges[i]; Entity val4 = Entity.Null; int num = -1; float num2 = float.MinValue; float value = 0f; for (int j = 0; j < ((EntityArray)(ref TargetEntities)).Length; j++) { float num3 = math.length(TargetPositions[j].Value - val2.Value); Entity val5 = ((EntityArray)(ref TargetEntities))[j]; float value2 = TargetsBeingTargetedBy[j].Value; float num4 = (0f - num3) / TargetPriorities[j].Value - value2 * val3.AttackRange * 0.05f; if (num4 > num2) { num2 = num4; val4 = val5; num = j; } } if (num > -1) { ((Concurrent)(ref CommandBuffer)).SetComponent(i, val, new AttackThickness { Value = value }); BeingTargetedBy val6 = TargetsBeingTargetedBy[num]; val6.Value += 1f; TargetsBeingTargetedBy[num] = val6; ((Concurrent)(ref CommandBuffer)).SetComponent(i, val, new HasTargetTag { Target = val4 }); ((Concurrent)(ref CommandBuffer)).SetComponent(i, val4, new IsTarget { Targetee = val }); } else { ((Concurrent)(ref CommandBuffer)).SetComponent(i, val, new AttackThickness { Value = 0f }); } } } } [Inject] private UnitFilter m_filter; [Inject] private TargetFilter m_targetFilter; [Inject] private PreUpdateBarrier m_barrier; protected override JobHandle OnUpdate(JobHandle inputDeps) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00c1: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_019f: 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_01a8: 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_01b1: 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_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) ComponentDataFromEntity componentDataFromEntity = ((ComponentSystemBase)this).GetComponentDataFromEntity(true); ComponentDataFromEntity componentDataFromEntity2 = ((ComponentSystemBase)this).GetComponentDataFromEntity(true); ComponentDataFromEntity<斧王专用标签> componentDataFromEntity3 = ((ComponentSystemBase)this).GetComponentDataFromEntity<斧王专用标签>(true); EntityCommandBuffer val = ((BarrierSystem)m_barrier).CreateCommandBuffer(); ComponentGroup val2 = ((ComponentSystemBase)this).ComponentGroups[m_targetFilter.GroupIndex]; ComponentGroup val3 = ((ComponentSystemBase)this).ComponentGroups[m_filter.GroupIndex]; val3.SetFilter(new Team { Value = 0 }); val2.SetFilter(new Team { Value = 0 }); EntityArray entityArray = val3.GetEntityArray(); val3.GetComponentDataArray(); ComponentDataArray componentDataArray = val3.GetComponentDataArray(); ComponentDataArray componentDataArray2 = val3.GetComponentDataArray(); EntityArray entityArray2 = val2.GetEntityArray(); ComponentDataArray componentDataArray3 = val2.GetComponentDataArray(); ComponentDataArray componentDataArray4 = val2.GetComponentDataArray(); ComponentDataArray componentDataArray5 = val2.GetComponentDataArray(); val2.GetComponentDataArray(); val3.ResetFilter(); val3.SetFilter(new Team { Value = 1 }); val2.ResetFilter(); val2.SetFilter(new Team { Value = 1 }); EntityArray entityArray3 = val3.GetEntityArray(); val3.GetComponentDataArray(); ComponentDataArray componentDataArray6 = val3.GetComponentDataArray(); ComponentDataArray componentDataArray7 = val3.GetComponentDataArray(); EntityArray entityArray4 = val2.GetEntityArray(); ComponentDataArray componentDataArray8 = val2.GetComponentDataArray(); ComponentDataArray componentDataArray9 = val2.GetComponentDataArray(); ComponentDataArray componentDataArray10 = val2.GetComponentDataArray(); val2.GetComponentDataArray(); NativeArray targetsBeingTargetedBy = default(NativeArray); targetsBeingTargetedBy..ctor(((EntityArray)(ref entityArray2)).Length, (Allocator)3, (NativeArrayOptions)1); NativeArray targetsBeingTargetedBy2 = default(NativeArray); targetsBeingTargetedBy2..ctor(((EntityArray)(ref entityArray4)).Length, (Allocator)3, (NativeArrayOptions)1); Job job = default(Job); job.UnitEntities = entityArray; job.UnitPositions = componentDataArray2; job.UnitRanges = componentDataArray; job.TargetPositions = componentDataArray8; job.TargetEntities = entityArray4; job.TargetPriorities = componentDataArray9; job.TargetsBeingTargetedBy = targetsBeingTargetedBy2; job.TargetThicknesses = componentDataArray10; job.CommandBuffer = ((EntityCommandBuffer)(ref val)).ToConcurrent(); job.HasTargetTag = componentDataFromEntity; job.IsTargetTag = componentDataFromEntity2; Job job2 = job; job = default(Job); job.UnitEntities = entityArray3; job.UnitPositions = componentDataArray7; job.UnitRanges = componentDataArray6; job.TargetEntities = entityArray2; job.TargetPositions = componentDataArray3; job.TargetPriorities = componentDataArray4; job.TargetsBeingTargetedBy = targetsBeingTargetedBy; job.TargetThicknesses = componentDataArray5; job.CommandBuffer = ((EntityCommandBuffer)(ref val)).ToConcurrent(); job.HasTargetTag = componentDataFromEntity; job.IsTargetTag = componentDataFromEntity2; Job job3 = job; JobHandle val4 = IJobExtensions.Schedule(job2, inputDeps); JobHandle result = IJobExtensions.Schedule(job3, val4); ((JobHandle)(ref val4)).Complete(); ((JobHandle)(ref result)).Complete(); for (int i = 0; i < ((EntityArray)(ref entityArray2)).Length; i++) { ((EntityCommandBuffer)(ref val)).SetComponent(((EntityArray)(ref entityArray2))[i], targetsBeingTargetedBy[i]); } for (int j = 0; j < ((EntityArray)(ref entityArray4)).Length; j++) { ((EntityCommandBuffer)(ref val)).SetComponent(((EntityArray)(ref entityArray4))[j], targetsBeingTargetedBy2[j]); } targetsBeingTargetedBy.Dispose(); targetsBeingTargetedBy2.Dispose(); return result; } } public class 护盾叠加2 : MonoBehaviour { private 护盾脚本[] sdf; public void Start() { sdf = ((Component)((Component)this).transform.root).GetComponentsInChildren<护盾脚本>(); for (int i = 0; i < sdf.Length; i++) { sdf[i].护盾值 += 3000f; } } } public class 召唤脚本12121 : MonoBehaviour { [CompilerGenerated] private sealed class <延迟冰墙生成1212>d__8 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 召唤脚本12121 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <延迟冰墙生成1212>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.冰墙生成1212(<>4__this.gameooo); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit unit; public GameObject gameooo; public int 拍23 = 0; public GameObject ewsa3 = null; private LayerMask 地面层掩码 = LayerMask.op_Implicit(512); public void Start() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); ((Component)this).gameObject.GetComponent().delayedEvent.AddListener(new UnityAction(扎换阿萨)); } private void 扎换阿萨() { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if (拍23 == 0) { 对象位置投射物生成133(gameooo, Random.Range(-300, 300), 90f, Random.Range(-300, 300)); } if (拍23 == 1) { 冲击波生成1112(gameooo); } if (拍23 == 2) { ((MonoBehaviour)this).StartCoroutine(延迟冰墙生成1212()); } if (拍23 == 3) { TeamHolder.AddTeamHolder(Object.Instantiate(gameooo, unit.data.targetData.mainRig.position, Quaternion.identity), ((Component)this).gameObject); } if (拍23 == 4) { TeamHolder.AddTeamHolder(Object.Instantiate(gameooo, ((Component)unit.data.targetData.unit).transform.position, Quaternion.identity), ((Component)this).gameObject); } } private void 对象位置投射物生成133(GameObject gameObject321, float x, float y, float z) { //IL_0022: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) Unit val = unit.data.targetData.unit; Vector3 val2 = val.data.mainRig.position + new Vector3(x, y, z); Quaternion val3 = Quaternion.LookRotation(val.data.mainRig.position - val2); TeamHolder.AddTeamHolder(Object.Instantiate(gameObject321, val2, val3), ((Component)this).gameObject); } private void 冲击波生成1112(GameObject gameObject34545) { //IL_0077: 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_0096: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (unit.data.distanceToTarget <= 25f) { TeamHolder.AddTeamHolder(Object.Instantiate(ewsa3, unit.data.mainRig.position, Quaternion.identity), ((Component)this).gameObject); return; } Quaternion val = Quaternion.LookRotation(unit.data.targetData.unit.data.mainRig.position - unit.data.mainRig.position); GameObject val2 = Object.Instantiate(gameObject34545, unit.data.mainRig.position + ((Component)unit.data.mainRig).transform.forward * 2f, val); GameObject gameObject34546 = ((Component)val2.transform.Find("冲及波455")).gameObject; TeamHolder.AddTeamHolder(val2, ((Component)this).gameObject); } [IteratorStateMachine(typeof(<延迟冰墙生成1212>d__8))] private IEnumerator 延迟冰墙生成1212() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <延迟冰墙生成1212>d__8(0) { <>4__this = this }; } private void 冰墙生成1212(GameObject gameObject321) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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) float distanceToTarget = unit.data.distanceToTarget; int num = (int)distanceToTarget; float 密度间隔 = 4f; Quaternion val = Quaternion.LookRotation(unit.data.targetData.unit.data.mainRig.position - unit.data.mainRig.position); Vector3 eulerAngles = ((Quaternion)(ref val)).eulerAngles; Quaternion val2 = Quaternion.Euler(0f, eulerAngles.y, 0f); GameObject val3 = Object.Instantiate(gameObject321, 获取地面位置34511(), val2); TeamHolder.AddTeamHolder(val3, ((Component)this).gameObject); val3.GetComponentInChildren<冰墙召唤13222>().数量 = num / 4; val3.GetComponentInChildren<冰墙召唤13222>().密度间隔 = 密度间隔; val3.GetComponentInChildren<冰墙召唤13222>().召唤时间间隔 = 0.1f; } private Vector3 获取地面位置34511(float 检测高度 = 30f) { //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) //IL_0017: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0031: 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_003b: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = unit.data.mainRig.position; Vector3 val = position + Vector3.up * 检测高度; float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, LayerMask.op_Implicit(地面层掩码))) { return ((RaycastHit)(ref val2)).point; } return ((Component)this).transform.position; } } public class SimpleBlackHole : MonoBehaviour { [Header("引力设置")] public float attractionForce = 50f; public float attractionRange = 160f; [Header("队伍设置")] public Team myTeam = (Team)0; [Header("物理设置")] public ForceMode forceMode = (ForceMode)5; private List affectedRigidbodies = new List(); private float checkInterval = 3f; private float lastCheckTime; private TeamHolder myTeamHolder; private void Start() { //IL_005a: 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) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) myTeamHolder = ((Component)((Component)this).transform.root).gameObject.GetComponentInChildren(); if ((Object)(object)myTeamHolder != (Object)null) { myTeam = myTeamHolder.team; return; } myTeamHolder = ((Component)this).gameObject.AddComponent(); myTeamHolder.team = myTeam; } private void Update() { if (Time.time - lastCheckTime > checkInterval) { FindRigidbodiesInRange(); lastCheckTime = Time.time; } ApplyAttraction(); } private void FindRigidbodiesInRange() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) affectedRigidbodies.Clear(); Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, attractionRange); Collider[] array2 = array; foreach (Collider val in array2) { Rigidbody attachedRigidbody = val.attachedRigidbody; if ((Object)(object)attachedRigidbody != (Object)null && (Object)(object)attachedRigidbody != (Object)(object)((Component)this).GetComponent() && IsEnemy(attachedRigidbody)) { affectedRigidbodies.Add(attachedRigidbody); } } } private bool IsEnemy(Rigidbody rb) { //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_0081: 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) if (affectedRigidbodies.Contains(rb)) { return false; } TeamHolder componentInChildren = ((Component)((Component)rb).transform.root).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { return componentInChildren.team != myTeam; } Unit componentInChildren2 = ((Component)((Component)rb).transform.root).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null && (Object)(object)componentInChildren2.data != (Object)null) { return componentInChildren2.data.team != myTeam; } return true; } private void ApplyAttraction() { //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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_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_004c: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; foreach (Rigidbody affectedRigidbody in affectedRigidbodies) { if (!((Object)(object)affectedRigidbody == (Object)null)) { Vector3 val = position - affectedRigidbody.position; Vector3 normalized = ((Vector3)(ref val)).normalized; float num = Vector3.Distance(position, affectedRigidbody.position); float num2 = 2f - num / attractionRange; float num3 = attractionForce * num2; affectedRigidbody.AddForce(normalized * num3, forceMode); } } } } public class 熔炉精灵召唤脚本234 : MonoBehaviour { private Unit unit; private bool 判断1 = true; private float 计时器 = 0f; public UnitBlueprint 召唤物123; private LayerMask 地面层掩码 = LayerMask.op_Implicit(512); public void Start() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); ((Component)this).gameObject.GetComponent().delayedEvent.AddListener(new UnityAction(生成事件32)); } public Vector3 获取地面位置(float 检测高度 = 30f) { //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) //IL_0017: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0031: 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_003b: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = unit.data.mainRig.position; Vector3 val = position + Vector3.up * 检测高度; float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, LayerMask.op_Implicit(地面层掩码))) { return ((RaycastHit)(ref val2)).point; } return ((Component)this).transform.position; } private void 召唤开始23(Vector3 补偿位置) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_005a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)unit.data.targetData?.unit == (Object)null) { Debug.LogWarning((object)"目标单位不存在,使用默认朝向"); 召唤物123.Spawn(获取地面位置() + 补偿位置, Quaternion.identity, unit.data.team, 1f, (UnitPoolInfo?)null); } else { 召唤物123.Spawn(获取地面位置() + 补偿位置, 获取面向目标y轴旋转(), unit.data.team, 1f, (UnitPoolInfo?)null); } } private Quaternion 获取面向目标y轴旋转() { //IL_0020: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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) Quaternion val = Quaternion.LookRotation(unit.data.targetData.unit.data.mainRig.position - unit.data.mainRig.position); Vector3 eulerAngles = ((Quaternion)(ref val)).eulerAngles; return Quaternion.Euler(0f, eulerAngles.y, 0f); } private void 生成事件32() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) GameObject val = new GameObject(); val.transform.position = ((Component)unit.data.mainRig).transform.position; val.transform.rotation = 获取面向目标y轴旋转(); try { 召唤开始23(val.transform.right * 10f); 召唤开始23(val.transform.right * -10f); } finally { Object.Destroy((Object)(object)val); } } } public class 隐身技能脚本 : MonoBehaviour { [CompilerGenerated] private sealed class <隐身saassad>d__13 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float invisibilityDuration; public 隐身技能脚本 <>4__this; private SkinnedMeshRenderer[] <>s__1; private int <>s__2; private SkinnedMeshRenderer 5__3; private MeshRenderer[] <>s__4; private int <>s__5; private MeshRenderer 5__6; private MeshRenderer[] <>s__7; private int <>s__8; private MeshRenderer 5__9; private SkinnedMeshRenderer[] <>s__10; private int <>s__11; private SkinnedMeshRenderer 5__12; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <隐身saassad>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; 5__3 = null; <>s__4 = null; 5__6 = null; <>s__7 = null; 5__9 = null; <>s__10 = null; 5__12 = null; <>1__state = -2; } private bool MoveNext() { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>s__1 = <>4__this.全部渲染器; for (<>s__2 = 0; <>s__2 < <>s__1.Length; <>s__2++) { 5__3 = <>s__1[<>s__2]; ((Renderer)5__3).enabled = false; 5__3 = null; } <>s__1 = null; <>s__4 = <>4__this.全部表面渲染器; for (<>s__5 = 0; <>s__5 < <>s__4.Length; <>s__5++) { 5__6 = <>s__4[<>s__5]; ((Renderer)5__6).enabled = false; 5__6 = null; } <>s__4 = null; <>4__this.unit.targetingPriorityMultiplier = float.NaN; <>4__this.是否开启 = true; <>2__current = (object)new WaitForSeconds(invisibilityDuration); <>1__state = 1; return true; case 1: <>1__state = -1; <>s__7 = <>4__this.全部表面渲染器; for (<>s__8 = 0; <>s__8 < <>s__7.Length; <>s__8++) { 5__9 = <>s__7[<>s__8]; ((Renderer)5__9).enabled = true; 5__9 = null; } <>s__7 = null; <>s__10 = <>4__this.全部渲染器; for (<>s__11 = 0; <>s__11 < <>s__10.Length; <>s__11++) { 5__12 = <>s__10[<>s__11]; ((Renderer)5__12).enabled = true; 5__12 = null; } <>s__10 = null; <>4__this.unit.targetingPriorityMultiplier = <>4__this.兵种开局优先级; <>4__this.是否开启 = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit unit; private bool 判断1 = true; private float 计时器 = 0f; private float cd1 = 8f; private SkinnedMeshRenderer[] 全部渲染器; private MeshRenderer[] 全部表面渲染器; private float 兵种开局优先级; public bool 是否开启 = false; private 护盾脚本 兵种护盾; public GameObject[] jibnen; private void Start() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); 兵种护盾 = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<护盾脚本>(); 全部渲染器 = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentsInChildren(); 全部表面渲染器 = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentsInChildren(); 兵种开局优先级 = unit.targetingPriorityMultiplier; ((Component)this).gameObject.GetComponent().delayedEvent.AddListener(new UnityAction(开始隐身)); } public void 开始隐身() { 计时器 = 0f; 技能生成(jibnen); ((MonoBehaviour)this).StartCoroutine(隐身saassad()); } public void 技能生成(GameObject[] move23) { //IL_002e: 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) if (move23 == null) { return; } for (int i = 0; i < move23.Length; i++) { if (!((Object)(object)move23[i] == (Object)null)) { GameObject val = Object.Instantiate(move23[i], ((Component)unit).transform.position, ((Component)unit).transform.rotation, ((Component)unit).transform); TeamHolder.AddTeamHolder(move23[i], ((Component)this).gameObject); } } } [IteratorStateMachine(typeof(<隐身saassad>d__13))] private IEnumerator 隐身saassad(float invisibilityDuration = 8f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <隐身saassad>d__13(0) { <>4__this = this, invisibilityDuration = invisibilityDuration }; } private void 兵种回血回盾(float 回血量 = 50f) { if (unit.data.health < unit.data.maxHealth) { DataHandler data = unit.data; data.health += 回血量; } else if (兵种护盾.护盾值 < 4000f) { 兵种护盾.护盾值 += 回血量; } else { DataHandler data2 = unit.data; data2.maxHealth += 回血量; unit.data.health = unit.data.maxHealth; } } private void Update() { if (是否开启) { 计时器 += Time.deltaTime; if ((double)计时器 > 0.1) { 兵种回血回盾(); 计时器 = 0f; } } } } public class 龙卷风效果1322 : MonoBehaviour { [Header("龙卷风参数")] public float pullForce = 40000f; public float upwardForce = 1500f; public float rotationForce = 20500f; public float 扰动力倍数 = 60f; public float maxRadius = 150f; public LayerMask affectedLayers = LayerMask.op_Implicit(-1); [Header("性能设置")] public float checkInterval = 0.3f; public ForceMode forceMode = (ForceMode)5; private TeamHolder 物体队伍342; private List affectedRigidbodies = new List(); private float lastCheckTime; private Team myTeam; private void Start() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) 物体队伍342 = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)物体队伍342 != (Object)null) { myTeam = 物体队伍342.team; return; } 物体队伍342 = ((Component)this).gameObject.AddComponent(); myTeam = (Team)0; 物体队伍342.team = myTeam; } private void Update() { if (Time.time - lastCheckTime > checkInterval) { FindRigidbodiesInRange(); lastCheckTime = Time.time; } ApplyTornadoForces(); } private void FindRigidbodiesInRange() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) affectedRigidbodies.Clear(); Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, maxRadius, LayerMask.op_Implicit(affectedLayers)); Collider[] array2 = array; foreach (Collider val in array2) { Rigidbody attachedRigidbody = val.attachedRigidbody; if ((Object)(object)attachedRigidbody != (Object)null && (Object)(object)attachedRigidbody != (Object)(object)((Component)this).GetComponent() && IsEnemy(attachedRigidbody) && !affectedRigidbodies.Contains(attachedRigidbody)) { affectedRigidbodies.Add(attachedRigidbody); } } } private bool IsEnemy(Rigidbody rb) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Unit componentInChildren = ((Component)((Component)rb).transform.root).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { return componentInChildren.data.team != myTeam; } TeamHolder componentInChildren2 = ((Component)((Component)rb).transform.root).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { return componentInChildren2.team != myTeam; } return true; } private void ApplyTornadoForces() { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0096: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00c4: 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_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) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //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_0193: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; foreach (Rigidbody affectedRigidbody in affectedRigidbodies) { if ((Object)(object)affectedRigidbody == (Object)null) { continue; } Vector3 val = position - affectedRigidbody.position; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < maxRadius && magnitude > 0.1f) { float num = 1f - magnitude / maxRadius; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(((Vector3)(ref val)).normalized, Vector3.up); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; Vector3 zero = Vector3.zero; float num2 = Time.deltaTime * Time.timeScale; zero += normalized * pullForce * num * num2; zero += Vector3.up * upwardForce * num * num2; zero += normalized2 * rotationForce * num * num2; if (扰动力倍数 > 0f) { zero += new Vector3(Random.Range(-1f, 1f), Random.Range(0f, 1f), Random.Range(-1f, 1f)) * num * 扰动力倍数 * num2; } affectedRigidbody.AddForce(zero, (ForceMode)5); } } } private void FixedUpdate() { for (int num = affectedRigidbodies.Count - 1; num >= 0; num--) { if ((Object)(object)affectedRigidbodies[num] == (Object)null) { affectedRigidbodies.RemoveAt(num); } } } private void OnDrawGizmosSelected() { //IL_0001: 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) Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, maxRadius); } } public class 混乱i触底检测 : MonoBehaviour { [CompilerGenerated] private sealed class <运动学关闭开启>d__4 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float delay; public 混乱i触底检测 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <运动学关闭开启>d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.SetAllKinematic(isKinematic: true); <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.SetAllKinematic(isKinematic: false); Debug.Log((object)"运动学已关闭"); Debug.Log((object)"开始删除技能"); Object.Destroy((Object)(object)((Component)<>4__this).gameObject, 1f); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit unit; private float 计时器; private Rigidbody[] childRigidbodies; private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); childRigidbodies = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentsInChildren(); ((MonoBehaviour)this).StartCoroutine(运动学关闭开启(10f)); } [IteratorStateMachine(typeof(<运动学关闭开启>d__4))] private IEnumerator 运动学关闭开启(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <运动学关闭开启>d__4(0) { <>4__this = this, delay = delay }; } private void SetAllKinematic(bool isKinematic) { Rigidbody[] array = childRigidbodies; foreach (Rigidbody val in array) { if ((Object)(object)val != (Object)null) { val.isKinematic = isKinematic; } } } private void Update() { //IL_004f: 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) 计时器 += Time.deltaTime; if ((double)计时器 > 0.1) { unit.data.TouchGround(((Component)unit.data.targetData.unit).transform.position, ((Component)unit.data.targetData.unit).transform.position, (Rigidbody)null); 计时器 = 0f; } } } public class 护盾开启关闭音效控制 : MonoBehaviour { public float rotationSpeed = 30f; private 护盾脚本 护盾脚本12; private float 当前护盾值; private float 上一帧护盾值; private PlaySoundEffect 关闭音效; private PlaySoundEffect 开启音效; private bool 护盾已开启 = false; private void Start() { 护盾脚本12 = ((Component)((Component)this).transform.root).gameObject.GetComponentInChildren<护盾脚本>(); 当前护盾值 = 护盾脚本12.护盾值; 上一帧护盾值 = 当前护盾值; 关闭音效 = ((Component)((Component)this).transform.Find("guanbui")).gameObject.GetComponent(); 开启音效 = ((Component)((Component)this).transform.Find("kaiqi")).gameObject.GetComponent(); if (当前护盾值 > 0f && !护盾已开启) { 开启音效.Go(); 护盾已开启 = true; } else if (当前护盾值 <= 0f && 护盾已开启) { 关闭音效.Go(); 护盾已开启 = false; } } private void Update() { 当前护盾值 = 护盾脚本12.护盾值; if (上一帧护盾值 > 0f && 当前护盾值 <= 0f && 护盾已开启) { 关闭音效.Go(); 护盾已开启 = false; } else if (上一帧护盾值 <= 0f && 当前护盾值 > 0f && !护盾已开启) { 开启音效.Go(); 护盾已开启 = true; } 上一帧护盾值 = 当前护盾值; } } public class 实例化子物体 : MonoBehaviour { [Header("子物体设置")] public GameObject childPrefab; private void Start() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)childPrefab != (Object)null) { GameObject val = Object.Instantiate(childPrefab); val.transform.SetParent(((Component)this).transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one; } else { Debug.LogWarning((object)"未指定要实例化的预制体!", (Object)(object)this); } } } public class 粒子系统队伍色渲染 : MonoBehaviour { private Unit unit; public ParticleSystem targetParticleSystem; public Material 红队伍色 = UManager.asset1.LoadAsset("发光红234"); public Material 蓝队伍色 = UManager.asset1.LoadAsset("发光蓝234"); private void Start() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); targetParticleSystem = ((Component)this).GetComponent(); if ((int)unit.data.team == 0) { 修改渲染材质(红队伍色); } else { 修改渲染材质(蓝队伍色); } } public void 修改渲染材质(Material newMaterial) { if ((Object)(object)targetParticleSystem == (Object)null) { Debug.LogWarning((object)"目标粒子系统未分配!"); return; } ParticleSystemRenderer component = ((Component)targetParticleSystem).GetComponent(); if ((Object)(object)component == (Object)null) { Debug.LogWarning((object)"粒子系统没有渲染器组件!"); return; } ((Renderer)component).material = newMaterial; Debug.Log((object)("渲染材质已更改为: " + (((Object)(object)newMaterial != (Object)null) ? ((Object)newMaterial).name : "空"))); } } public class 红蓝队伍粒子色 : MonoBehaviour { private Unit unit; public ParticleSystem targetParticleSystem; public Material 红队伍色 = UManager.asset1.LoadAsset("发光红234"); public Material 蓝队伍色 = UManager.asset1.LoadAsset("发光蓝234"); public void Start() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); targetParticleSystem = ((Component)this).GetComponent(); if ((int)unit.data.team == 0) { ChangeTrailMaterial(红队伍色); } else { ChangeTrailMaterial(蓝队伍色); } } public void ChangeTrailMaterial(Material newMaterial) { if ((Object)(object)targetParticleSystem == (Object)null) { Debug.LogWarning((object)"目标粒子系统未分配!"); return; } ParticleSystemRenderer component = ((Component)targetParticleSystem).GetComponent(); if ((Object)(object)component == (Object)null) { Debug.LogWarning((object)"粒子系统没有渲染器组件!"); return; } component.trailMaterial = newMaterial; Debug.Log((object)("拖尾材质已更改为: " + (((Object)(object)newMaterial != (Object)null) ? ((Object)newMaterial).name : "空"))); } } public class 闪避留下残影342 : MonoBehaviour { [CompilerGenerated] private sealed class <激活残影2>d__7 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 闪避留下残影342 <>4__this; private GameObject <爆炸物体>5__1; private int 5__2; private SkinnedMeshRenderer <蒙皮渲染器>5__3; private GameObject <残影1>5__4; private MeshRenderer <残影网格渲染>5__5; private MeshFilter <残影网格>5__6; private Mesh 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <激活残影2>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <爆炸物体>5__1 = null; <蒙皮渲染器>5__3 = null; <残影1>5__4 = null; <残影网格渲染>5__5 = null; <残影网格>5__6 = null; 5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_00a2: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Invalid comparison between Unknown and I4 //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (<>4__this.所有蒙皮网格 == null) { <>4__this.所有蒙皮网格 = ((Component)((Component)<>4__this).transform.root).gameObject.GetComponentsInChildren(); } 5__2 = 0; while (5__2 < <>4__this.所有蒙皮网格.Length) { <蒙皮渲染器>5__3 = <>4__this.所有蒙皮网格[5__2]; <残影1>5__4 = new GameObject(); <残影1>5__4.transform.position = ((Component)<蒙皮渲染器>5__3).transform.position; <残影1>5__4.transform.rotation = ((Component)<蒙皮渲染器>5__3).transform.rotation; <残影1>5__4.AddComponent<抖动后删除>(); <残影网格渲染>5__5 = <残影1>5__4.AddComponent(); <残影网格>5__6 = <残影1>5__4.AddComponent(); 5__7 = new Mesh(); <>4__this.所有蒙皮网格[5__2].BakeMesh(5__7); <残影网格>5__6.mesh = 5__7; if ((int)<>4__this.unit.data.team == 0) { ((Renderer)<残影网格渲染>5__5).material = <>4__this.红色发光材质12; } else { ((Renderer)<残影网格渲染>5__5).material = <>4__this.蓝色发光材质12; } <蒙皮渲染器>5__3 = null; <残影1>5__4 = null; <残影网格渲染>5__5 = null; <残影网格>5__6 = null; 5__7 = null; 5__2++; } <爆炸物体>5__1 = Object.Instantiate(<>4__this.辅助爆破, <>4__this.unit.data.mainRig.position, Quaternion.identity); TeamHolder.AddTeamHolder(<爆炸物体>5__1, ((Component)<>4__this).gameObject); <爆炸物体>5__1.AddComponent(); <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit unit; private SkinnedMeshRenderer[] 所有蒙皮网格; public Material 蓝色发光材质12 = UManager.蓝色发光材质; public Material 红色发光材质12 = UManager.红色发光材质; public GameObject 辅助爆破 = UManager.asset1.LoadAsset("残影辅助爆炸无234"); private void Start() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); ((Component)this).GetComponent().delayedEvent.AddListener(new UnityAction(启用携程工具)); if ((Object)(object)蓝色发光材质12 == (Object)null) { Debug.LogWarning((object)"未找到材质!"); } } public void 启用携程工具() { ((MonoBehaviour)this).StartCoroutine(激活残影2()); } [IteratorStateMachine(typeof(<激活残影2>d__7))] private IEnumerator 激活残影2() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <激活残影2>d__7(0) { <>4__this = this }; } } public class n秒后移除物体并生成爆炸 : MonoBehaviour { [CompilerGenerated] private sealed class <开始删除生成>d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public n秒后移除物体并生成爆炸 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <开始删除生成>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.cd); <>1__state = 1; return true; case 1: <>1__state = -1; TeamHolder.AddTeamHolder(Object.Instantiate(<>4__this.exp1, ((Component)<>4__this).gameObject.transform.position, Quaternion.identity), ((Component)<>4__this).gameObject); Object.Destroy((Object)(object)((Component)<>4__this).gameObject); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public GameObject exp1 = UManager.asset1.LoadAsset("残影爆炸324"); public float cd = 1.3f; public void Start() { ((MonoBehaviour)this).StartCoroutine(开始删除生成()); } [IteratorStateMachine(typeof(<开始删除生成>d__3))] private IEnumerator 开始删除生成() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <开始删除生成>d__3(0) { <>4__this = this }; } } public class 抖动后删除 : MonoBehaviour { [Header("抖动设置")] public float shakeDuration = 1.3f; public float maxShakeIntensity = 0.1f; private Vector3 originalPosition; private float shakeTimer = 0f; private bool isShaking = false; private void Start() { //IL_0008: 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) originalPosition = ((Component)this).transform.position; StartShaking(); } private void Update() { if (isShaking) { ShakeEffect(); } } public void StartShaking() { //IL_0008: 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) originalPosition = ((Component)this).transform.position; shakeTimer = 0f; isShaking = true; } private void ShakeEffect() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (shakeTimer < shakeDuration) { shakeTimer += Time.deltaTime; float num = shakeTimer / shakeDuration; float num2 = Mathf.Lerp(0f, maxShakeIntensity, num); float num3 = Random.Range(0f - num2, num2); float num4 = Random.Range(0f - num2, num2); float num5 = Random.Range(0f - num2, num2); ((Component)this).transform.position = originalPosition + new Vector3(num3, num4, num5); } else { ((Component)this).transform.position = originalPosition; Object.Destroy((Object)(object)((Component)this).gameObject); } } public void StopAndDestroy() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) isShaking = false; ((Component)this).transform.position = originalPosition; Object.Destroy((Object)(object)((Component)this).gameObject); } } public class 火焰免疫 : MonoBehaviour { private Unit unit; public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); } public void Update() { if (Object.op_Implicit((Object)(object)((Component)unit).GetComponentInChildren())) { DataHandler data = unit.data; data.health += 200f; Object.Destroy((Object)(object)((Component)((Component)unit).GetComponentInChildren()).gameObject); } } } public class 转换234让3 : MonoBehaviour { [CompilerGenerated] private sealed class d__15 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 转换234让3 <>4__this; private UnitBlueprint 5__1; private GameObject 5__2; private Rigidbody[] 5__3; private Rigidbody[] 5__4; private int 5__5; private int 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) if (<>1__state != 0) { return false; } <>1__state = -1; 5__1 = Object.Instantiate(<>4__this.unit.unitBlueprint); 5__1.Mount = null; s.SetField(5__1, "Riders", (object)new UnitBlueprint[0]); 5__1.TargetingComponent = (ITargetingComponent)(object)default(EnemyLeastWeightTargeting); 5__1.UnitBase = <>4__this.unitbase; 5__1.RightWeapon = null; 5__1.LeftWeapon = null; UnitBlueprint obj = 5__1; obj.movementSpeedMuiltiplier *= 1.7f; 5__1.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2] { UManager.公用蠕虫咬2, (GameObject)SLMALoader.SDic["moves"]["Vampire_Jump"] }; 5__2 = 5__1.Spawn(<>4__this.unit.data.mainRig.position + Vector3.up * 1000f, <>4__this.unit.data.mainRig.rotation, <>4__this.队伍转换器(<>4__this.unit.Team), 1f, (UnitPoolInfo?)null)[0]; 5__3 = <>4__this.unit.data.allRigs.AllRigs; 5__4 = 5__2.GetComponent().data.allRigs.AllRigs; ((Component)<>4__this.unit).GetComponentsInChildren(); 5__2.transform.localScale = ((Component)<>4__this.unit).transform.localScale; for (5__6 = 0; 5__6 < 5__4.Length; 5__6 = 5__5 + 1) { ((Component)5__4[5__6]).transform.localScale = ((Component)5__3[5__6]).transform.localScale; ((Component)5__4[5__6]).transform.position = ((Component)5__3[5__6]).transform.position; ((Component)5__4[5__6]).transform.rotation = ((Component)5__3[5__6]).transform.rotation; 5__4[5__6].velocity = 5__3[5__6].velocity; 5__5 = 5__6; } Object.Destroy((Object)(object)((Component)<>4__this.unit).gameObject); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <召唤蠕虫巨人>d__18 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 转换234让3 <>4__this; private GameObject 5__1; private Rigidbody[] 5__2; private Rigidbody[] 5__3; private int 5__4; private int 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <召唤蠕虫巨人>d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //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_0048: 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_0067: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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_01cc: Unknown result type (might be due to invalid IL or missing references) if (<>1__state != 0) { return false; } <>1__state = -1; 5__1 = <>4__this.蠕虫巨人.Spawn(<>4__this.unit.data.mainRig.position + Vector3.up * 1000f, <>4__this.unit.data.mainRig.rotation, <>4__this.队伍转换器(<>4__this.unit.Team), 1f, (UnitPoolInfo?)null)[0]; 5__2 = <>4__this.unit.data.allRigs.AllRigs; 5__3 = 5__1.GetComponent().data.allRigs.AllRigs; ((Component)<>4__this.unit).GetComponentsInChildren(); 5__1.transform.localScale = ((Component)<>4__this.unit).transform.localScale; for (5__5 = 0; 5__5 < 5__3.Length; 5__5 = 5__4 + 1) { ((Component)5__3[5__5]).transform.localScale = ((Component)5__2[5__5]).transform.localScale; ((Component)5__3[5__5]).transform.position = ((Component)5__2[5__5]).transform.position; ((Component)5__3[5__5]).transform.rotation = ((Component)5__2[5__5]).transform.rotation; 5__3[5__5].velocity = 5__2[5__5].velocity; 5__4 = 5__5; } Object.Destroy((Object)(object)((Component)<>4__this.unit).gameObject); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <按照血量召唤蠕虫>d__16 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 转换234让3 <>4__this; private int 5__1; private Rigidbody[] 5__2; private int 5__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <按照血量召唤蠕虫>d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) if (<>1__state != 0) { return false; } <>1__state = -1; 5__1 = (int)<>4__this.unit.data.maxHealth / 700; if (5__1 < 1) { 5__1 = 0; } if (5__1 > 6) { 5__1 = 6; } for (5__3 = 0; 5__3 <= 5__1; 5__3++) { <>4__this.召唤蠕虫.Spawn(<>4__this.unit.data.mainRig.position, Quaternion.identity, <>4__this.队伍转换器(<>4__this.unit.Team), 1.3f, (UnitPoolInfo?)null); } 5__2 = <>4__this.unit.data.allRigs.AllRigs; for (5__4 = 0; 5__4 < 5__2.Length; 5__4++) { TeamHolder.AddTeamHolder(Object.Instantiate(<>4__this.召唤蠕虫时生成爆炸, 5__2[5__4].position, Quaternion.identity), ((Component)<>4__this).gameObject); } Object.Destroy((Object)(object)((Component)<>4__this.unit).gameObject); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit unit; private bool 判断1 = true; private bool 判断2 = true; private bool 判断3 = true; private float 计时器 = 0f; public UnitBlueprint unitSpawn; private Team team = (Team)1; private UnitBlueprint ttblueprint; public UnitBlueprint 蠕虫巨人; public GameObject unitbase; public GameObject 召唤蠕虫时生成爆炸; public UnitBlueprint 召唤蠕虫; public GameObject move3123; private static readonly List 骷髅 = new List { (GameObject)SLMALoader.SDic["bases"]["Humanoid"] }; private static readonly List 巨人 = new List { (GameObject)SLMALoader.SDic["bases"]["IceGiant"] }; public Team 队伍转换器(Team originalTeam) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Invalid comparison between Unknown and I4 //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_000d: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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) Team result = (Team)0; if ((int)originalTeam == 1) { result = (Team)0; } else if ((int)originalTeam == 0) { result = (Team)1; } return result; } public void Start() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Invalid comparison between Unknown and I4 //IL_005b: 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) unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); unitSpawn = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren().unitBlueprint; if ((int)unit.Team == 0) { team = (Team)1; } if ((int)unit.Team == 1) { team = (Team)0; } } [IteratorStateMachine(typeof(d__15))] public IEnumerator kiazhaidsfj() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<按照血量召唤蠕虫>d__16))] public IEnumerator 按照血量召唤蠕虫() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <按照血量召唤蠕虫>d__16(0) { <>4__this = this }; } public void Update() { if (!unit.data.Dead || !判断1) { return; } 计时器 += Time.deltaTime; if (计时器 > 1.8f && 判断2) { ((Component)((Component)this).gameObject.transform.Find("penshe3")).gameObject.SetActive(true); 判断2 = false; } if (计时器 > 3f && 判断3) { if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.unitBlueprint.UnitBase) && 巨人.Contains(unit.unitBlueprint.UnitBase)) { ((MonoBehaviour)this).StartCoroutine(召唤蠕虫巨人()); } if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.unitBlueprint.UnitBase) && 骷髅.Contains(unit.unitBlueprint.UnitBase)) { ((MonoBehaviour)this).StartCoroutine(kiazhaidsfj()); } else { ((MonoBehaviour)this).StartCoroutine(按照血量召唤蠕虫()); } } } [IteratorStateMachine(typeof(<召唤蠕虫巨人>d__18))] public IEnumerator 召唤蠕虫巨人() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <召唤蠕虫巨人>d__18(0) { <>4__this = this }; } } public class 转换234让3增强版 : MonoBehaviour { [CompilerGenerated] private sealed class <召唤蠕虫人>d__11 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 转换234让3增强版 <>4__this; private GameObject 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <召唤蠕虫人>d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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) if (<>1__state != 0) { return false; } <>1__state = -1; 5__1 = <>4__this.ttblueprint.Spawn(<>4__this.unit.data.mainRig.position, <>4__this.unit.data.mainRig.rotation, <>4__this.队伍转换器(<>4__this.unit.Team), 1f, (UnitPoolInfo?)null)[0]; Object.Destroy((Object)(object)((Component)<>4__this.unit).gameObject); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit unit; private bool 判断1 = true; private bool 判断2 = true; private bool 判断3 = true; private float 计时器 = 0f; public UnitBlueprint unitSpawn; private Team team = (Team)1; public UnitBlueprint ttblueprint; public GameObject unitbase; public GameObject move; private static readonly List 仅人型 = new List { (GameObject)SLMALoader.SDic["bases"]["Humanoid"] }; public Team 队伍转换器(Team originalTeam) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Invalid comparison between Unknown and I4 //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_000d: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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) Team result = (Team)0; if ((int)originalTeam == 1) { result = (Team)0; } else if ((int)originalTeam == 0) { result = (Team)1; } return result; } [IteratorStateMachine(typeof(<召唤蠕虫人>d__11))] public IEnumerator 召唤蠕虫人() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <召唤蠕虫人>d__11(0) { <>4__this = this }; } public void Start() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Invalid comparison between Unknown and I4 //IL_005b: 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) unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); unitSpawn = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren().unitBlueprint; if ((int)unit.Team == 0) { team = (Team)1; } if ((int)unit.Team == 1) { team = (Team)0; } } public void Update() { //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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) if (!unit.data.Dead || !判断1) { return; } 计时器 += Time.deltaTime; if (计时器 > 0.8f && 判断2) { ((Component)((Component)this).gameObject.transform.Find("penshe3")).gameObject.SetActive(true); 判断2 = false; } if (计时器 > 2f && 判断3) { if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.unitBlueprint.UnitBase) && 仅人型.Contains(unit.unitBlueprint.UnitBase)) { ((MonoBehaviour)this).StartCoroutine(召唤蠕虫人()); 判断3 = false; } else { ttblueprint.Spawn(unit.data.mainRig.position, unit.data.mainRig.rotation, 队伍转换器(unit.Team), 1f, (UnitPoolInfo?)null); Object.Destroy((Object)(object)((Component)unit).gameObject); } } } } public class ScenesManager12 : MonoBehaviour { public ScenesManager12() { SceneManager.sceneLoaded += SceneLoaded; } public void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Expected O, but got Unknown //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Expected O, but got Unknown //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Expected O, but got Unknown //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Expected O, but got Unknown if (((Scene)(ref scene)).name == "05_Sandbox_Medieval_VC") { GameObject val = new GameObject(); ((Object)val).name = "darkifgsd3"; val.transform.position = new Vector3(-104.2145f, 62.12671f, 24.6887f); GameObject val2 = Object.Instantiate(UManager.隐藏物体3, val.transform); if (Object.op_Implicit((Object)(object)val2)) { Debug.Log((object)"32432243"); } else { Debug.LogError((object)"没有找到资源4让包32432243"); } } if (((Scene)(ref scene)).name == "00_Lvl1_Halloween_VC") { GameObject val3 = new GameObject(); ((Object)val3).name = "ufhoefw"; val3.transform.position = new Vector3(-13.439f, -10.027f, 4.063f); GameObject val4 = Object.Instantiate(UManager.黑骑士隐藏物体213, val3.transform); } if (((Scene)(ref scene)).name == "01_Lvl1_Tribal_VC") { GameObject val5 = new GameObject(); ((Object)val5).name = "huo423"; GameObject val6 = Object.Instantiate(UManager.火元素隐藏物体, val5.transform); } if (((Scene)(ref scene)).name == "04_Sandbox_Viking_VC") { GameObject val7 = new GameObject(); ((Object)val7).name = "bing343"; GameObject val8 = Object.Instantiate(UManager.冰元素隐藏物体, val7.transform); } if (((Scene)(ref scene)).name == "08_Lvl1_Pirate_VC") { GameObject val9 = new GameObject(); ((Object)val9).name = "lei3rs"; GameObject val10 = Object.Instantiate(UManager.雷元素隐藏物体, val9.transform); } if (((Scene)(ref scene)).name == "01_Lvl2_Tribal_VC") { GameObject val11 = new GameObject(); ((Object)val11).name = "斧王的隐藏物体"; GameObject val12 = Object.Instantiate(UManager.asset1.LoadAsset("斧王枷锁32"), val11.transform); } if (((Scene)(ref scene)).name == "01_Sandbox_Tribal_01_VC") { GameObject val13 = new GameObject(); ((Object)val13).name = "剑圣隐藏物体1212145"; GameObject val14 = Object.Instantiate(UManager.asset1.LoadAsset("剑圣隐藏物体"), val13.transform); } if (((Scene)(ref scene)).name == "05_Sandbox_Medieval_VC") { GameObject val15 = new GameObject(); ((Object)val15).name = "雷龙隐藏物体"; GameObject val16 = Object.Instantiate(UManager.asset1.LoadAsset("雷龙隐藏siha"), val15.transform); } if (((Scene)(ref scene)).name == "07_lvl1_Renaissance_VC") { GameObject val17 = new GameObject(); ((Object)val17).name = "黑洞隐藏物体"; GameObject val18 = Object.Instantiate(UManager.asset1.LoadAsset("黑洞隐藏物体"), val17.transform); } if (((Scene)(ref scene)).name == "09_Lvl1_Fantasy_Evil_VC") { GameObject val19 = new GameObject(); ((Object)val19).name = "卫兹南www隐藏物体"; GameObject val20 = Object.Instantiate(UManager.asset1.LoadAsset("卫兹南隐藏物品23"), val19.transform); } if (((Scene)(ref scene)).name == "02_Lvl1_Farmer_VC") { GameObject val21 = new GameObject(); ((Object)val21).name = "毒液佣兵隐藏物品"; GameObject val22 = Object.Instantiate(UManager.asset1.LoadAsset("毒液佣兵隐藏"), val21.transform); } } } [BepInPlugin("rwdseerfd", "rwdseerfd", "1.0.0")] internal class Loader : BaseUnityPlugin { [CompilerGenerated] private sealed class d__2 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Loader <>4__this; private GameObject 5__1; private 音乐替换工具单例 5__2; private LandfallContentDatabase 5__3; private UnitBlueprint[] 5__4; private int 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => (Object)(object)Object.FindObjectOfType() != (Object)null)); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => ServiceLocator.GetService() != null)); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(0.3f); <>1__state = 3; return true; case 3: <>1__state = -1; SLMALoader.GetInstance(); 5__1 = new GameObject("SecretUnlock314sdfjwe"); Object.DontDestroyOnLoad((Object)(object)5__1); 5__1.AddComponent(); 5__2 = 音乐替换工具单例.实例; ((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"隐藏兵种内容加载完毕!!"); 5__3 = ContentDatabase.Instance().LandfallContentDatabase; UManager.Init(5__3); ((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"主要内容加载完毕!!"); new Harmony(UManager.modname).PatchAll(); GOSLMA.EditWeapons = ((GOSLMA.EditWeapons == null) ? new Action(UManager.EditWeapons) : ((Action)Delegate.Combine(new Action(UManager.EditWeapons), GOSLMA.EditWeapons))); ((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"武器内容加载完毕!!"); GOSLMA.EditClothes = ((GOSLMA.EditClothes == null) ? new Action(UManager.EditClothes) : ((Action)Delegate.Combine(new Action(UManager.EditClothes), GOSLMA.EditClothes))); ((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"服饰部分加载完毕!!"); GOSLMA.EditCombatMoves = ((GOSLMA.EditCombatMoves == null) ? new Action(UManager.EditCombatMoves) : ((Action)Delegate.Combine(new Action(UManager.EditCombatMoves), GOSLMA.EditCombatMoves))); ((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"技能部分加载完毕!!"); GOSLMA.CodeAfterSpawn = ((GOSLMA.CodeAfterSpawn == null) ? new Action(UManager.CodeAfterSpawn) : ((Action)Delegate.Combine(new Action(UManager.CodeAfterSpawn), GOSLMA.CodeAfterSpawn))); GOSLMA.EditProjectiles = ((GOSLMA.EditProjectiles == null) ? new Action(UManager.EditProjectiles) : ((Action)Delegate.Combine(new Action(UManager.EditProjectiles), GOSLMA.EditProjectiles))); 5__4 = Resources.FindObjectsOfTypeAll(); 5__5 = 0; while (5__5 < 5__4.Length) { UManager.EditBlueprint(5__4[5__5], 5__3); 5__5++; } Debug.Log((object)("Loaded " + UManager.modname + " Successfully")); Debug.Log((object)(UManager.modname + "is made in SFT by FhpSlime")); Debug.Log((object)(UManager.modder + "wished you a pleasant trip")); ((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"已加载模组全部内容祝您游玩愉快!!!!!"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static GameObject Unlockruaa; private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"不死图腾插件加载中..."); Harmony.CreateAndPatchAll(typeof(bubing), (string)null); ((BaseUnityPlugin)this).Logger.LogInfo((object)"不死图腾插件加载完成!"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"开始加载mod内容"); ((MonoBehaviour)this).StartCoroutine("call"); } [IteratorStateMachine(typeof(d__2))] private IEnumerator call() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { <>4__this = this }; } } public class MyModItems : MonoBehaviour { private static Dictionary items; private static MyModItems instance { get; set; } public static MyModItems GetInstance() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)instance == (Object)null) { instance = new GameObject("MyModItems").AddComponent(); Object.DontDestroyOnLoad((Object)(object)instance); } return instance; } public void AddItem(Item item) { items.Add(item.name, item); } public Item GetItem(string name) { Item value = new Item { name = null, Kind = Item.kind.Other }; items.TryGetValue(name, out value); return value; } } public static class UManager { public static class 编辑器1 { public static void 设置兵编分类(GameObject item, string categoryName = "蠕虫人", TagType tagType = 0) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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) CharacterItem componentInChildren = item.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.tags = new List { new Tag { tagType = tagType, value = categoryName } }; } } public static Sprite 直接设置图标(AssetBundle assetBundle, string assetbundlename = "") { return assetBundle.LoadAsset(assetbundlename); } public static Sprite 设置图标(AssetBundle assetBundle, string assetbundlename = "") { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) Texture2D val = assetBundle.LoadAsset(assetbundlename); ((Texture)val).filterMode = (FilterMode)1; return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } } public static string modname = "rwdseerfd"; public static string modder = "FhpSlime"; private static string com; public static SLMABundleMod bundleMod; public static GameObject 反伤反馈1; public static GameObject 公用蠕虫咬2; public static GameObject 隐藏物体3; public static GameObject 黑骑士隐藏物体213; public static GameObject 火元素隐藏物体; public static GameObject 冰元素隐藏物体; public static GameObject 雷元素隐藏物体; public static Sprite 元素法师3124; public static GameObject 绿色治疗效果; public static Material 蓝色发光材质; public static Material 红色发光材质; public static AssetBundle asset1; public static Material wewewe; public static string 蠕虫人 = "蠕虫人12"; public static void SetRiders(UnitBlueprint me, UnitBlueprint[] riders) { } public static void EditBlueprint(UnitBlueprint unit, LandfallContentDatabase db) { } public static void EditClothes(GameObject cloth, CharacterItem item, PropItemData data, Unit unit, int index, LandfallContentDatabase db) { Debug.Log((object)"Hey"); } public static void EditProjectiles(GameObject proj, ProjectileHit projhit, Unit unit, LandfallContentDatabase db) { } public static void EditCombatMoves(GameObject move, int index, Unit unit, LandfallContentDatabase db) { } public static void CodeAfterSpawn(Unit unit, LandfallContentDatabase db) { } public static void Init(LandfallContentDatabase db) { //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Expected O, but got Unknown //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_07cd: Unknown result type (might be due to invalid IL or missing references) //IL_081f: Unknown result type (might be due to invalid IL or missing references) //IL_082b: Expected O, but got Unknown //IL_08e8: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Expected O, but got Unknown //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_091b: Expected O, but got Unknown //IL_0959: Unknown result type (might be due to invalid IL or missing references) //IL_095f: Unknown result type (might be due to invalid IL or missing references) //IL_0a22: Unknown result type (might be due to invalid IL or missing references) //IL_0a28: Unknown result type (might be due to invalid IL or missing references) //IL_0c2a: Unknown result type (might be due to invalid IL or missing references) //IL_0c36: Expected O, but got Unknown //IL_0d64: Unknown result type (might be due to invalid IL or missing references) //IL_0d7a: Expected O, but got Unknown //IL_15cc: Unknown result type (might be due to invalid IL or missing references) //IL_15e2: Expected O, but got Unknown //IL_1756: Unknown result type (might be due to invalid IL or missing references) //IL_1762: Expected O, but got Unknown //IL_2233: Unknown result type (might be due to invalid IL or missing references) //IL_2249: Expected O, but got Unknown //IL_257b: Unknown result type (might be due to invalid IL or missing references) //IL_2591: Expected O, but got Unknown //IL_295f: Unknown result type (might be due to invalid IL or missing references) //IL_2965: Expected O, but got Unknown //IL_2a00: Unknown result type (might be due to invalid IL or missing references) //IL_2a16: Expected O, but got Unknown //IL_2c16: Unknown result type (might be due to invalid IL or missing references) //IL_2c2c: Expected O, but got Unknown //IL_2d42: Unknown result type (might be due to invalid IL or missing references) //IL_2d58: Expected O, but got Unknown //IL_37c8: Unknown result type (might be due to invalid IL or missing references) //IL_37de: Expected O, but got Unknown //IL_3a79: Unknown result type (might be due to invalid IL or missing references) //IL_3a7f: Expected O, but got Unknown //IL_3b5d: Unknown result type (might be due to invalid IL or missing references) //IL_3bcf: Unknown result type (might be due to invalid IL or missing references) MyModItems.GetInstance(); asss兵编物体语言存储处.导入进游戏(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); if (executingAssembly == null) { Debug.LogError((object)"无法获取当前程序集"); return; } Stream manifestResourceStream = executingAssembly.GetManifestResourceStream("rwdseerfd.fdhee"); if (manifestResourceStream == null) { Debug.LogError((object)"找不到资源流: rwdseerfd.fdhee"); return; } Stream manifestResourceStream2 = executingAssembly.GetManifestResourceStream("rwdseerfd.yinku"); if (manifestResourceStream2 == null) { Debug.LogError((object)"找不到音库流: rwdseerfd.yinku"); return; } AssetBundle val = AssetBundle.LoadFromStream(manifestResourceStream2); if ((Object)(object)val == (Object)null) { Debug.LogError((object)"加载音库AssetBundle失败"); return; } AssetBundle val2 = AssetBundle.LoadFromStream(manifestResourceStream); if ((Object)(object)val2 == (Object)null) { Debug.LogError((object)"加载主AssetBundle失败"); val.Unload(false); return; } asset1 = val2; Material[] array = val2.LoadAllAssets(); if (array == null || array.Length == 0) { Debug.LogWarning((object)"主AssetBundle中没有找到任何材质"); } else { Material[] array2 = array; foreach (Material val3 in array2) { if ((Object)(object)val3 == (Object)null) { Debug.LogWarning((object)"遇到空的材质引用,已跳过"); continue; } if ((Object)(object)val3.shader == (Object)null) { Debug.LogWarning((object)("材质 " + ((Object)val3).name + " 的Shader为空,无法修复")); continue; } Shader val4 = Shader.Find(((Object)val3.shader).name); if ((Object)(object)val4 != (Object)null) { val3.shader = val4; Debug.Log((object)("修复材质: " + ((Object)val3).name + ", Shader: " + ((Object)val4).name)); } else { Debug.LogWarning((object)("找不到Shader: " + ((Object)val3.shader).name + ", 材质: " + ((Object)val3).name)); } } } SoundPlayer service = ServiceLocator.GetService(); if ((Object)(object)service == (Object)null) { Debug.LogError((object)"无法获取SoundPlayer服务"); val2.Unload(false); val.Unload(false); return; } SoundBank soundBank = service.soundBank; if ((Object)(object)soundBank == (Object)null) { Debug.LogError((object)"SoundPlayer中的soundBank为空"); val2.Unload(false); val.Unload(false); return; } SoundBank[] array3 = val2.LoadAllAssets(); if (array3 != null && array3.Length != 0) { List list = soundBank.Categories?.ToList() ?? new List(); SoundBank[] array4 = array3; foreach (SoundBank val5 in array4) { if ((Object)(object)val5 != (Object)null && val5.Categories != null) { list.AddRange(val5.Categories); Debug.Log((object)$"已合并SoundBank: {((Object)val5).name}, 类别数: {val5.Categories.Length}"); } else if ((Object)(object)val5 == (Object)null) { Debug.LogWarning((object)"遇到空的SoundBank引用,已跳过"); } else { Debug.LogWarning((object)("SoundBank " + ((Object)val5).name + " 的Categories为空")); } } soundBank.Categories = list.ToArray(); Debug.Log((object)$"SoundBank合并完成,总类别数: {list.Count}"); } else { Debug.LogWarning((object)"主AssetBundle中没有找到任何SoundBank"); } SoundBank soundBank2 = service.soundBank; if ((Object)(object)soundBank2 == (Object)null) { Debug.LogError((object)"重新获取的soundBank为空"); val2.Unload(false); val.Unload(false); return; } SoundBank[] array5 = val.LoadAllAssets(); if (array5 != null && array5.Length != 0) { List list2 = soundBank2.Categories?.ToList() ?? new List(); SoundBank[] array6 = array5; foreach (SoundBank val6 in array6) { if ((Object)(object)val6 != (Object)null && val6.Categories != null) { list2.AddRange(val6.Categories); Debug.Log((object)$"已合并音库SoundBank: {((Object)val6).name}, 类别数: {val6.Categories.Length}"); } else if ((Object)(object)val6 == (Object)null) { Debug.LogWarning((object)"遇到空的音库SoundBank引用,已跳过"); } else { Debug.LogWarning((object)("音库SoundBank " + ((Object)val6).name + " 的Categories为空")); } } soundBank2.Categories = list2.ToArray(); Debug.Log((object)$"音库SoundBank合并完成,总类别数: {list2.Count}"); } else { Debug.LogWarning((object)"音库AssetBundle中没有找到任何SoundBank"); } 蓝色发光材质 = val2.LoadAsset("发光蓝234"); 红色发光材质 = val2.LoadAsset("发光红234"); GameObject val7 = val.LoadAsset("音乐存储资源werfwef"); SongInstance[] ddddd = val7.GetComponent<音乐存储>().ddddd; 添加音乐字典工具.添加字典(ddddd); GameObject val8 = UPool.MyPool.AddObject(asss兵编物体语言存储处.蠕虫人上衣, val2.LoadAsset("蠕虫人服饰_上衣34"), true, (HideFlags)52, (Sprite)null, 47315642, true); GameObject val9 = UPool.MyPool.AddObject(asss兵编物体语言存储处.蠕虫人腿刺, val2.LoadAsset("蠕虫腿刺23"), true, (HideFlags)52, (Sprite)null, 47315643, true); GameObject val10 = UPool.MyPool.AddObject(asss兵编物体语言存储处.蠕虫人臂刺, val2.LoadAsset("刺护臂37699"), true, (HideFlags)52, (Sprite)null, 47315644, true); GameObject val11 = UPool.MyPool.AddObject(asss兵编物体语言存储处.蠕虫人护腿, val2.LoadAsset("蠕虫护腿44534"), true, (HideFlags)52, (Sprite)null, 47315645, true); GameObject val12 = UPool.MyPool.AddObject(asss兵编物体语言存储处.蠕虫人裤子, val2.LoadAsset("蠕虫裤子23"), true, (HideFlags)52, (Sprite)null, 47315646, true); GameObject item = UPool.MyPool.AddObject(asss兵编物体语言存储处.蠕虫头, val2.LoadAsset("蠕虫头部43"), true, (HideFlags)52, (Sprite)null, 5694658, true); val2.LoadAsset("转化效果343").AddComponent<转换234让3>(); GameObject val13 = UPool.MyPool.AddObject("蠕虫咬", val2.LoadAsset("蠕虫咬423"), true, (HideFlags)52, (Sprite)null, 47315652, true); GameObject val14 = val2.LoadAsset("蠕虫召唤43"); GameObject unitBase = UPool.MyPool.AddObject("蠕虫23", val2.LoadAsset("蠕虫eerwj"), true, (HideFlags)52, (Sprite)null, 47315647, true); UnitBlueprint val15 = SLMATool.CreateUnit("蠕虫蓝图32", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SUBUNITS_SNAKE"], (Faction)null, (Sprite)null); val15.UnitBase = unitBase; val15.movementSpeedMuiltiplier *= 0.1f; val15.massMultiplier *= 0.1f; GameObject val16 = UPool.MyPool.AddObject("蠕虫武器23", val2.LoadAsset("虫卵发射器32"), true, (HideFlags)52, (Sprite)null, 47315648, true); GameObject objectToSpawn = UPool.MyPool.AddObject("蠕虫武器23投掷", val2.LoadAsset("虫卵123"), true, (HideFlags)52, (Sprite)null, 47315649, true); val14.GetComponentInChildren().unitBlueprint = val15; val16.GetComponentInChildren().ObjectToSpawn = objectToSpawn; ((Weapon)val16.GetComponentInChildren()).internalCooldown = 9f; val15.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { val13 }; Texture2D val17 = val2.LoadAsset("蠕虫人icon"); ((Texture)val17).filterMode = (FilterMode)2; Sprite val18 = Sprite.Create(val17, new Rect(0f, 0f, (float)((Texture)val17).width, (float)((Texture)val17).height), new Vector2(1f, 1f)); GameObject unitBase2 = UPool.MyPool.AddObject("大蠕虫模型234", val2.LoadAsset("蠕虫eer攻击祭祀"), true, (HideFlags)52, (Sprite)null, 47315650, true); UnitBlueprint val19 = SLMATool.CreateUnit(多国语言部分2r.蠕虫的8国语言, (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], val18); val19.targetingPriorityMultiplier *= 0.1f; val19.UnitBase = unitBase2; val19.health = 50f; val19.sizeMultiplier *= 2.3f; val19.movementSpeedMuiltiplier *= 0.1f; val19.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[0]; val19.forceCost = 1000u; GameObject val20 = UPool.MyPool.AddObject("死亡生产蠕虫", val2.LoadAsset("死后爆裂生成蠕虫32"), true, (HideFlags)52, (Sprite)null, 47315651, true); val20.GetComponentInChildren().unitBlueprint = val19; UnitBlueprint val21 = SLMATool.CreateUnit("空单位311446", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SUBUNITS_HORSE_CHARIOT"], (Faction)null, (Sprite)null); val21.UnitBase = (GameObject)SLMALoader.SDic["bases"]["Humanoid"]; val21.health = 100f; val21.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[0]; val21.m_props = (GameObject[])(object)new GameObject[0]; val21.movementSpeedMuiltiplier = 1f; val21.MovementComponents = new List { (IMovementComponent)(object)default(KeepRangedDistance) }; val21.animationMultiplier = 1f; val21.stepMultiplier = 1f; GameObject val22 = UPool.MyPool.AddObject("蠕虫人34模型", val2.LoadAsset("蠕虫人213342"), true, (HideFlags)52, (Sprite)null, 47315641, true); UnitBlueprint val23 = SLMATool.CreateUnit("蠕虫人32", (UnitBlueprint)null, (Faction)null, val18); val23.UnitBase = val22; val23.m_props = (GameObject[])(object)new GameObject[5] { val8, val9, val10, val11, val12 }; val23.sizeMultiplier *= 1.12f; val23.RightWeapon = val16; val23.LeftWeapon = val16; val23.MovementComponents = new List { (IMovementComponent)(object)default(NeverStopRunning) }; val23.health = 500f; val23.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2] { val20, val13 }; GameObject val24 = UPool.MyPool.AddObject("蠕虫咬32", val2.LoadAsset("蠕虫咬423"), true, (HideFlags)61, (Sprite)null, 786346, true); 公用蠕虫咬2 = val24; val2.LoadAsset("转化效果343").AddComponent<转换234让3>().unitbase = val22; val2.LoadAsset("转化效果343").GetComponentInChildren<转换234让3>().召唤蠕虫 = val15; val2.LoadAsset("转化效果343").GetComponentInChildren<转换234让3>().召唤蠕虫时生成爆炸 = val2.LoadAsset("蠕虫转换爆炸45332"); val2.LoadAsset("转化效果增强版2").AddComponent<转换234让3增强版>().ttblueprint = val23; val23.voiceBundle = val2.LoadAsset("rucwe"); s.SetField(val23, "DeathRef", (object)val23.voiceBundle.DeathRef); s.SetField(val23, "VocalRef", (object)val23.voiceBundle.VocalRef); val19.voiceBundle = val2.LoadAsset("rucyinx313"); s.SetField(val19, "DeathRef", (object)val19.voiceBundle.DeathRef); s.SetField(val19, "VocalRef", (object)val19.voiceBundle.VocalRef); val19.Validate(); val23.Validate(); val23.forceCost = 1000u; 隐藏物体3 = val2.LoadAsset("gsdfyrggrtetyt"); val19.Entity.SetUnlockKey("SECRET_RUCHONGRWE"); GameObject unitBase3 = UPool.MyPool.AddObject("蠕虫巨人模型", val2.LoadAsset("蠕虫巨人234"), true, (HideFlags)52, (Sprite)null, 5845728, true); GameObject val25 = UPool.MyPool.AddObject("蠕虫巨人拳", val2.LoadAsset("蠕虫巨人拳45"), true, (HideFlags)52, (Sprite)null, 5845729, true); UnitBlueprint val26 = SLMATool.CreateUnit("蠕虫巨人", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEGIANT"], (Faction)null, (Sprite)null); val26.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { UPool.MyPool.AddObject("蠕虫吐息45", val2.LoadAsset("蠕虫吐息ewe"), true, (HideFlags)52, (Sprite)null, 674783, true) }; val26.UnitBase = unitBase3; val26.RightWeapon = val25; val26.LeftWeapon = val25; val2.LoadAsset("转化效果343").GetComponentInChildren<转换234让3>().蠕虫巨人 = val26; 编辑器1.设置兵编分类(val8, "蠕虫人", (TagType)0); 编辑器1.设置兵编分类(val9, "蠕虫人", (TagType)0); 编辑器1.设置兵编分类(val10, "蠕虫人", (TagType)0); 编辑器1.设置兵编分类(val11, "蠕虫人", (TagType)0); 编辑器1.设置兵编分类(val12, "蠕虫人", (TagType)0); 编辑器1.设置兵编分类(item, "蠕虫人", (TagType)0); GameObject val27 = UPool.MyPool.AddObject("黑骑士模型", val2.LoadAsset("黑骑士模型324"), true, (HideFlags)52, (Sprite)null, 671784, true); GameObject unitBase4 = UPool.MyPool.AddObject("黑骑士模型纯黑", val2.LoadAsset("黑骑士模型纯黑4324"), true, (HideFlags)52, (Sprite)null, 671785, true); UnitBlueprint val28 = SLMATool.CreateUnit(多国语言部分2r.黑骑士的8国语言, (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], 编辑器1.设置图标(val2, "黑骑士icon")); val28.UnitBase = unitBase4; val28.health = 670f; val28.sizeMultiplier = 1.5f; val28.forceCost = 2500u; val28.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[0]; GameObject val29 = UPool.MyPool.AddObject("黑骑士头盔骨架版", val2.LoadAsset("黑骑士头盔骨架版"), true, (HideFlags)52, (Sprite)null, 671786, true); GameObject val30 = UPool.MyPool.AddObject("黑骑士头盔普通版", val2.LoadAsset("法线修复版黑骑士头盔234普通"), true, (HideFlags)52, (Sprite)null, 671787, true); val30.AddComponent<半血红眼>(); val28.m_props = (GameObject[])(object)new GameObject[17] { UPool.MyPool.AddObject("黑骑士下摆", val2.LoadAsset("黑骑士下摆"), true, (HideFlags)52, (Sprite)null, 671788, true), UPool.MyPool.AddObject("黑骑士大腿盔甲", val2.LoadAsset("黑骑士大腿盔甲"), true, (HideFlags)52, (Sprite)null, 671789, true), UPool.MyPool.AddObject("黑骑士大臂甲", val2.LoadAsset("黑骑士大臂甲"), true, (HideFlags)52, (Sprite)null, 671790, true), UPool.MyPool.AddObject("黑骑士小腿盔甲", val2.LoadAsset("黑骑士小腿盔甲"), true, (HideFlags)52, (Sprite)null, 671791, true), UPool.MyPool.AddObject("黑骑士小臂甲", val2.LoadAsset("黑骑士小臂甲"), true, (HideFlags)52, (Sprite)null, 671792, true), UPool.MyPool.AddObject("黑骑士板甲鞋", val2.LoadAsset("黑骑士板甲鞋"), true, (HideFlags)52, (Sprite)null, 671793, true), UPool.MyPool.AddObject("黑骑士皮护颈", val2.LoadAsset("黑骑士皮护颈"), true, (HideFlags)52, (Sprite)null, 671794, true), UPool.MyPool.AddObject("黑骑士肘部盔甲", val2.LoadAsset("黑骑士肘部盔甲"), true, (HideFlags)52, (Sprite)null, 671795, true), UPool.MyPool.AddObject("黑骑士胸甲", val2.LoadAsset("黑骑士胸甲"), true, (HideFlags)52, (Sprite)null, 671796, true), UPool.MyPool.AddObject("黑骑士膝盖盔甲", val2.LoadAsset("黑骑士膝盖盔甲"), true, (HideFlags)52, (Sprite)null, 671797, true), UPool.MyPool.AddObject("黑骑士衬衫", val2.LoadAsset("黑骑士衬衫"), true, (HideFlags)52, (Sprite)null, 671798, true), UPool.MyPool.AddObject("黑骑士装甲手套", val2.LoadAsset("黑骑士装甲手套"), true, (HideFlags)52, (Sprite)null, 671799, true), UPool.MyPool.AddObject("黑骑士裤子", val2.LoadAsset("黑骑士裤子"), true, (HideFlags)52, (Sprite)null, 671800, true), UPool.MyPool.AddObject("黑骑士肩甲", val2.LoadAsset("黑骑士肩甲"), true, (HideFlags)52, (Sprite)null, 671801, true), UPool.MyPool.AddObject("黑骑士大金链子", val2.LoadAsset("黑骑士大金链子"), true, (HideFlags)52, (Sprite)null, 671802, true), val30, UPool.MyPool.AddObject("黑骑士毛皮披风", val2.LoadAsset("黑骑毛坯pifem"), true, (HideFlags)52, (Sprite)null, 671803, true) }; GameObject val31 = UPool.MyPool.AddObject("黑骑士的盾", val2.LoadAsset("黑骑士的盾413"), true, (HideFlags)52, (Sprite)null, 131805, true); GameObject val32 = UPool.MyPool.AddObject("黑骑士单手剑", val2.LoadAsset("黑骑士单手剑34"), true, (HideFlags)52, (Sprite)null, 671804, true); GameObject val33 = UPool.MyPool.AddObject("黑骑士双手剑", val2.LoadAsset("黑骑士双手剑32"), true, (HideFlags)52, (Sprite)null, 671805, true); GameObject val34 = UPool.MyPool.AddObject("黑骑士单手剑普通", val2.LoadAsset("黑骑士单手剑34保守版"), true, (HideFlags)52, (Sprite)null, 671806, true); GameObject val35 = UPool.MyPool.AddObject("黑骑士反伤", val2.LoadAsset("黑骑士反伤3214"), true, (HideFlags)52, (Sprite)null, 671807, true); GameObject val36 = UPool.MyPool.AddObject("黑骑士减伤护盾", val2.LoadAsset("黑骑士的盾34"), true, (HideFlags)52, (Sprite)null, 671808, true); GameObject val37 = UPool.MyPool.AddObject("黑骑士黑雾", val2.LoadAsset("346vsfdsdf"), true, (HideFlags)52, (Sprite)null, 671809, true); GameObject val38 = UPool.MyPool.AddObject("黑骑士半血爆炸", val2.LoadAsset("怒吼爆炸不炸裂瓣234"), true, (HideFlags)52, (Sprite)null, 671810, true); val38.GetComponentInChildren().radius = 10f; val38.GetComponentInChildren().force = 1000f; val38.GetComponentInChildren().damage = 180f; val35.AddComponent<反伤3224>().爆炸 = val38; 反伤反馈1 = val2.LoadAsset("反伤效果324"); ((Component)val36.transform.Find("shiajhdfw")).gameObject.AddComponent<伤害补丁获取值>(); val34.AddComponent<半血附魔>().material = val2.LoadAsset("岩浆材质45"); val34.GetComponentInChildren<半血附魔>().material1 = val2.LoadAsset("jinserting3"); val34.GetComponentInChildren<半血附魔>().material2 = val2.LoadAsset("muse3"); val34.GetComponentInChildren<半血附魔>().material3 = val2.LoadAsset("红眼234"); val34.GetComponentInChildren<半血附魔>().material4 = val2.LoadAsset("深色金属3"); val34.GetComponentInChildren<半血附魔>().effect = val2.LoadAsset("流血效果43"); MeleeWeapon componentInChildren = val34.GetComponentInChildren(); componentInChildren.curveForce *= 1f; val34.GetComponentInChildren().damage = 70f; wewewe = val2.LoadAsset("岩浆材质45"); val28.RightWeapon = val34; val28.LeftWeapon = val34; val28.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[3] { val35, val36, val37 }; val28.massMultiplier *= 12f; s.SetField(val28, "DeathRef", (object)"Legacy Death Vocals/DarkPeasant"); s.SetField(val28, "VocalRef", (object)"Legacy Attack Vocals/DarkPeasant"); s.SetField(val28, "VoicePitch", (object)0.3f); 黑骑士隐藏物体213 = val2.LoadAsset("黑骑士藏品233"); val28.Entity.SetUnlockKey("heiqishiee"); val28.Validate(); GameObject val39 = UPool.MyPool.AddObject("三相之力", val2.LoadAsset("魔法红白机23"), true, (HideFlags)52, (Sprite)null, 3265645, true); val39.AddComponent<元素召唤234>(); GameObject val40 = UPool.MyPool.AddObject("陨石213", val2.LoadAsset("陨石243"), true, (HideFlags)52, (Sprite)null, 3265646, true); val40.AddComponent<无物理弹性>(); GameObject val41 = UPool.MyPool.AddObject("火柱123召唤", val2.LoadAsset("火柱423召唤324"), true, (HideFlags)52, (Sprite)null, 3265647, true); val41.AddComponent<火焰柱召唤23>().exp23 = val2.LoadAsset("火柱423"); val39.GetComponentInChildren<元素召唤234>().无元素材质 = val2.LoadAsset("无元素材质3"); val39.GetComponentInChildren<元素召唤234>().火元素材质 = val2.LoadAsset("火元素材质23"); val39.GetComponentInChildren<元素召唤234>().冰元素材质 = val2.LoadAsset("冰元素材质32"); val39.GetComponentInChildren<元素召唤234>().雷元素材质 = val2.LoadAsset("雷元素材质342"); val2.LoadAsset("电击小子34342").AddComponent<刚体抽搐效果23>(); val39.GetComponentInChildren<元素召唤234>().雷雷雷1 = val2.LoadAsset("雷雷雷43rtw"); val39.GetComponentInChildren<元素召唤234>().火火火1 = val41; ((Component)val2.LoadAsset("龙卷风45").transform.Find("exp121").Find("力场旋转加23")).gameObject.AddComponent().cd = 21f; ((Component)val2.LoadAsset("龙卷风45").transform.Find("exp121").Find("力场旋转加23")).gameObject.AddComponent<龙卷风效果1322>(); val39.GetComponentInChildren<元素召唤234>().冰雷雷1 = val2.LoadAsset("龙卷风45"); val39.GetComponentInChildren<元素召唤234>().雷火火1 = val40; GameObject unitBase5 = UPool.MyPool.AddObject("精灵模型34", val2.LoadAsset("精灵模型234"), true, (HideFlags)52, (Sprite)null, 3265648, true); UnitBlueprint val42 = SLMATool.CreateUnit(多国语言部分2r.元素法师的8国语言, (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], 编辑器1.直接设置图标(val2, "元素法师icon")); val42.UnitBase = unitBase5; val42.health = 1600f; val42.massMultiplier *= 3f; val42.RightWeapon = val39; val42.holdinigWithTwoHands = true; val42.m_props = (GameObject[])(object)new GameObject[0]; GameObject val43 = UPool.MyPool.AddObject("怒吼爆炸1234", val2.LoadAsset("怒吼爆炸21"), true, (HideFlags)52, (Sprite)null, 3265650, true); ((Component)val43.transform.Find("GameObject").Find("Sphere")).gameObject.AddComponent<爆炸材质消散>().explosionDuration = 8f; ((Component)val43.transform.Find("GameObject").Find("怒吼爆炸23")).gameObject.AddComponent<爆炸材质消散>().explosionDuration = 8f; val43.GetComponentInChildren().damage = 2999f; val43.GetComponentInChildren().radius = 15f; GameObject val44 = UPool.MyPool.AddObject("硫磺火元素2435", val2.LoadAsset("硫磺火元素23434"), true, (HideFlags)52, (Sprite)null, 3265651, true); val44.AddComponent<断开Joints连接>().exp34 = val43; val44.AddComponent<火焰免疫>(); GameObject val45 = UPool.MyPool.AddObject("熔炉精灵的拳", val2.LoadAsset("熔炉精灵的拳套3422"), true, (HideFlags)52, (Sprite)null, 3265652, true); UnitBlueprint val46 = SLMATool.CreateUnit("硫磺火元素920", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEGIANT"], (Faction)null, (Sprite)null); val46.UnitBase = val44; val46.m_props = null; val46.objectsToSpawnAsChildren = null; val46.RightWeapon = val45; val46.LeftWeapon = val45; val46.attackSpeedMultiplier *= 3f; val46.health *= 0.5f; val39.GetComponentInChildren<元素召唤234>().冰火火熔炉精灵1 = val46; val39.GetComponentInChildren<元素召唤234>().冰元素求 = val2.LoadAsset("冰元素求4323"); val39.GetComponentInChildren<元素召唤234>().火元素求 = val2.LoadAsset("火元素求312"); val39.GetComponentInChildren<元素召唤234>().雷元素求 = val2.LoadAsset("雷电元素求324"); GameObject val47 = UPool.MyPool.AddObject("冰墙dsfhf", val2.LoadAsset("冰墙dsfhf"), true, (HideFlags)52, (Sprite)null, 3265653, true); val47.AddComponent<兵种ai地面检测>(); val47.AddComponent<位置召唤游戏物体324>().exp = val2.LoadAsset("极冻爆炸3243"); UnitBlueprint val48 = SLMATool.CreateUnit("冰墙", (UnitBlueprint)null, (Faction)null, (Sprite)null); val48.health = 2000f; val48.sizeMultiplier *= 2f; val48.UnitBase = val47; GameObject val49 = UPool.MyPool.AddObject("冰墙摘花34", val2.LoadAsset("极冻珠澳换12"), true, (HideFlags)52, (Sprite)null, 3265654, true); val49.AddComponent<冰墙召唤13222>().无实体短暂冰墙 = val2.LoadAsset("极冻爆炸带刺3io"); val49.GetComponentInChildren<冰墙召唤13222>().有实体冰墙 = val48; val39.GetComponentInChildren<元素召唤234>().冰火冰1 = val49; GameObject val50 = UPool.MyPool.AddObject("精灵躲闪技能", val2.LoadAsset("近战短衫3423"), true, (HideFlags)52, (Sprite)null, 3265655, true); val50.AddComponent<闪避留下残影342>(); val50.AddComponent(); val39.GetComponentInChildren<元素召唤234>().雷雷火1 = (GameObject[])(object)new GameObject[1] { val50 }; UPool.MyPool.AddObject("披肩其23", val2.LoadAsset("披肩其23"), true, (HideFlags)52, (Sprite)null, 3265656, true); UPool.MyPool.AddObject("元素法师披风", val2.LoadAsset("元素法师披风234"), true, (HideFlags)52, (Sprite)null, 3265657, true); GameObject val51 = UPool.MyPool.AddObject("冲击波342", val2.LoadAsset("chonghaoujiefqw"), true, (HideFlags)52, (Sprite)null, 3265658, true); val51.GetComponent().seconds = 10f; val51.AddComponent<冲击波无有伤脚本>(); GameObject 魔法子弹 = UPool.MyPool.AddObject("卢瑟飞弹", val2.LoadAsset("卢瑟飞弹发234"), true, (HideFlags)52, (Sprite)null, 3265659, true); GameObject 冰冰冰 = UPool.MyPool.AddObject("冰冻飞弹", val2.LoadAsset("冷冻飞弹43123"), true, (HideFlags)52, (Sprite)null, 3265660, true); GameObject 连锁雷电球 = UPool.MyPool.AddObject("雷电飞弹234", val2.LoadAsset("雷电飞弹2433"), true, (HideFlags)52, (Sprite)null, 3265661, true); val2.LoadAsset("母体雷电爆炸34").AddComponent<最近单位获取1>(); val2.LoadAsset("母体雷电爆炸34").AddComponent<雷电传播>(); GameObject val52 = UPool.MyPool.AddObject("可视化护盾条1!!", val2.LoadAsset("护盾台哦234"), true, (HideFlags)52, (Sprite)null, 3215681, true); val52.AddComponent<可视化护盾条>(); GameObject val53 = val2.LoadAsset("护盾音效控制器23"); val53.AddComponent<护盾开启关闭音效控制>(); val52.AddComponent<实例化子物体>().childPrefab = val53; val39.GetComponentInChildren<元素召唤234>().连锁雷电球 = 连锁雷电球; val39.GetComponentInChildren<元素召唤234>().冰火雷1 = val51; val39.GetComponentInChildren<元素召唤234>().冰冰冰1 = 冰冰冰; val39.GetComponentInChildren<元素召唤234>().魔法子弹2344 = 魔法子弹; GameObject val54 = UPool.MyPool.AddObject("近距离冲击波q3e", val2.LoadAsset("近距离冲击波q3e"), true, (HideFlags)52, (Sprite)null, 3265662, true); val39.GetComponentInChildren<元素召唤234>().近距离冲击波 = val54; val42.sizeMultiplier *= 1.4f; val39.AddComponent<护盾脚本>(); GameObject val55 = UPool.MyPool.AddObject("混沌陨石!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265663, true); val55.AddComponent<召唤脚本12121>().gameooo = val40; val55.GetComponentInChildren<召唤脚本12121>().拍23 = 0; GameObject val56 = UPool.MyPool.AddObject("阳炎冲击!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265664, true); val56.AddComponent<召唤脚本12121>().gameooo = val41; val56.GetComponentInChildren<召唤脚本12121>().拍23 = 3; GameObject val57 = UPool.MyPool.AddObject("强袭飓风!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265665, true); val57.AddComponent<召唤脚本12121>().gameooo = val2.LoadAsset("龙卷风45"); val57.GetComponentInChildren<召唤脚本12121>().拍23 = 4; GameObject val58 = UPool.MyPool.AddObject("电磁爆!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265666, true); val58.AddComponent<召唤脚本12121>().gameooo = val2.LoadAsset("雷雷雷43rtw"); val58.GetComponentInChildren<召唤脚本12121>().拍23 = 3; GameObject val59 = UPool.MyPool.AddObject("寒冰之墙!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265667, true); val59.AddComponent<召唤脚本12121>().gameooo = val49; val59.GetComponentInChildren<召唤脚本12121>().拍23 = 2; GameObject val60 = UPool.MyPool.AddObject("冲击波!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265668, true); val60.AddComponent<召唤脚本12121>().gameooo = val51; val60.GetComponentInChildren<召唤脚本12121>().拍23 = 1; val60.GetComponentInChildren<召唤脚本12121>().ewsa3 = val54; GameObject val61 = UPool.MyPool.AddObject("3000护盾!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265669, true); val61.AddComponent<护盾脚本>().护盾值 = 3000f; val61.AddComponent<护盾叠加2>(); GameObject val62 = UPool.MyPool.AddObject("熔炉精灵召唤!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265680, true); val62.AddComponent<熔炉精灵召唤脚本234>().召唤物123 = val46; 绿色治疗效果 = val2.LoadAsset("治疗效果34如44"); GameObject val63 = UPool.MyPool.AddObject("不死图腾!!", val2.LoadAsset("不死图腾23423"), true, (HideFlags)52, (Sprite)null, 3265681, true); val63.AddComponent<不死图腾效果123>(); val42.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2] { val52, val63 }; GameObject val64 = UPool.MyPool.AddObject("无限不死图腾!!", val2.LoadAsset("不死图腾23423"), true, (HideFlags)52, (Sprite)null, 3265682, true); val64.AddComponent<不死图腾效果123>().无限执行 = true; GameObject val65 = UPool.MyPool.AddObject("混乱索敌234!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265684, true); val65.AddComponent<混乱i触底检测>(); GameObject val66 = UPool.MyPool.AddObject("幽灵漫步!!", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265683, true); val66.AddComponent<护盾脚本>(); val66.AddComponent<隐身技能脚本>().jibnen = (GameObject[])(object)new GameObject[1] { val65 }; val39.GetComponentInChildren<元素召唤234>().混乱技能检测 = (GameObject[])(object)new GameObject[1] { val65 }; GameObject val67 = UPool.MyPool.AddObject("雷系近战躲闪!!", val2.LoadAsset("近战躲闪14123"), true, (HideFlags)52, (Sprite)null, 3265685, true); ((Component)val67.transform.Find("changxaioujd")).gameObject.AddComponent<红蓝队伍粒子色>().红队伍色 = val2.LoadAsset("发光红234"); ((Component)val67.transform.Find("changxaioujd")).gameObject.GetComponent<红蓝队伍粒子色>().蓝队伍色 = val2.LoadAsset("发光蓝234"); ((Component)val67.transform.Find("shunasdjian")).gameObject.AddComponent<红蓝队伍粒子色>().红队伍色 = val2.LoadAsset("发光红234"); ((Component)val67.transform.Find("shunasdjian")).gameObject.GetComponent<红蓝队伍粒子色>().蓝队伍色 = val2.LoadAsset("发光蓝234"); val67.AddComponent<闪避留下残影342>(); GameObject val68 = UPool.MyPool.AddObject("雷系远程躲闪!!", val2.LoadAsset("远程躲闪234234"), true, (HideFlags)52, (Sprite)null, 3265686, true); ((Component)val68.transform.Find("shunasdjian")).gameObject.AddComponent<红蓝队伍粒子色>().红队伍色 = val2.LoadAsset("发光红234"); ((Component)val68.transform.Find("shunasdjian")).gameObject.GetComponent<红蓝队伍粒子色>().蓝队伍色 = val2.LoadAsset("发光蓝234"); 火元素隐藏物体 = val2.LoadAsset("火元素藏品3445"); 冰元素隐藏物体 = val2.LoadAsset("冰元素藏品34"); 雷元素隐藏物体 = val2.LoadAsset("雷元素藏品231"); 火元素隐藏物体.AddComponent<隐藏项判定345t>(); 冰元素隐藏物体.AddComponent<隐藏项判定345t>(); 雷元素隐藏物体.AddComponent<隐藏项判定345t>(); 元素法师3124 = val2.LoadAsset("yuansufashiICON"); val42.forceCost = 20000u; s.SetField(val48, "DeathRef", (object)"Misc Attack Vocals/Crow"); s.SetField(val48, "VocalRef", (object)"Misc Death Vocals/Crow"); s.SetField(val42, "DeathRef", (object)"Fantasy Dark Death Vocals/DarkKingHuman"); s.SetField(val42, "VocalRef", (object)"Fantasy Dark Attack Vocals/DarkKingHuman"); s.SetField(val42, "VoicePitch", (object)1.3f); val42.Entity.SetUnlockKey("BAjssdsssd"); val42.Validate(); 多国语言部分2r.语言添加("AXE_KING_Ru", "斧王#Axe King#斧王#Axtkönig#Roi Hache#Король Топоров#Rey Hacha#Re delle Asce"); GameObject val69 = UPool.MyPool.AddObject("不摔倒121", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265687, true); val69.AddComponent<单位引用ww21>(); GameObject val70 = UPool.MyPool.AddObject("屹立不倒", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265688, true); val70.AddComponent<简单免疫死亡组件>(); val70.AddComponent<单位引用ww21>(); val70.AddComponent<设置单位躯干层级>(); GameObject unitBase6 = UPool.MyPool.AddObject("姆萨罗模型4233", val2.LoadAsset("姆萨罗模型4233"), true, (HideFlags)52, (Sprite)null, 3265689, true); GameObject val71 = UPool.MyPool.AddObject("反击螺旋", val2.LoadAsset("斧王旋转劈"), true, (HideFlags)52, (Sprite)null, 3265690, true); GameObject val72 = UPool.MyPool.AddObject("战争怒吼", val2.LoadAsset("斧王吼叫4"), true, (HideFlags)52, (Sprite)null, 3265691, true); GameObject val73 = UPool.MyPool.AddObject("淘汰之刃", val2.LoadAsset("斧王跳砍2"), true, (HideFlags)52, (Sprite)null, 3265692, true); val73.GetComponentInChildren<泰山压顶控制器>().跳跃时间 = 1.5f; val73.GetComponentInChildren<伤害计算事件>().伤害叠加模式 = 伤害计算事件.叠伤模式.指数爆炸; val73.GetComponentInChildren<伤害计算事件>().目标将要受到的伤害 = 600f; val73.GetComponentInChildren<伤害计算事件>().指数值 = 1.0001f; UnitBlueprint val74 = SLMATool.CreateUnit("AXE_KING_Ru", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], 编辑器1.直接设置图标(val2, "斧王icon1")); val74.m_props = (GameObject[])(object)new GameObject[11] { UPool.MyPool.AddObject("斧王43旗帜43", val2.LoadAsset("斧王43旗帜43"), true, (HideFlags)52, (Sprite)null, 3265693, true), UPool.MyPool.AddObject("斧王伤疤34", val2.LoadAsset("斧王伤疤34"), true, (HideFlags)52, (Sprite)null, 3265694, true), UPool.MyPool.AddObject("斧王头发与胡子3", val2.LoadAsset("斧王头发与胡子3"), true, (HideFlags)52, (Sprite)null, 3265695, true), UPool.MyPool.AddObject("斧王头肩甲45", val2.LoadAsset("斧王头肩甲45"), true, (HideFlags)52, (Sprite)null, 3265696, true), UPool.MyPool.AddObject("斧王小腿甲4", val2.LoadAsset("斧王小腿甲4"), true, (HideFlags)52, (Sprite)null, 3265697, true), UPool.MyPool.AddObject("斧王小臂护臂66", val2.LoadAsset("斧王小臂护臂66"), true, (HideFlags)52, (Sprite)null, 3265698, true), UPool.MyPool.AddObject("斧王皮带4", val2.LoadAsset("斧王皮带4"), true, (HideFlags)52, (Sprite)null, 3265699, true), UPool.MyPool.AddObject("斧王腰带4", val2.LoadAsset("斧王腰带4"), true, (HideFlags)52, (Sprite)null, 3265701, true), UPool.MyPool.AddObject("斧王裙甲4", val2.LoadAsset("斧王裙甲4"), true, (HideFlags)52, (Sprite)null, 3265702, true), UPool.MyPool.AddObject("斧王裤子4", val2.LoadAsset("斧王裤子4"), true, (HideFlags)52, (Sprite)null, 3265703, true), UPool.MyPool.AddObject("斧王鞋子4", val2.LoadAsset("斧王鞋子4"), true, (HideFlags)52, (Sprite)null, 3265704, true) }; val71.GetComponentInChildren<添加向心力>().力度大小 = 10500f; val71.GetComponentInChildren<添加向心力>().半径 = 2f; val71.GetComponentInChildren<添加向心力>().离心力系数 = 1f; val74.RightWeapon = UPool.MyPool.AddObject("斧王的斧头", val2.LoadAsset("斧王的大斧头3"), true, (HideFlags)52, (Sprite)null, 3265705, true); val74.UnitBase = UPool.MyPool.AddObject("斧王模型3", val2.LoadAsset("斧王模型423"), true, (HideFlags)52, (Sprite)null, 3265706, true); val74.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[4] { val72, val73, val71, val69 }; val74.health = 1850f; val74.massMultiplier = 15f; val74.sizeMultiplier = 1.4f; val74.damageMultiplier = 1.3571f; val74.forceCost = 6000u; s.SetField(val74, "DeathRef", (object)"斧王和穆萨罗/斧王语音"); s.SetField(val74, "VocalRef", (object)"斧王和穆萨罗/斧王语音"); val74.TargetingComponent = (ITargetingComponent)(object)default(单位只会以最近单位为目标标签); val74.Entity.SetUnlockKey("shouranfuwang"); val74.holdinigWithTwoHands = true; val74.Validate(); UnitBlueprint val75 = SLMATool.CreateUnit("UNIT_JIANSHENG", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], 编辑器1.直接设置图标(val2, "穆萨罗icon")); val75.UnitBase = unitBase6; val75.RightWeapon = UPool.MyPool.AddObject("穆萨罗武器34", val2.LoadAsset("穆萨罗武器34"), true, (HideFlags)52, (Sprite)null, 3265707, true); val75.m_props = (GameObject[])(object)new GameObject[13] { UPool.MyPool.AddObject("穆萨罗下摆4", val2.LoadAsset("穆萨罗下摆4"), true, (HideFlags)52, (Sprite)null, 3265708, true), UPool.MyPool.AddObject("穆萨罗冲天辫4", val2.LoadAsset("穆萨罗冲天辫4"), true, (HideFlags)52, (Sprite)null, 3265709, true), UPool.MyPool.AddObject("穆萨罗小腿护甲4", val2.LoadAsset("穆萨罗小腿护甲4"), true, (HideFlags)52, (Sprite)null, 3265710, true), UPool.MyPool.AddObject("穆萨罗小臂护具4", val2.LoadAsset("穆萨罗小臂护具4"), true, (HideFlags)52, (Sprite)null, 3265711, true), UPool.MyPool.AddObject("穆萨罗意义不明的皮带534", val2.LoadAsset("穆萨罗意义不明的皮带534"), true, (HideFlags)52, (Sprite)null, 3265712, true), UPool.MyPool.AddObject("穆萨罗拖鞋4", val2.LoadAsset("穆萨罗拖鞋4"), true, (HideFlags)52, (Sprite)null, 3265713, true), UPool.MyPool.AddObject("穆萨罗眉毛4", val2.LoadAsset("穆萨罗眉毛4"), true, (HideFlags)52, (Sprite)null, 3265714, true), UPool.MyPool.AddObject("穆萨罗绳子腰带8", val2.LoadAsset("穆萨罗绳子腰带8"), true, (HideFlags)52, (Sprite)null, 3265715, true), UPool.MyPool.AddObject("穆萨罗胡子5", val2.LoadAsset("穆萨罗胡子5"), true, (HideFlags)52, (Sprite)null, 3265716, true), UPool.MyPool.AddObject("穆萨罗裙甲4", val2.LoadAsset("穆萨罗裙甲4"), true, (HideFlags)52, (Sprite)null, 3265717, true), UPool.MyPool.AddObject("穆萨罗裤子4", val2.LoadAsset("穆萨罗裤子4"), true, (HideFlags)52, (Sprite)null, 3265718, true), UPool.MyPool.AddObject("佛珠434", val2.LoadAsset("佛珠434"), true, (HideFlags)52, (Sprite)null, 3265719, true), UPool.MyPool.AddObject("旗帜43", val2.LoadAsset("旗帜43"), true, (HideFlags)52, (Sprite)null, 3265720, true) }; val75.health = 760f; val75.massMultiplier = 15f; val75.sizeMultiplier = 1.4f; GameObject val76 = UPool.MyPool.AddObject("剑圣旋风斩技能", val2.LoadAsset("剑圣旋风斩技能"), true, (HideFlags)52, (Sprite)null, 3265721, true); val76.GetComponentInChildren<穆萨罗旋风斩移动冲刺>().冲刺力度 = 3000f; val76.GetComponentInChildren<穆萨罗旋风斩移动冲刺>().旋转速度 = 10000f; val76.GetComponentInChildren<龙卷风吸引>().吸引强度 = 25500f; val76.GetComponentInChildren<龙卷风吸引>().切线强度 = 10000f; val76.GetComponentInChildren<弹反实体弹药>().切线力强度 = 155500f; val76.GetComponentInChildren<弹反实体弹药>().离心力强度 = 3000f; UPool.MyPool.AddObject("图腾召唤技能243", val2.LoadAsset("图腾召唤技能243"), true, (HideFlags)52, (Sprite)null, 3265724, true); UPool.MyPool.AddObject("图腾召唤技能哈姆版", val2.LoadAsset("图腾召唤技能哈姆版"), true, (HideFlags)52, (Sprite)null, 3265725, true); val75.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[5] { val76, UPool.MyPool.AddObject("穆萨罗五连斩", val2.LoadAsset("穆萨罗五连斩"), true, (HideFlags)52, (Sprite)null, 3265722, true), UPool.MyPool.AddObject("图腾召唤技能联动版本", val2.LoadAsset("图腾召唤技能联动版本"), true, (HideFlags)52, (Sprite)null, 3265727, true), val69, (GameObject)SLMALoader.SDic["moves"]["Shogun_Dodge"] }; val75.forceCost = 6000u; val75.attackSpeedMultiplier = 0.6f; val75.Entity.SetUnlockKey("SECRET_JIANSHENGsdf"); s.SetField(val75, "DeathRef", (object)"斧王和穆萨罗/剑圣语音语音"); s.SetField(val75, "VocalRef", (object)"斧王和穆萨罗/剑圣语音语音"); val75.Validate(); 多国语言部分2r.语言添加("THUNDER_DRAGON_Ru", "雷霆巨龙#Thunder Dragon#サンダードラゴン#Donnerdrache#Dragon de Tonnerre#Громовой Дракон#Dragón del Trueno#Drago del Tuono"); 多国语言部分2r.语言添加("BLACK_HOLE_Ru", "黑洞#Black Hole#ブラックホール#Schwarzes Loch#Trou Noir#Чёрная дыра#Agujero Negro#Buco Nero"); UnitBlueprint val77 = SLMATool.CreateUnit("THUNDER_DRAGON_Ru", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], 编辑器1.直接设置图标(val2, "单位雷龙图标3")); val77.health = 1599f; val77.UnitBase = UPool.MyPool.AddObject("雷电龙模型4", val2.LoadAsset("雷电龙模型4"), true, (HideFlags)52, (Sprite)null, 3265728, true); val77.sizeMultiplier = 3f; val77.massMultiplier = 20f; val77.animationMultiplier = 0.6f; val77.movementSpeedMuiltiplier = 2f; val77.forceCost = 20000u; UPool.MyPool.AddObject("雷霆抛射物", val2.LoadAsset("雷电球抛射物sd"), true, (HideFlags)52, (Sprite)null, 3265729, true); UPool.MyPool.AddObject("雷电飞龙之拳4", val2.LoadAsset("雷电飞龙之拳4"), true, (HideFlags)52, (Sprite)null, 3265730, true); UPool.MyPool.AddObject("雷龙吼雷", val2.LoadAsset("雷龙吼雷2323"), true, (HideFlags)52, (Sprite)null, 3265731, true); UPool.MyPool.AddObject("雷龙雷枪", val2.LoadAsset("远程雷电343"), true, (HideFlags)52, (Sprite)null, 3265732, true); UPool.MyPool.AddObject("雷龙吼雷2", val2.LoadAsset("雷龙吼雷动作加强"), true, (HideFlags)52, (Sprite)null, 3265733, true); val77.Entity.SetUnlockKey("SECRET_LEITINGJULONGKKKH"); s.SetField(val77, "DeathRef", (object)"雷龙音效/雷龙声音"); s.SetField(val77, "VocalRef", (object)"雷龙音效/雷龙声音"); s.SetField(val77, "footRef", (object)"Footsteps/IceGiant"); val77.Validate(); GameObject val78 = UPool.MyPool.AddObject("黑洞模型", val2.LoadAsset("黑洞模型23322"), true, (HideFlags)52, (Sprite)null, 3265734, true); val78.AddComponent<无血条qwqawqw>(); 黑洞吸引类 componentInChildren2 = val78.GetComponentInChildren<黑洞吸引类>(); componentInChildren2.最大引力 = 65000f; componentInChildren2.切线力 = 15000f; componentInChildren2.最小引力 = 10f; UnitBlueprint val79 = SLMATool.CreateUnit("BLACK_HOLE_Ru", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], 编辑器1.直接设置图标(val2, "黑洞图标sdfvd")); val79.UnitBase = val78; val79.forceCost = 9999999u; val79.sizeMultiplier = 9f; GameObject val80 = UPool.MyPool.AddObject("黑洞无敌效果", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265735, true); val80.AddComponent<黑洞无敌补丁添加器>(); val79.Entity.SetUnlockKey("SECRET_HWEDONGAGSIEWGHDSA"); s.SetField(val79, "DeathRef", (object)"Misc Attack Vocals/Crow"); s.SetField(val79, "VocalRef", (object)"Misc Attack Vocals/Crow"); val79.Validate(); GameObject val81 = UPool.MyPool.AddObject("固定单位生命值", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265782, true); val81.AddComponent<单位生命值固定器>(); GameObject unitBase7 = UPool.MyPool.AddObject("维兹南模型asas", val2.LoadAsset("透明恶魔666"), true, (HideFlags)52, (Sprite)null, 3265736, true); 多国语言部分2r.语言添加("DEMON_WIZARD_Ru", "恶魔巫师#Demon Wizard#悪魔の魔法使い#Dämonenzauberer#Démon Sorcier#Демон-волшебник#Hechicero Demoníaco#Mago Demone"); UnitBlueprint val82 = SLMATool.CreateUnit("DEMON_WIZARD_Ru", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], 编辑器1.直接设置图标(val2, "恶魔巫师icon")); val82.UnitBase = unitBase7; val82.m_props = (GameObject[])(object)new GameObject[18] { UPool.MyPool.AddObject("维兹南皇冠243", val2.LoadAsset("维兹南皇冠243"), true, (HideFlags)52, (Sprite)null, 3265738, true), UPool.MyPool.AddObject("维兹南上衣", val2.LoadAsset("维兹南上衣"), true, (HideFlags)52, (Sprite)null, 3265739, true), UPool.MyPool.AddObject("维兹南内摆群", val2.LoadAsset("维兹南内摆群"), true, (HideFlags)52, (Sprite)null, 3265740, true), UPool.MyPool.AddObject("维兹南外套", val2.LoadAsset("维兹南外套"), true, (HideFlags)52, (Sprite)null, 3265741, true), UPool.MyPool.AddObject("维兹南大腿护甲", val2.LoadAsset("维兹南大腿护甲"), true, (HideFlags)52, (Sprite)null, 3265742, true), UPool.MyPool.AddObject("维兹南小腿护甲", val2.LoadAsset("维兹南小腿护甲"), true, (HideFlags)52, (Sprite)null, 3265743, true), UPool.MyPool.AddObject("维兹南小臂护甲", val2.LoadAsset("维兹南小臂护甲"), true, (HideFlags)52, (Sprite)null, 3265744, true), UPool.MyPool.AddObject("维兹南护膝", val2.LoadAsset("维兹南护膝"), true, (HideFlags)52, (Sprite)null, 3265745, true), UPool.MyPool.AddObject("维兹南斗篷", val2.LoadAsset("维兹南斗篷"), true, (HideFlags)52, (Sprite)null, 3265746, true), UPool.MyPool.AddObject("维兹南肘部护甲", val2.LoadAsset("维兹南肘部护甲"), true, (HideFlags)52, (Sprite)null, 3265747, true), UPool.MyPool.AddObject("维兹南肩甲", val2.LoadAsset("维兹南肩甲"), true, (HideFlags)52, (Sprite)null, 3265748, true), UPool.MyPool.AddObject("维兹南胸甲", val2.LoadAsset("维兹南胸甲"), true, (HideFlags)52, (Sprite)null, 3265749, true), UPool.MyPool.AddObject("维兹南膝盖盖板", val2.LoadAsset("维兹南膝盖盖板"), true, (HideFlags)52, (Sprite)null, 3265750, true), UPool.MyPool.AddObject("维兹南裙摆", val2.LoadAsset("维兹南裙摆"), true, (HideFlags)52, (Sprite)null, 3265751, true), UPool.MyPool.AddObject("维兹南裙甲", val2.LoadAsset("维兹南裙甲"), true, (HideFlags)52, (Sprite)null, 3265752, true), UPool.MyPool.AddObject("维兹南裤子", val2.LoadAsset("维兹南裤子"), true, (HideFlags)52, (Sprite)null, 3265753, true), UPool.MyPool.AddObject("维兹南裤子2", val2.LoadAsset("维兹南裤子2"), true, (HideFlags)52, (Sprite)null, 3265754, true), UPool.MyPool.AddObject("恶魔巫师开掌手", val2.LoadAsset("恶魔巫师开掌手"), true, (HideFlags)52, (Sprite)null, 3265783, true) }; UPool.MyPool.AddObject("恶魔巫师手套3", val2.LoadAsset("恶魔巫师手套3"), true, (HideFlags)52, (Sprite)null, 3265784, true); val82.massMultiplier = 50f; val82.sizeMultiplier = 1.7f; val82.health = 6666f; val82.forceCost = 40000u; val82.RightWeapon = UPool.MyPool.AddObject("卫兹南法杖rgwe", val2.LoadAsset("卫兹南法杖rgwe"), true, (HideFlags)52, (Sprite)null, 3265755, true); val82.LeftWeapon = UPool.MyPool.AddObject("灵魂汲取asjh", val2.LoadAsset("灵魂汲取2332"), true, (HideFlags)52, (Sprite)null, 3265756, true); val82.holdinigWithTwoHands = false; GameObject val83 = UPool.MyPool.AddObject("卫兹南2阶段转换技能", val2.LoadAsset("卫兹南2阶段转换技能"), true, (HideFlags)52, (Sprite)null, 3265776, true); GameObject val84 = UPool.MyPool.AddObject("卫兹南恶魔防火", val2.LoadAsset("空的技能324"), true, (HideFlags)52, (Sprite)null, 3265807, true); val84.AddComponent<防火添加器>(); val82.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[3] { UPool.MyPool.AddObject("禁锢技能召唤23423", val2.LoadAsset("禁锢技能召唤23423"), true, (HideFlags)52, (Sprite)null, 3265757, true), val81, val83 }; val82.Entity.SetUnlockKey("SECRET_EMOWUSHIWEIZINAN"); s.SetField(val82, "DeathRef", (object)"人物声音/卫兹南语音"); s.SetField(val82, "VocalRef", (object)"人物声音/卫兹南语音"); val82.Validate(); GameObject unitBase8 = UPool.MyPool.AddObject("卫兹南2阶段模型", val2.LoadAsset("卫兹南2阶段模型"), true, (HideFlags)52, (Sprite)null, 3265758, true); UnitBlueprint val85 = SLMATool.CreateUnit("卫兹南2", (UnitBlueprint)null, (Faction)null, 编辑器1.直接设置图标(val2, "恶魔巫师icon")); val85.UnitBase = unitBase8; val85.m_props = (GameObject[])(object)new GameObject[12] { UPool.MyPool.AddObject("维兹南2阶段一个莫名其妙的服饰", val2.LoadAsset("维兹南2阶段一个莫名其妙的服饰"), true, (HideFlags)52, (Sprite)null, 3265759, true), UPool.MyPool.AddObject("维兹南2阶段上臂护甲", val2.LoadAsset("维兹南2阶段上臂护甲"), true, (HideFlags)52, (Sprite)null, 3265761, true), UPool.MyPool.AddObject("维兹南2阶段大腿护甲", val2.LoadAsset("维兹南2阶段大腿护甲"), true, (HideFlags)52, (Sprite)null, 3265762, true), UPool.MyPool.AddObject("维兹南2阶段小腿护甲", val2.LoadAsset("维兹南2阶段小腿护甲"), true, (HideFlags)52, (Sprite)null, 3265763, true), UPool.MyPool.AddObject("维兹南2阶段尾巴尖", val2.LoadAsset("维兹南2阶段尾巴尖"), true, (HideFlags)52, (Sprite)null, 3265764, true), UPool.MyPool.AddObject("维兹南2阶段翅膀23", val2.LoadAsset("维兹南2阶段翅膀23"), true, (HideFlags)52, (Sprite)null, 3265765, true), UPool.MyPool.AddObject("维兹南2阶段肩甲", val2.LoadAsset("维兹南2阶段肩甲"), true, (HideFlags)52, (Sprite)null, 3265766, true), UPool.MyPool.AddObject("维兹南2阶段胸口静态", val2.LoadAsset("维兹南2阶段胸口静态"), true, (HideFlags)52, (Sprite)null, 3265767, true), UPool.MyPool.AddObject("维兹南2阶段腰带", val2.LoadAsset("维兹南2阶段腰带"), true, (HideFlags)52, (Sprite)null, 3265768, true), UPool.MyPool.AddObject("维兹南2阶段膝盖护甲", val2.LoadAsset("维兹南2阶段膝盖护甲"), true, (HideFlags)52, (Sprite)null, 3265769, true), UPool.MyPool.AddObject("维兹南2阶段裤子", val2.LoadAsset("维兹南2阶段裤子"), true, (HideFlags)52, (Sprite)null, 3265770, true), UPool.MyPool.AddObject("维兹南上2阶段皮革圈", val2.LoadAsset("维兹南上2阶段皮革圈"), true, (HideFlags)52, (Sprite)null, 3265771, true) }; val85.sizeMultiplier = 3.8f; val85.health = 9999f; UPool.MyPool.AddObject("卫兹南2阶段远程免疫", val2.LoadAsset("恶魔远程免疫技能"), true, (HideFlags)52, (Sprite)null, 3265777, true); val85.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[9] { UPool.MyPool.AddObject("胸口光束技能", val2.LoadAsset("胸口光束技能"), true, (HideFlags)52, (Sprite)null, 3265772, true), UPool.MyPool.AddObject("卫兹南火焰吐息", val2.LoadAsset("卫兹南火焰吐息"), true, (HideFlags)52, (Sprite)null, 3265773, true), UPool.MyPool.AddObject("卫兹践踏技能23fd", val2.LoadAsset("卫兹践踏技能23fd"), true, (HideFlags)52, (Sprite)null, 3265774, true), UPool.MyPool.AddObject("卫兹南2阶段登场播放音乐", val2.LoadAsset("卫兹南2阶段登场播放音乐"), true, (HideFlags)52, (Sprite)null, 3265775, true), UPool.MyPool.AddObject("硬体远程格挡技能21", val2.LoadAsset("硬体远程格挡技能21"), true, (HideFlags)52, (Sprite)null, 3265778, true), UPool.MyPool.AddObject("死亡超级爆炸", val2.LoadAsset("死亡超级爆炸"), true, (HideFlags)52, (Sprite)null, 3265781, true), val81, val84, UPool.MyPool.AddObject("卫兹南大恶魔半血更换武器", val2.LoadAsset("更换武器测试能"), true, (HideFlags)52, (Sprite)null, 0, true) }; UPool.MyPool.AddObject("卫兹南斧头34", val2.LoadAsset("卫兹南斧头34"), true, (HideFlags)52, (Sprite)null, 3265780, true); val85.stepMultiplier = 1.6f; val85.animationMultiplier = 0.5f; val85.RightWeapon = UPool.MyPool.AddObject("卫兹南拳击sda", val2.LoadAsset("卫兹南拳击sda"), true, (HideFlags)52, (Sprite)null, 3265785, true); val85.LeftWeapon = val85.RightWeapon; val85.attackSpeedMultiplier = 1f; val85.massMultiplier = 30f; val85.forceCost = 12000u; s.SetField(val85, "footRef", (object)"Footsteps/IceGiant"); s.SetField(val85, "DeathRef", (object)"卫兹南技能爆炸/大恶魔声音"); s.SetField(val85, "VocalRef", (object)"卫兹南技能爆炸/大恶魔声音"); val85.Validate(); val83.GetComponentInChildren<生成新的单位在此处>().单位蓝图 = val85; UPool.MyPool.AddObject("分裂飞弹", val2.LoadAsset("分裂飞弹"), true, (HideFlags)52, (Sprite)null, 3265786, true); UPool.MyPool.AddObject("卫兹南火球", val2.LoadAsset("卫兹南火球"), true, (HideFlags)52, (Sprite)null, 3265787, true); UPool.MyPool.AddObject("卫兹南剑气或者说斧气", val2.LoadAsset("卫兹南剑气或者说斧气"), true, (HideFlags)52, (Sprite)null, 3265788, true); UPool.MyPool.AddObject("绿色火球34", val2.LoadAsset("绿色火球34"), true, (HideFlags)52, (Sprite)null, 3265789, true); UPool.MyPool.AddObject("滚木抛射物", val2.LoadAsset("无抛射物adssa"), true, (HideFlags)52, (Sprite)null, 3265790, true); UPool.MyPool.AddObject("大恶魔的火焰", val2.LoadAsset("大恶魔火焰asdasasd"), true, (HideFlags)52, (Sprite)null, 3265791, true); UPool.MyPool.AddObject("胸口激光23抛射物", val2.LoadAsset("胸口激光23抛射物"), true, (HideFlags)52, (Sprite)null, 3265792, true); UPool.MyPool.AddObject("向下砸雷4345", val2.LoadAsset("向下砸雷4345"), true, (HideFlags)52, (Sprite)null, 3265793, true); 多国语言部分2r.语言添加("VENOM_MERCENARY_Ru", "毒液佣兵#Venom Mercenary#毒の傭兵#Giftmietling#Mercenaire Venin#Ядовитый наёмник#Mercenario Veneno#Mercenario Veleno"); UnitBlueprint val86 = SLMATool.CreateUnit("VENOM_MERCENARY_Ru", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], 编辑器1.直接设置图标(val2, "图标123毒液佣兵")); val86.forceCost = 1500u; val86.health = 800f; val86.massMultiplier = 2f; val86.sizeMultiplier = 1.3f; val86.m_props = (GameObject[])(object)new GameObject[10] { UPool.MyPool.AddObject("毒液雇佣兵上衣", val2.LoadAsset("毒液雇佣兵上衣"), true, (HideFlags)52, (Sprite)null, 3265794, true), UPool.MyPool.AddObject("毒液雇佣兵围巾", val2.LoadAsset("毒液雇佣兵围巾"), true, (HideFlags)52, (Sprite)null, 3265795, true), UPool.MyPool.AddObject("毒液雇佣兵头发", val2.LoadAsset("毒液雇佣兵头发"), true, (HideFlags)52, (Sprite)null, 3265796, true), UPool.MyPool.AddObject("毒液雇佣兵护手", val2.LoadAsset("毒液雇佣兵护手"), true, (HideFlags)52, (Sprite)null, 3265797, true), UPool.MyPool.AddObject("毒液雇佣兵护膝", val2.LoadAsset("毒液雇佣兵护膝"), true, (HideFlags)52, (Sprite)null, 3265798, true), UPool.MyPool.AddObject("毒液雇佣兵皮带", val2.LoadAsset("毒液雇佣兵皮带"), true, (HideFlags)52, (Sprite)null, 3265799, true), UPool.MyPool.AddObject("毒液雇佣兵肩甲", val2.LoadAsset("毒液雇佣兵肩甲"), true, (HideFlags)52, (Sprite)null, 3265800, true), UPool.MyPool.AddObject("毒液雇佣兵裤子", val2.LoadAsset("毒液雇佣兵裤子"), true, (HideFlags)52, (Sprite)null, 3265801, true), UPool.MyPool.AddObject("毒液雇佣兵面具", val2.LoadAsset("毒液雇佣兵面具"), true, (HideFlags)52, (Sprite)null, 3265802, true), UPool.MyPool.AddObject("毒液雇佣兵鞋子", val2.LoadAsset("毒液雇佣兵鞋子"), true, (HideFlags)52, (Sprite)null, 3265803, true) }; UPool.MyPool.AddObject("毒液佣兵匕首", val2.LoadAsset("毒液佣兵匕首"), true, (HideFlags)52, (Sprite)null, 3265804, true); UPool.MyPool.AddObject("毒液佣兵投掷武器", val2.LoadAsset("毒液佣兵投掷武器"), true, (HideFlags)52, (Sprite)null, 3265805, true); val86.RightWeapon = UPool.MyPool.AddObject("毒液佣兵投掷武器双持", val2.LoadAsset("毒液佣兵投掷武器双持"), true, (HideFlags)52, (Sprite)null, 3265806, true); val86.holdinigWithTwoHands = true; val86.damageMultiplier = 0.5f; val86.turnSpeed *= 5f; val86.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2] { val69, (GameObject)SLMALoader.SDic["moves"]["ProjectileDodge_Painter"] }; val86.attackSpeedMultiplier = 5f; UPool.MyPool.AddObject("毒液佣兵毒药瓶34", val2.LoadAsset("毒液佣兵毒药瓶34"), true, (HideFlags)52, (Sprite)null, 3265808, true); val86.Entity.SetUnlockKey("SECRET_YINCANGDANWEIDUYIEYONGBING"); s.SetField(val86, "DeathRef", (object)"Fantasy Dark Attack Vocals/FantasyAssassin"); s.SetField(val86, "VocalRef", (object)"Fantasy Dark Attack Vocals/FantasyAssassin"); s.SetField(val86, "VoicePitch", (object)0.7f); val86.Validate(); 多国语言部分2r.语言添加(多国语言部分2r.蠕虫的8国语言, "蠕虫#Worm#ワーム#Wurm#Ver#Червь#Gusano#Verme"); 多国语言部分2r.语言添加(多国语言部分2r.黑骑士的8国语言, "黑骑士#Black Knight#黒騎士#Schwarzer Ritter#Chevalier Noir#Чёрный Рыцарь#Caballero Negro#Cavaliere Nero"); 多国语言部分2r.语言添加(多国语言部分2r.元素法师的8国语言, "元素法师#Elemental Mage#元素魔術師#Elementarmagier#Mage Élémentaire#Элементальный Маг#Mago Elemental#Mago Elementale"); List list3 = new List(); UnitBlueprint[] units = ((Faction)SLMALoader.SDic["factions"]["Secret"]).Units; foreach (UnitBlueprint item2 in units) { list3.Add(item2); } list3.Sort((UnitBlueprint unit1, UnitBlueprint unit2) => unit1.GetUnitCost(true).CompareTo(unit2.GetUnitCost(true))); ((Faction)SLMALoader.SDic["factions"]["Secret"]).Units = list3.ToArray(); } public static void EditWeapons(GameObject weapon, Team team, Unit unit, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db) { Debug.Log((object)weapon); } } public class aaaa事件管理器 : MonoBehaviour { [CompilerGenerated] private sealed class <延迟执行协程>d__12 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public aaaa事件管理器 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <延迟执行协程>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.延迟时间); <>1__state = 1; return true; case 1: { <>1__state = -1; UnityEvent 延迟执行的事件 = <>4__this.延迟执行的事件; if (延迟执行的事件 != null) { 延迟执行的事件.Invoke(); } <>4__this.延迟执行协程引用 = null; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <延迟执行协程>d__13 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float 自定义延迟时间; public aaaa事件管理器 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <延迟执行协程>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(自定义延迟时间); <>1__state = 1; return true; case 1: { <>1__state = -1; UnityEvent 延迟执行的事件 = <>4__this.延迟执行的事件; if (延迟执行的事件 != null) { 延迟执行的事件.Invoke(); } <>4__this.延迟执行协程引用 = null; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <间隔执行协程>d__17 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public aaaa事件管理器 <>4__this; private int <当前次数>5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <间隔执行协程>d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <当前次数>5__1 = 0; break; case 1: { <>1__state = -1; UnityEvent 间隔执行的事件 = <>4__this.间隔执行的事件; if (间隔执行的事件 != null) { 间隔执行的事件.Invoke(); } <当前次数>5__1++; break; } } if (<当前次数>5__1 < <>4__this.执行次数) { <>2__current = (object)new WaitForSeconds(<>4__this.间隔时间); <>1__state = 1; return true; } <>4__this.间隔执行协程引用 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <间隔执行协程>d__18 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float 自定义间隔时间; public int 自定义执行次数; public aaaa事件管理器 <>4__this; private int <当前次数>5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <间隔执行协程>d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <当前次数>5__1 = 0; break; case 1: { <>1__state = -1; UnityEvent 间隔执行的事件 = <>4__this.间隔执行的事件; if (间隔执行的事件 != null) { 间隔执行的事件.Invoke(); } <当前次数>5__1++; break; } } if (<当前次数>5__1 < 自定义执行次数) { <>2__current = (object)new WaitForSeconds(自定义间隔时间); <>1__state = 1; return true; } <>4__this.间隔执行协程引用 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("延迟执行设置")] public UnityEvent 延迟执行的事件; public float 延迟时间 = 2f; public bool 在启动时执行延迟事件 = false; [Header("间隔执行设置")] public UnityEvent 间隔执行的事件; public float 间隔时间 = 1f; public int 执行次数 = 5; public bool 在启动时开始间隔执行 = false; private Coroutine 延迟执行协程引用; private Coroutine 间隔执行协程引用; private void Start() { if (在启动时执行延迟事件) { 开始延迟执行(); } if (在启动时开始间隔执行) { 开始间隔执行(); } } public void 开始延迟执行() { 停止延迟执行(); 延迟执行协程引用 = ((MonoBehaviour)this).StartCoroutine(延迟执行协程()); } public void 开始延迟执行(float 自定义延迟时间) { 停止延迟执行(); 延迟执行协程引用 = ((MonoBehaviour)this).StartCoroutine(延迟执行协程(自定义延迟时间)); } [IteratorStateMachine(typeof(<延迟执行协程>d__12))] private IEnumerator 延迟执行协程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <延迟执行协程>d__12(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<延迟执行协程>d__13))] private IEnumerator 延迟执行协程(float 自定义延迟时间) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <延迟执行协程>d__13(0) { <>4__this = this, 自定义延迟时间 = 自定义延迟时间 }; } public void 停止延迟执行() { if (延迟执行协程引用 != null) { ((MonoBehaviour)this).StopCoroutine(延迟执行协程引用); 延迟执行协程引用 = null; } } public void 开始间隔执行() { 停止间隔执行(); 间隔执行协程引用 = ((MonoBehaviour)this).StartCoroutine(间隔执行协程()); } public void 开始间隔执行(float 自定义间隔时间, int 自定义执行次数) { 停止间隔执行(); 间隔执行协程引用 = ((MonoBehaviour)this).StartCoroutine(间隔执行协程(自定义间隔时间, 自定义执行次数)); } [IteratorStateMachine(typeof(<间隔执行协程>d__17))] private IEnumerator 间隔执行协程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <间隔执行协程>d__17(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<间隔执行协程>d__18))] private IEnumerator 间隔执行协程(float 自定义间隔时间, int 自定义执行次数) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <间隔执行协程>d__18(0) { <>4__this = this, 自定义间隔时间 = 自定义间隔时间, 自定义执行次数 = 自定义执行次数 }; } public void 停止间隔执行() { if (间隔执行协程引用 != null) { ((MonoBehaviour)this).StopCoroutine(间隔执行协程引用); 间隔执行协程引用 = null; } } public void 停止所有执行() { ((MonoBehaviour)this).StopAllCoroutines(); 延迟执行协程引用 = null; 间隔执行协程引用 = null; } public void 开始所有执行() { 开始延迟执行(); 开始间隔执行(); } } public class 刚体与模型骨骼同步 : MonoBehaviour { [CompilerGenerated] private sealed class <同步协程函数>d__39 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 刚体与模型骨骼同步 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <同步协程函数>d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (<>4__this.正在同步中) { <>4__this.同步所有刚体(); <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit 当前单位; [Header("骨骼与刚体映射")] private Dictionary 骨骼刚体映射 = new Dictionary(); private Dictionary 刚体骨骼映射 = new Dictionary(); [Header("同步参数")] public bool 仅旋转同步 = true; public float 力度 = 1200f; public float 位置弹簧力 = 800f; public float 位置阻尼力 = 100f; public float 最大距离限制 = 0.5f; private bool 正在同步中 = false; private Coroutine 同步协程; [Header("调试选项")] public bool 显示同步线 = false; public Color 同步线颜色 = Color.green; public Transform hip; public Transform 躯干; public Transform 左大腿; public Transform 左小腿; public Transform 右大腿; public Transform 右小腿; public Transform 左肩膀; public Transform 左胳膊; public Transform 右肩膀; public Transform 右胳膊; public Transform 头部; private Rigidbody 角色躯干刚体; private Rigidbody 角色HIP刚体; private Rigidbody 角色左上腿刚体; private Rigidbody 角色左下腿刚体; private Rigidbody 角色右上腿刚体; private Rigidbody 角色右下腿刚体; private Rigidbody 角色左肩膀刚体; private Rigidbody 角色左手臂刚体; private Rigidbody 角色右肩膀刚体; private Rigidbody 角色右手臂刚体; private Rigidbody 角色头部刚体; private void Start() { 当前单位 = ((Component)((Component)this).transform.root).GetComponentInChildren(); 角色躯干刚体 = ((Component)当前单位.data.torso).GetComponent(); 角色HIP刚体 = 当前单位.data.hip; 角色左上腿刚体 = ((Component)当前单位.data.legLeft).GetComponent(); 角色左下腿刚体 = ((Component)当前单位.data.footLeft).GetComponent(); 角色右上腿刚体 = ((Component)当前单位.data.legRight).GetComponent(); 角色右下腿刚体 = ((Component)当前单位.data.footRight).GetComponent(); 角色左肩膀刚体 = ((Component)当前单位.data.leftArm).GetComponent(); 角色左手臂刚体 = ((Component)当前单位.data.leftHand).GetComponent(); 角色右肩膀刚体 = ((Component)当前单位.data.rightArm).GetComponent(); 角色右手臂刚体 = ((Component)当前单位.data.rightHand).GetComponent(); 角色头部刚体 = ((Component)当前单位.data.head).GetComponent(); 初始化映射关系(); 配置刚体物理参数(); } private void 初始化映射关系() { 骨骼刚体映射.Clear(); 刚体骨骼映射.Clear(); if ((Object)(object)hip != (Object)null && (Object)(object)角色HIP刚体 != (Object)null) { 骨骼刚体映射.Add(hip, 角色HIP刚体); 刚体骨骼映射.Add(角色HIP刚体, hip); } if ((Object)(object)躯干 != (Object)null && (Object)(object)角色躯干刚体 != (Object)null) { 骨骼刚体映射.Add(躯干, 角色躯干刚体); 刚体骨骼映射.Add(角色躯干刚体, 躯干); } if ((Object)(object)左大腿 != (Object)null && (Object)(object)角色左上腿刚体 != (Object)null) { 骨骼刚体映射.Add(左大腿, 角色左上腿刚体); 刚体骨骼映射.Add(角色左上腿刚体, 左大腿); } if ((Object)(object)左小腿 != (Object)null && (Object)(object)角色左下腿刚体 != (Object)null) { 骨骼刚体映射.Add(左小腿, 角色左下腿刚体); 刚体骨骼映射.Add(角色左下腿刚体, 左小腿); } if ((Object)(object)右大腿 != (Object)null && (Object)(object)角色右上腿刚体 != (Object)null) { 骨骼刚体映射.Add(右大腿, 角色右上腿刚体); 刚体骨骼映射.Add(角色右上腿刚体, 右大腿); } if ((Object)(object)右小腿 != (Object)null && (Object)(object)角色右下腿刚体 != (Object)null) { 骨骼刚体映射.Add(右小腿, 角色右下腿刚体); 刚体骨骼映射.Add(角色右下腿刚体, 右小腿); } if ((Object)(object)左肩膀 != (Object)null && (Object)(object)角色左肩膀刚体 != (Object)null) { 骨骼刚体映射.Add(左肩膀, 角色左肩膀刚体); 刚体骨骼映射.Add(角色左肩膀刚体, 左肩膀); } if ((Object)(object)左胳膊 != (Object)null && (Object)(object)角色左手臂刚体 != (Object)null) { 骨骼刚体映射.Add(左胳膊, 角色左手臂刚体); 刚体骨骼映射.Add(角色左手臂刚体, 左胳膊); } if ((Object)(object)右肩膀 != (Object)null && (Object)(object)角色右肩膀刚体 != (Object)null) { 骨骼刚体映射.Add(右肩膀, 角色右肩膀刚体); 刚体骨骼映射.Add(角色右肩膀刚体, 右肩膀); } if ((Object)(object)右胳膊 != (Object)null && (Object)(object)角色右手臂刚体 != (Object)null) { 骨骼刚体映射.Add(右胳膊, 角色右手臂刚体); 刚体骨骼映射.Add(角色右手臂刚体, 右胳膊); } if ((Object)(object)头部 != (Object)null && (Object)(object)角色头部刚体 != (Object)null) { 骨骼刚体映射.Add(头部, 角色头部刚体); 刚体骨骼映射.Add(角色头部刚体, 头部); } Debug.Log((object)$"已初始化 {骨骼刚体映射.Count} 个骨骼-刚体映射"); } private void 配置刚体物理参数() { foreach (KeyValuePair item in 骨骼刚体映射) { Rigidbody value = item.Value; value.interpolation = (RigidbodyInterpolation)1; value.collisionDetectionMode = (CollisionDetectionMode)2; if ((Object)(object)value == (Object)(object)角色HIP刚体 || (Object)(object)value == (Object)(object)角色躯干刚体) { value.mass = 10f; value.drag = 1f; value.angularDrag = 1f; } else { value.mass = 2f; value.drag = 0.5f; value.angularDrag = 0.5f; } } } public void 开始进行同步() { if (!正在同步中) { 正在同步中 = true; 同步协程 = ((MonoBehaviour)this).StartCoroutine(同步协程函数()); Debug.Log((object)"开始骨骼-刚体同步"); } } public void 停止同步() { if (正在同步中) { 正在同步中 = false; if (同步协程 != null) { ((MonoBehaviour)this).StopCoroutine(同步协程); 同步协程 = null; } Debug.Log((object)"停止骨骼-刚体同步"); } } [IteratorStateMachine(typeof(<同步协程函数>d__39))] private IEnumerator 同步协程函数() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <同步协程函数>d__39(0) { <>4__this = this }; } private void 同步所有刚体() { foreach (KeyValuePair item in 骨骼刚体映射) { Transform key = item.Key; Rigidbody value = item.Value; if (!((Object)(object)key == (Object)null) && !((Object)(object)value == (Object)null)) { if (仅旋转同步) { 同步旋转(key, value); } else { 同步位置和旋转(key, value); } } } } private void 同步旋转(Transform 骨骼, Rigidbody 刚体) { //IL_0002: 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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = 骨骼.rotation; Quaternion rotation2 = 刚体.rotation; Quaternion val = rotation * Quaternion.Inverse(rotation2); float num = default(float); Vector3 val2 = default(Vector3); ((Quaternion)(ref val)).ToAngleAxis(ref num, ref val2); if (num > 180f) { num -= 360f; } if (Mathf.Abs(num) > 0.1f) { Vector3 val3 = num * ((float)Math.PI / 180f) * val2 / Time.fixedDeltaTime; Vector3 val4 = val3 * 力度; 刚体.AddTorque(val4, (ForceMode)5); } } private void 同步位置和旋转(Transform 骨骼, Rigidbody 刚体) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) //IL_0017: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0078: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) 同步旋转(骨骼, 刚体); Vector3 position = 骨骼.position; Vector3 position2 = 刚体.position; float num = Vector3.Distance(position, position2); if (num > 最大距离限制) { 刚体.MovePosition(position); } else if (num > 0.01f) { Vector3 val = position - position2; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = normalized * (num / Time.fixedDeltaTime); Vector3 val3 = val2 - 刚体.velocity; Vector3 val4 = val3 * 位置弹簧力; Vector3 val5 = -刚体.velocity * 位置阻尼力; 刚体.AddForce(val4 + val5, (ForceMode)5); } } private void FixedUpdate() { if (!正在同步中) { } } private void OnDrawGizmos() { //IL_001f: 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_0077: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (!显示同步线 || !正在同步中) { return; } Gizmos.color = 同步线颜色; foreach (KeyValuePair item in 骨骼刚体映射) { Transform key = item.Key; Rigidbody value = item.Value; if (!((Object)(object)key == (Object)null) && !((Object)(object)value == (Object)null)) { Gizmos.DrawLine(value.position, key.position); Gizmos.DrawWireCube(value.position, Vector3.one * 0.05f); Gizmos.DrawSphere(key.position, 0.03f); } } } private void OnDisable() { 停止同步(); } private void OnDestroy() { 停止同步(); } public Rigidbody 获取骨骼对应刚体(Transform 骨骼) { if (骨骼刚体映射.ContainsKey(骨骼)) { return 骨骼刚体映射[骨骼]; } return null; } public Transform 获取刚体对应骨骼(Rigidbody 刚体) { if (刚体骨骼映射.ContainsKey(刚体)) { return 刚体骨骼映射[刚体]; } return null; } } [RequireComponent(typeof(Animator))] public class 动画控制器 : MonoBehaviour { [CompilerGenerated] private sealed class d__21 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 动画控制器 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; break; case 2: <>1__state = -1; break; } if (<>4__this.IsAnimationPlaying(<>4__this.currentAnimationName)) { <>2__current = null; <>1__state = 2; return true; } UnityEvent onAnimationCompleted = <>4__this.OnAnimationCompleted; if (onAnimationCompleted != null) { onAnimationCompleted.Invoke(); } <>4__this.animationCompleteCoroutine = null; Debug.Log((object)("动画播放器: 动画 '" + <>4__this.currentAnimationName + "' 播放完成"), (Object)(object)<>4__this); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("动画控制")] [SerializeField] private Animator animator; [Header("动画名称配置")] [SerializeField] private string defaultAnimationName = "Idle"; [Header("事件回调")] public UnityEvent OnAnimationStarted; public UnityEvent OnAnimationCompleted; public UnityEvent OnAnimationInterrupted; private string currentAnimationName; private Coroutine animationCompleteCoroutine; private void Awake() { if ((Object)(object)animator == (Object)null) { animator = ((Component)this).GetComponent(); } } private void OnEnable() { if (!string.IsNullOrEmpty(defaultAnimationName)) { PlayAnimation(defaultAnimationName); } } public void PlayAnimationFromBeginning(string animationName) { if ((Object)(object)animator == (Object)null || string.IsNullOrEmpty(animationName)) { Debug.LogWarning((object)"动画播放器: 无效的动画参数", (Object)(object)this); return; } if (animationCompleteCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(animationCompleteCoroutine); UnityEvent onAnimationInterrupted = OnAnimationInterrupted; if (onAnimationInterrupted != null) { onAnimationInterrupted.Invoke(); } } animator.Play(animationName, -1, 0f); animator.Update(0f); currentAnimationName = animationName; UnityEvent onAnimationStarted = OnAnimationStarted; if (onAnimationStarted != null) { onAnimationStarted.Invoke(); } animationCompleteCoroutine = ((MonoBehaviour)this).StartCoroutine(WaitForAnimationComplete()); Debug.Log((object)("动画播放器: 开始播放动画 '" + animationName + "'"), (Object)(object)this); } public void PlayAnimation(string animationName) { if (!((Object)(object)animator == (Object)null) && !string.IsNullOrEmpty(animationName)) { if (currentAnimationName != animationName) { PlayAnimationFromBeginning(animationName); } else { animator.Play(animationName); } } } public void PauseAnimation() { if ((Object)(object)animator != (Object)null) { animator.speed = 0f; Debug.Log((object)"动画播放器: 动画已暂停", (Object)(object)this); } } public void ResumeAnimation() { if ((Object)(object)animator != (Object)null) { animator.speed = 1f; Debug.Log((object)"动画播放器: 动画已恢复播放", (Object)(object)this); } } public void StopAnimation() { if (!((Object)(object)animator != (Object)null)) { return; } animator.SetTrigger("Stop"); animator.Play(defaultAnimationName, -1, 0f); if (animationCompleteCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(animationCompleteCoroutine); UnityEvent onAnimationInterrupted = OnAnimationInterrupted; if (onAnimationInterrupted != null) { onAnimationInterrupted.Invoke(); } } Debug.Log((object)"动画播放器: 动画已停止", (Object)(object)this); } public void SetAnimationSpeed(float speed) { if ((Object)(object)animator != (Object)null) { animator.speed = Mathf.Max(0f, speed); Debug.Log((object)$"动画播放器: 播放速度设置为 {speed}", (Object)(object)this); } } public void ToggleAnimationPause() { if ((Object)(object)animator != (Object)null) { animator.speed = ((animator.speed > 0f) ? 0f : 1f); Debug.Log((object)$"动画播放器: 切换播放状态 - 速度: {animator.speed}", (Object)(object)this); } } public void SetAnimationTime(float normalizedTime) { if ((Object)(object)animator != (Object)null && !string.IsNullOrEmpty(currentAnimationName)) { normalizedTime = Mathf.Clamp01(normalizedTime); animator.Play(currentAnimationName, -1, normalizedTime); animator.Update(0f); Debug.Log((object)$"动画播放器: 跳转到 {normalizedTime * 100f}%", (Object)(object)this); } } public float GetCurrentAnimationProgress() { //IL_0019: 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) if ((Object)(object)animator != (Object)null) { AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); return ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime % 1f; } return 0f; } public bool IsAnimationPlaying(string animationName = null) { //IL_001c: 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) if ((Object)(object)animator == (Object)null) { return false; } AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (string.IsNullOrEmpty(animationName)) { return ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime < 1f || animator.IsInTransition(0); } return ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName(animationName) && (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime < 1f || animator.IsInTransition(0)); } public void ToggleAnimationLoop(bool loop) { if ((Object)(object)animator != (Object)null && !string.IsNullOrEmpty(currentAnimationName)) { Debug.Log((object)$"动画播放器: 循环播放设置为 {loop}", (Object)(object)this); } } public void PlayDefaultAnimation() { if (!string.IsNullOrEmpty(defaultAnimationName)) { PlayAnimationFromBeginning(defaultAnimationName); } } [IteratorStateMachine(typeof(d__21))] private IEnumerator WaitForAnimationComplete() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { <>4__this = this }; } [ContextMenu("测试播放默认动画")] private void TestPlayDefaultAnimation() { PlayDefaultAnimation(); } [ContextMenu("暂停动画")] private void TestPauseAnimation() { PauseAnimation(); } [ContextMenu("恢复动画")] private void TestResumeAnimation() { ResumeAnimation(); } } public class 父级关于旋转影响 : MonoBehaviour { [Header("旋转不受父级影响的轴")] [Tooltip("勾选表示该轴不受父级旋转影响")] public bool ignoreX = true; public bool ignoreY = true; public bool ignoreZ = true; [Header("可选:设置目标旋转值")] [Tooltip("如果不使用世界旋转,可以指定固定的局部旋转值")] public bool useCustomLocalRotation = false; public Vector3 customLocalEulerAngles = Vector3.zero; private Quaternion initialLocalRotation; private Transform cachedTransform; private Transform cachedParent; private void Start() { //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) cachedTransform = ((Component)this).transform; if (!useCustomLocalRotation) { initialLocalRotation = cachedTransform.localRotation; } if ((Object)(object)cachedTransform.parent != (Object)null) { cachedParent = cachedTransform.parent; } else { Debug.LogWarning((object)"物体没有父级,脚本将不会产生效果"); } } private void LateUpdate() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_0091: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00a8: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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) //IL_0131: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cachedParent == (Object)null) { return; } Quaternion localRotation = ((!useCustomLocalRotation) ? initialLocalRotation : Quaternion.Euler(customLocalEulerAngles)); if (ignoreX && ignoreY && ignoreZ) { cachedTransform.localRotation = localRotation; return; } Quaternion rotation = cachedParent.rotation; Quaternion rotation2 = cachedTransform.rotation; Vector3 eulerAngles = ((Quaternion)(ref rotation2)).eulerAngles; Vector3 eulerAngles2 = ((Quaternion)(ref localRotation)).eulerAngles; Vector3 val = eulerAngles; if (ignoreX) { Quaternion val2 = rotation * Quaternion.Euler(eulerAngles2.x, 0f, 0f); val.x = ((Quaternion)(ref val2)).eulerAngles.x; } if (ignoreY) { Quaternion val3 = rotation * Quaternion.Euler(0f, eulerAngles2.y, 0f); val.y = ((Quaternion)(ref val3)).eulerAngles.y; } if (ignoreZ) { Quaternion val4 = rotation * Quaternion.Euler(0f, 0f, eulerAngles2.z); val.z = ((Quaternion)(ref val4)).eulerAngles.z; } cachedTransform.rotation = Quaternion.Euler(val); } [ContextMenu("设置当前旋转为初始旋转")] public void SetCurrentAsInitial() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cachedTransform == (Object)null) { cachedTransform = ((Component)this).transform; } initialLocalRotation = cachedTransform.localRotation; useCustomLocalRotation = false; } public void SetCustomRotation(Vector3 eulerAngles) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) customLocalEulerAngles = eulerAngles; useCustomLocalRotation = true; } public void UseInitialRotation() { useCustomLocalRotation = false; } private void OnValidate() { if (!Application.isPlaying && (Object)(object)((Component)this).transform.parent != (Object)null && ((Behaviour)this).enabled) { Debug.Log((object)"在编辑模式下无法实时预览,请运行游戏查看效果"); } } } public class 物体面向目标 : MonoBehaviour { private DataHandler 当前单位; private bool 面向目标 = false; public UnityEvent 面向事件; public UnityEvent 结束面向事件; [Header("旋转设置")] public float 旋转速度 = 360f; public bool 使用平滑旋转 = true; private void Start() { 当前单位 = ((Component)this).GetComponentInParent(); if (!((Object)(object)当前单位 == (Object)null)) { return; } Debug.LogWarning((object)("物体面向目标: 在 " + ((Object)((Component)this).transform).name + " 上没有找到DataHandler组件尝试火球unit组件"), (Object)(object)this); Unit component = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)component != (Object)null) { 当前单位 = component.data; if (Object.op_Implicit((Object)(object)当前单位)) { Debug.Log((object)"获取成功!"); } } } private void Update() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_00d2: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00bd: Unknown result type (might be due to invalid IL or missing references) if (!面向目标 || (Object)(object)当前单位?.targetData?.mainRig == (Object)null) { return; } Vector3 val = 当前单位.targetData.mainRig.position - ((Component)this).transform.position; if (!(val == Vector3.zero)) { if (使用平滑旋转 && 旋转速度 > 0f) { Quaternion val2 = Quaternion.LookRotation(val); ((Component)this).transform.rotation = Quaternion.RotateTowards(((Component)this).transform.rotation, val2, 旋转速度 * Time.deltaTime); } else { ((Component)this).transform.forward = val; } } } public void 设置面向bool(bool d = false) { if (面向目标 == d) { return; } 面向目标 = d; if (d) { UnityEvent obj = 面向事件; if (obj != null) { obj.Invoke(); } } else { UnityEvent obj2 = 结束面向事件; if (obj2 != null) { obj2.Invoke(); } } } } public class 隐身控制器 : MonoBehaviour { private Renderer[] 全部渲染器; private List 启用的渲染器列表 = new List(); private List 禁用的渲染器列表 = new List(); private void Start() { 全部渲染器 = ((Component)this).GetComponentsInChildren(true); 分类渲染器(); } private void 分类渲染器() { 启用的渲染器列表.Clear(); 禁用的渲染器列表.Clear(); Renderer[] array = 全部渲染器; foreach (Renderer val in array) { if (val.enabled) { 启用的渲染器列表.Add(val); } else { 禁用的渲染器列表.Add(val); } } Debug.Log((object)$"已找到 {全部渲染器.Length} 个渲染器,其中启用: {启用的渲染器列表.Count},禁用: {禁用的渲染器列表.Count}"); } public void 开启启用的渲染器() { foreach (Renderer item in 启用的渲染器列表) { item.enabled = true; } Debug.Log((object)$"已开启 {启用的渲染器列表.Count} 个原本启用的渲染器"); } public void 关闭启用的渲染器() { foreach (Renderer item in 启用的渲染器列表) { item.enabled = false; } Debug.Log((object)$"已关闭 {启用的渲染器列表.Count} 个原本启用的渲染器,实现隐身效果"); } public void 开启禁用的渲染器() { foreach (Renderer item in 禁用的渲染器列表) { item.enabled = true; } Debug.Log((object)$"已开启 {禁用的渲染器列表.Count} 个原本禁用的渲染器"); } public void 关闭禁用的渲染器() { foreach (Renderer item in 禁用的渲染器列表) { item.enabled = false; } Debug.Log((object)$"已关闭 {禁用的渲染器列表.Count} 个原本禁用的渲染器"); } public void 开启全部渲染器() { Renderer[] array = 全部渲染器; foreach (Renderer val in array) { val.enabled = true; } Debug.Log((object)$"已开启全部 {全部渲染器.Length} 个渲染器"); 分类渲染器(); } public void 关闭全部渲染器() { Renderer[] array = 全部渲染器; foreach (Renderer val in array) { val.enabled = false; } Debug.Log((object)$"已关闭全部 {全部渲染器.Length} 个渲染器"); 分类渲染器(); } public void 更新渲染器列表() { 全部渲染器 = ((Component)this).GetComponentsInChildren(true); 分类渲染器(); Debug.Log((object)$"已更新渲染器列表,总数: {全部渲染器.Length}"); } public int 获取启用渲染器数量() { return 启用的渲染器列表.Count; } public int 获取禁用渲染器数量() { return 禁用的渲染器列表.Count; } public void 切换隐身() { bool flag = false; Renderer[] array = 全部渲染器; foreach (Renderer val in array) { if (val.enabled) { flag = true; break; } } if (flag) { 关闭启用的渲染器(); } else { 开启启用的渲染器(); } } } public class 隐身时间控制器 : MonoBehaviour { [CompilerGenerated] private sealed class <隐身协程>d__12 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float 持续时间; public 隐身时间控制器 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <隐身协程>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>4__this.正在隐身中 = true; <>4__this.目标隐身组件.关闭启用的渲染器(); UnityEvent 隐身开始事件 = <>4__this.隐身开始事件; if (隐身开始事件 != null) { 隐身开始事件.Invoke(); } Debug.Log((object)$"隐身开始,持续时间: {持续时间}秒"); <>2__current = (object)new WaitForSeconds(持续时间); <>1__state = 1; return true; } case 1: <>1__state = -1; <>4__this.结束隐身(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("隐身组件引用")] [Tooltip("需要控制的隐身组件")] [SerializeField] private 隐身控制器 目标隐身组件; [Header("隐身设置")] [Tooltip("默认隐身时间(秒)")] [SerializeField] private float 默认隐身时间 = 3f; [Header("事件")] [Tooltip("隐身开始时触发")] [SerializeField] private UnityEvent 隐身开始事件; [Tooltip("隐身结束时触发")] [SerializeField] private UnityEvent 隐身结束事件; [Tooltip("隐身被中断时触发")] [SerializeField] private UnityEvent 隐身中断事件; private Coroutine 当前隐身协程; private bool 正在隐身中 = false; private void Start() { if ((Object)(object)目标隐身组件 == (Object)null) { 目标隐身组件 = ((Component)this).GetComponent<隐身控制器>(); if ((Object)(object)目标隐身组件 == (Object)null) { 目标隐身组件 = ((Component)this).GetComponentInChildren<隐身控制器>(); } } if ((Object)(object)目标隐身组件 == (Object)null) { Debug.LogWarning((object)(((Object)((Component)this).gameObject).name + " 上没有找到 隐身控制器 组件,请手动指定或添加该组件")); } } public void 开启隐身() { 开启隐身一段时间(默认隐身时间); } public void 开启隐身一段时间(float 隐身时间) { if ((Object)(object)目标隐身组件 == (Object)null) { Debug.LogError((object)"无法开启隐身:没有找到隐身控制器组件"); return; } if (正在隐身中 && 当前隐身协程 != null) { ((MonoBehaviour)this).StopCoroutine(当前隐身协程); UnityEvent obj = 隐身中断事件; if (obj != null) { obj.Invoke(); } Debug.Log((object)"已中断之前的隐身效果"); } 当前隐身协程 = ((MonoBehaviour)this).StartCoroutine(隐身协程(隐身时间)); } public void 关闭隐身() { if (!正在隐身中) { Debug.Log((object)"当前没有处于隐身状态"); return; } if (当前隐身协程 != null) { ((MonoBehaviour)this).StopCoroutine(当前隐身协程); } 结束隐身(); UnityEvent obj = 隐身中断事件; if (obj != null) { obj.Invoke(); } } public void 切换隐身() { if (正在隐身中) { 关闭隐身(); } else { 开启隐身(); } } [IteratorStateMachine(typeof(<隐身协程>d__12))] private IEnumerator 隐身协程(float 持续时间) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <隐身协程>d__12(0) { <>4__this = this, 持续时间 = 持续时间 }; } private void 结束隐身() { if ((Object)(object)目标隐身组件 != (Object)null) { 目标隐身组件.开启启用的渲染器(); } 正在隐身中 = false; 当前隐身协程 = null; UnityEvent obj = 隐身结束事件; if (obj != null) { obj.Invoke(); } Debug.Log((object)"隐身结束"); } public bool 是否正在隐身() { return 正在隐身中; } public float 获取剩余隐身时间() { if (!正在隐身中 || 当前隐身协程 == null) { return 0f; } return 0f; } public void 设置目标隐身组件(隐身控制器 新组件) { 目标隐身组件 = 新组件; Debug.Log((object)("已设置目标隐身组件: " + ((Object)新组件).name)); } public void 设置默认隐身时间(float 新时间) { 默认隐身时间 = 新时间; Debug.Log((object)$"默认隐身时间已设置为: {新时间}秒"); } } public class 设置单位躯干层级 : MonoBehaviour { private Unit 当前单位; public int 将要设置的层级 = 0; private void Start() { Debug.Log((object)$"开始设置层级,目标层级:{将要设置的层级}", (Object)(object)this); 当前单位 = ((Component)this).GetComponentInParent(); if ((Object)(object)当前单位 == (Object)null) { Debug.LogError((object)"无法找到 Unit 组件!请确保此脚本所在的物体有 Unit 组件或其父物体有 Unit 组件。", (Object)(object)this); Debug.LogError((object)("当前脚本位置:" + ((Object)((Component)this).gameObject).name + ",层级路径:" + GetGameObjectPath(((Component)this).gameObject)), (Object)(object)this); return; } Debug.Log((object)("找到 Unit 组件,单位名称:" + ((Object)当前单位).name), (Object)(object)this); if ((Object)(object)当前单位.data == (Object)null) { Debug.LogError((object)"Unit.data 为空!请检查 Unit 组件的 data 字段是否已赋值。", (Object)(object)this); return; } if ((Object)(object)当前单位.data.mainRig == (Object)null) { Debug.LogError((object)"Unit.data.mainRig 为空!请检查 mainRig 字段是否已赋值。", (Object)(object)this); Debug.Log((object)("Unit.data 的类型:" + ((object)当前单位.data).GetType().Name), (Object)(object)this); return; } GameObject gameObject = ((Component)当前单位.data.mainRig).gameObject; Debug.Log((object)$"找到 mainRig 物体:{((Object)gameObject).name},当前层级:{gameObject.layer}", (Object)(object)this); Transform[] componentsInChildren = gameObject.GetComponentsInChildren(true); Debug.Log((object)$"共找到 {componentsInChildren.Length} 个子物体(包括自身)", (Object)(object)this); int num = 0; Transform[] array = componentsInChildren; foreach (Transform val in array) { if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)"发现空的子物体 Transform,跳过", (Object)(object)this); continue; } if ((Object)(object)((Component)val).gameObject == (Object)null) { Debug.LogWarning((object)"发现空的 GameObject,跳过", (Object)(object)this); continue; } ((Component)val).gameObject.layer = 将要设置的层级; num++; } Debug.Log((object)$"层级设置完成!总共设置 {num}/{componentsInChildren.Length} 个物体的层级为 {将要设置的层级}", (Object)(object)this); if (num > 0) { int num2 = 0; Transform[] array2 = componentsInChildren; foreach (Transform val2 in array2) { if ((Object)(object)val2 != (Object)null && (Object)(object)((Component)val2).gameObject != (Object)null && ((Component)val2).gameObject.layer == 将要设置的层级) { num2++; } } if (num2 == num) { Debug.Log((object)$"✅ 验证成功!所有 {num2} 个物体的层级都已正确设置为 {将要设置的层级}", (Object)(object)this); } else { Debug.LogWarning((object)$"⚠\ufe0f 验证警告:设置 {num} 个,但只有 {num2} 个层级正确", (Object)(object)this); } } else { Debug.LogWarning((object)"⚠\ufe0f 没有设置任何物体的层级,请检查!", (Object)(object)this); } } private string GetGameObjectPath(GameObject obj) { if ((Object)(object)obj == (Object)null) { return "null"; } string text = ((Object)obj).name; Transform parent = obj.transform.parent; while ((Object)(object)parent != (Object)null) { text = ((Object)parent).name + "/" + text; parent = parent.parent; } return text; } } public static class 多国语言部分2r { public static string 蠕虫的8国语言 = "WORM"; public static string 黑骑士的8国语言 = "BLACK_KNIGHT"; public static string 元素法师的8国语言 = "ELEMENTAL_MAGE"; public static void 语言添加(string key, string trans) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); dictionary.Add(0, (Language)7); dictionary.Add(1, (Language)0); dictionary.Add(2, (Language)8); dictionary.Add(3, (Language)3); dictionary.Add(4, (Language)1); dictionary.Add(5, (Language)6); dictionary.Add(6, (Language)4); dictionary.Add(7, (Language)2); Dictionary> dictionary2 = (Dictionary>)typeof(Localizer).GetField("m_localization", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); string[] array = trans.Split(new string[1] { "#" }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < dictionary.Count; i++) { if (!dictionary2[dictionary[i]].ContainsKey(key)) { dictionary2[dictionary[i]].Add(key, array[i]); } } typeof(Localizer).GetField("m_localization", BindingFlags.Static | BindingFlags.NonPublic).SetValue(typeof(Localizer), dictionary2); } } public class 抛物线运动 : MonoBehaviour { [CompilerGenerated] private sealed class <激活时间>d__27 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float time; public float time2; public 抛物线运动 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <激活时间>d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>4__this.正在启动 = true; <>4__this.激活跳跃 = true; <>4__this.正在起飞 = true; <>4__this.正在坠落 = false; UnityEvent 开始起飞事件 = <>4__this.开始起飞事件; if (开始起飞事件 != null) { 开始起飞事件.Invoke(); } <>2__current = (object)new WaitForSeconds(time); <>1__state = 1; return true; } case 1: <>1__state = -1; if (<>4__this.正在起飞 && !<>4__this.正在坠落) { <>4__this.正在起飞 = false; <>4__this.正在坠落 = true; UnityEvent 开始坠落事件 = <>4__this.开始坠落事件; if (开始坠落事件 != null) { 开始坠落事件.Invoke(); } } <>2__current = (object)new WaitForSeconds(time2); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.激活跳跃 = false; <>4__this.正在坠落 = false; <>4__this.到达目标判断 = true; <>4__this.计时器3 = 0f; <>4__this.正在启动 = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Rigidbody[] 所有刚体组件; public Transform 目标变换; public Transform 本体变换; public bool 激活跳跃 = false; public float 跳跃时间 = 1f; public float 坠落时间 = 1f; public float 水平力强度 = 2000f; public float 起飞强度 = 2000f; public float 坠落强度 = 2000f; private float 计时器3 = 0f; private bool 正在起飞 = false; public GameObject exp; public GameObject 转化a; private bool 到达目标判断 = true; private bool 正在坠落 = false; private float 平滑系数 = 0.1f; private Dictionary 初始角速度 = new Dictionary(); public UnityEvent 坠落事件; public UnityEvent 开始起飞事件; public UnityEvent 开始坠落事件; private Coroutine 正在执行的携程; private bool 正在启动 = false; private bool 已激活坠落事件 = false; public int 地面层 = 512; private void Start() { } public void 启动qqq() { } public void 启动(Rigidbody[] 所有刚体, float 上升, float 下降, float 水平, float 跳跃时间1, float 下落时间1, Transform 目标变换1, Transform 本体变换1, GameObject exp1, GameObject exp转化) { if (!正在启动) { if (正在执行的携程 != null) { ((MonoBehaviour)this).StopCoroutine(正在执行的携程); 正在执行的携程 = null; } 所有刚体组件 = 所有刚体; 目标变换 = 目标变换1; 本体变换 = 本体变换1; 水平力强度 = 水平; 起飞强度 = 上升; 坠落强度 = 下降; 跳跃时间 = 跳跃时间1; 坠落时间 = 下落时间1; exp = exp1; 转化a = exp转化; 保存初始角速度(); 正在执行的携程 = ((MonoBehaviour)this).StartCoroutine(激活时间(跳跃时间1, 下落时间1)); } } private void 保存初始角速度() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) 初始角速度.Clear(); Rigidbody[] array = 所有刚体组件; foreach (Rigidbody val in array) { 初始角速度[val] = val.angularVelocity; } } [IteratorStateMachine(typeof(<激活时间>d__27))] private IEnumerator 激活时间(float time = 3f, float time2 = 3f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <激活时间>d__27(0) { <>4__this = this, time = time, time2 = time2 }; } private void Update() { if (激活跳跃) { 起飞3(); } } private void 起飞3() { 计时器3 += Time.deltaTime; if (正在起飞 && 计时器3 < 跳跃时间) { 上升力32(); 平滑旋转(); } if (与目标水平距离() < 9f && 与地面垂直距离() >= 15f && 到达目标判断 && 正在起飞) { Debug.Log((object)"到达规定位置切换坠落"); 清除动能(); 正在坠落 = true; UnityEvent obj = 开始坠落事件; if (obj != null) { obj.Invoke(); } 正在起飞 = false; 计时器3 = 0f; 到达目标判断 = false; } if (计时器3 >= 跳跃时间 && 到达目标判断 && 正在起飞) { Debug.Log((object)"到达规定时间切换坠落"); 清除动能(); 正在坠落 = true; 正在起飞 = false; 计时器3 = 0f; 到达目标判断 = false; } if (正在坠落 && 计时器3 < 坠落时间) { 坠落力32(); 平滑旋转(); } if (正在坠落) { 射线地面检测(); } if (!正在起飞 && !正在坠落 && 激活跳跃) { 平滑旋转(); } } private void 平滑旋转() { //IL_0061: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = default(Vector3); for (int i = 0; i < 所有刚体组件.Length; i++) { Rigidbody val = 所有刚体组件[i]; if (初始角速度.ContainsKey(val)) { val.angularVelocity = Vector3.Lerp(val.angularVelocity, 初始角速度[val] * 0.3f, 平滑系数 * Time.deltaTime * 10f); } ((Vector3)(ref val2))..ctor(val.velocity.x, 0f, val.velocity.z); if (((Vector3)(ref val2)).magnitude > 5f && !正在起飞) { val.velocity = new Vector3(Mathf.Lerp(val.velocity.x, 0f, 平滑系数 * Time.deltaTime * 5f), val.velocity.y, Mathf.Lerp(val.velocity.z, 0f, 平滑系数 * Time.deltaTime * 5f)); } } } private Vector3 与目标水平方向() { //IL_0007: 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) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0033: Unknown result type (might be due to invalid IL or missing references) Vector3 val = 目标变换.position - 本体变换.position; val.y = 0f; return ((Vector3)(ref val)).normalized; } private float 与目标水平距离() { //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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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) Vector3 position = 目标变换.position; position.y = 0f; Vector3 position2 = 本体变换.position; position2.y = 0f; return Vector3.Distance(position, position2); } private float 与目标垂直距离() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) return Mathf.Abs(目标变换.position.y - 本体变换.position.y); } private float 与地面垂直距离() { //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) RaycastHit val = default(RaycastHit); if (Physics.Raycast(本体变换.position, Vector3.down, ref val, 100f, 地面层)) { return ((RaycastHit)(ref val)).distance; } return -1f; } private void 上升力32() { //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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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) for (int i = 0; i < 所有刚体组件.Length; i++) { Vector3 val = 与目标水平方向(); float num = Mathf.Clamp01(与目标水平距离() / 10f); 所有刚体组件[i].AddForce(Vector3.up * 起飞强度 * Time.deltaTime, (ForceMode)5); 所有刚体组件[i].AddForce(val * 水平力强度 * num * Time.deltaTime, (ForceMode)5); } } private void 坠落力32() { //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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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) for (int i = 0; i < 所有刚体组件.Length; i++) { Vector3 val = 与目标水平方向(); float num = Mathf.Clamp01(与目标水平距离() / 5f); 所有刚体组件[i].AddForce(Vector3.down * 坠落强度 * Time.deltaTime, (ForceMode)5); 所有刚体组件[i].AddForce(val * 水平力强度 * num * Time.deltaTime, (ForceMode)5); } } private void 射线地面检测() { //IL_000d: 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) //IL_001c: 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_0026: 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_0028: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) int num = 512; Vector3 val = 本体变换.position + Vector3.up * 10f; RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(val, Vector3.down, ref val2, 60f, num) || !Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject)) { return; } float num2 = Vector3.Distance(本体变换.position, ((RaycastHit)(ref val2)).point); if (num2 < 2f) { 清除动能(); Debug.Log((object)"清除动能"); UnityEvent obj = 坠落事件; if (obj != null) { obj.Invoke(); } Debug.Log((object)"执行事件"); 生成坠落爆炸(exp, ((RaycastHit)(ref val2)).point, 转化a); Debug.Log((object)"生成爆炸"); 已坠落1(); Debug.Log((object)"执行初始化"); } } private void 进行范围检测(Vector3 pon) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) int num = 16384; Collider[] array = Physics.OverlapSphere(pon, 5f, num); Collider[] array2 = array; foreach (Collider val in array2) { if (!((Object)(object)((Component)val).gameObject == (Object)(object)((Component)this).gameObject) && !((object)((Component)val).gameObject).Equals((object?)((Component)this).gameObject)) { Debug.Log((object)("检测到:" + ((Object)((Component)val).gameObject).name)); } } } private void 清除动能() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 所有刚体组件.Length; i++) { Rigidbody val = 所有刚体组件[i]; val.velocity = Vector3.zero; val.angularVelocity = Vector3.zero; } } private void 生成坠落爆炸(GameObject gameObjectw, Vector3 pion, GameObject 召唤物) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gameObjectw != (Object)null) { TeamHolder.AddTeamHolder(Object.Instantiate(gameObjectw, pion, Quaternion.identity), 召唤物); } } private void 已坠落1() { if (正在执行的携程 != null) { ((MonoBehaviour)this).StopCoroutine(正在执行的携程); } 激活跳跃 = false; 正在起飞 = false; 正在坠落 = false; 到达目标判断 = true; 计时器3 = 0f; 正在启动 = false; } } public class 泰山压顶控制器 : MonoBehaviour { private 抛物线运动 泰山压顶组件; private Unit Unit23; public GameObject exp323; public float 力乘数 = 1f; public float 跳跃时间 = 1.5f; public float 坠落 = 3f; private void Start() { 泰山压顶组件 = ((Component)this).GetComponent<抛物线运动>(); Unit23 = ((Component)((Component)this).transform.root).GetComponentInChildren(); } public void 启动泰山压顶控制器() { if ((Object)(object)Unit23.data.targetData == (Object)null) { Debug.LogError((object)"目标参数为null!!!"); return; } Unit unit = Unit23.data.targetData.unit; if ((Object)(object)泰山压顶组件 != (Object)null) { 泰山压顶组件.启动(Unit23.data.allRigs.AllRigs, 6000f * 力乘数, 8000f * 力乘数, 4000f * 力乘数, 跳跃时间, 坠落, ((Component)unit.data.mainRig).transform, ((Component)Unit23.data.mainRig).transform, exp323, ((Component)this).gameObject); } } } public class 伤害计算事件 : MonoBehaviour { public enum 叠伤模式 { 加法, 乘法, 幂函数, 指数爆炸 } private Unit 当前兵种; public float 目标将要受到的伤害 = 1500f; public float 最大血量临界值 = 3000f; public float 最小血量临界值 = 1000f; public UnityEvent 血量高于临界值触发事件; public UnityEvent 血量低于临界值触发事件; public UnityEvent 血量清空触发事件; public UnityEvent 连续终结被打断事件; public UnityEvent 造成伤害事件; private float 默认受伤; public bool 开启叠伤 = true; public 叠伤模式 伤害叠加模式 = 叠伤模式.加法; public float 每次处决叠加伤害 = 100f; public float 每次处决乘数叠加 = 1.1f; public float 每次处决幂函数叠加值 = 1.1f; public bool 开启斩杀线 = true; [Range(0f, 1f)] public float 斩杀线 = 0.2f; public int 平缓值 = 10; public float 指数值 = 1f; public float 爆炸型值 = 1.02f; public float 最大伤害 = 9999999f; private int 默认平缓值; private float 默认指数值; private void 指数增长() { float num = Random.Range(0.0005f, 0.002f); 爆炸型值 = Random.Range(1.005f, 1.02f); 指数值 += num; if (平缓值 >= 0) { 平缓值--; } else { 指数值 *= 爆炸型值; } } private void Start() { 当前兵种 = ((Component)((Component)this).transform.root).GetComponentInChildren(); 默认受伤 = 目标将要受到的伤害; 默认平缓值 = 平缓值; 默认指数值 = 指数值; } public void 手动触发事件(int 模式 = 0) { if ((Object)(object)当前兵种?.data?.targetData == (Object)null) { UnityEvent obj = 连续终结被打断事件; if (obj != null) { obj.Invoke(); } Debug.LogError((object)"目标参数为null!!!"); return; } DataHandler targetData = 当前兵种.data.targetData; float health = targetData.health; switch (模式) { case 0: 造成伤害(targetData, 目标将要受到的伤害); if (health > 最小血量临界值) { UnityEvent obj3 = 血量高于临界值触发事件; if (obj3 != null) { obj3.Invoke(); } } break; case 1: 造成伤害(targetData, 目标将要受到的伤害); if (health <= 最小血量临界值 && health > 0f) { UnityEvent obj6 = 血量低于临界值触发事件; if (obj6 != null) { obj6.Invoke(); } } break; case 2: if (health <= 0f) { UnityEvent obj4 = 血量清空触发事件; if (obj4 != null) { obj4.Invoke(); } targetData.healthHandler.Die(Object.op_Implicit((Object)(object)targetData)); } else if (health <= 目标将要受到的伤害) { UnityEvent obj5 = 血量清空触发事件; if (obj5 != null) { obj5.Invoke(); } targetData.healthHandler.Die(Object.op_Implicit((Object)(object)targetData)); } break; case 3: { 造成伤害(targetData, 目标将要受到的伤害); UnityEvent obj2 = 造成伤害事件; if (obj2 != null) { obj2.Invoke(); } break; } } } public void 叠加伤害() { if (!开启叠伤) { return; } if (伤害叠加模式 == 叠伤模式.加法) { 目标将要受到的伤害 += 每次处决叠加伤害; } if (伤害叠加模式 == 叠伤模式.乘法) { 目标将要受到的伤害 *= 每次处决乘数叠加; } if (伤害叠加模式 == 叠伤模式.幂函数) { 目标将要受到的伤害 = Mathf.Pow(目标将要受到的伤害, 每次处决幂函数叠加值); } if (伤害叠加模式 == 叠伤模式.指数爆炸) { 指数增长(); 目标将要受到的伤害 = Mathf.Pow(目标将要受到的伤害, 指数值); if (目标将要受到的伤害 >= 最大伤害) { 目标将要受到的伤害 = 最大伤害; } } } public void 重置伤害() { if (默认受伤 != float.NaN && 开启叠伤) { 目标将要受到的伤害 = 默认受伤; 指数值 = 默认指数值; 平缓值 = 默认平缓值; } } private void 造成伤害(DataHandler unitData, float 伤害值) { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) if (unitData.health <= 0f) { return; } float num = unitData.health - 伤害值; if (伤害值 <= 0f) { return; } if (开启斩杀线 && unitData.health <= unitData.maxHealth * 斩杀线 && !unitData.Dead) { UnityEvent obj = 血量清空触发事件; if (obj != null) { obj.Invoke(); } unitData.healthHandler.Die(Object.op_Implicit((Object)(object)unitData)); return; } ((Damagable)unitData.healthHandler).TakeDamage(伤害值, Vector3.zero, 当前兵种, (DamageType)0); if (num <= 0f) { 叠加伤害(); UnityEvent obj2 = 血量清空触发事件; if (obj2 != null) { obj2.Invoke(); } if (!unitData.Dead) { GameModeService service = ServiceLocator.GetService(); if (service.CurrentGameMode == null) { Debug.LogError((object)"Could not find CurrentGameMode!"); } else { service.CurrentGameMode.OnUnitDied(unitData.unit); } unitData.Dead = true; } } else { 重置伤害(); UnityEvent obj3 = 连续终结被打断事件; if (obj3 != null) { obj3.Invoke(); } } } public void 造成指定伤害(float 伤害值) { if (!((Object)(object)当前兵种?.data?.targetData == (Object)null)) { 造成伤害(当前兵种.data.targetData, 伤害值); } } public bool 目标是否存活() { Unit obj = 当前兵种; return obj != null && obj.data?.targetData?.health > 0f; } public float 获取目标当前血量() { return (当前兵种?.data?.targetData?.health).GetValueOrDefault(); } public void 在目标位置生成指定预制体(GameObject gamea) { //IL_0023: 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) if ((Object)(object)gamea != (Object)null) { TeamHolder.AddTeamHolder(Object.Instantiate(gamea, 当前兵种.data.targetData.mainRig.position, Quaternion.identity), ((Component)当前兵种).gameObject); } } } public class 单位引用ww21 : MonoBehaviour { private Unit unit; private DataHandler 单位数据; public bool 平衡数据 = false; public bool 启用摔落伤害 = false; public bool 可能会掉落 = false; private void Start() { Debug.Log((object)"获取unit组件"); unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogWarning((object)"无法获取unit组件请确保此组件为技能"); return; } 单位数据 = unit.data; if ((Object)(object)单位数据 == (Object)null) { Debug.LogWarning((object)"无法获取unit.data组件请确保单位完整性"); return; } 单位数据.takeFallDamage = 启用摔落伤害; 单位数据.canFall = 可能会掉落; Balance component = ((Component)单位数据).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ((Behaviour)component).enabled = 平衡数据; } } } public class 随机事件触发器 : MonoBehaviour { [CompilerGenerated] private sealed class <重置冷却>d__8 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 随机事件触发器 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <重置冷却>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.正在冷却中 = true; <>2__current = (object)new WaitForSeconds(<>4__this.冷却时间); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.正在冷却中 = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Range(0f, 1f)] public float 触发概率 = 0.5f; public UnityEvent 随机事件; public UnityEvent 反向事件; [SerializeField] private bool 启用冷却 = true; [SerializeField] private float 冷却时间 = 0.5f; private bool 正在冷却中 = false; private float 上次触发时间 = 0f; public void 尝试触发事件() { float num = Random.Range(0f, 1f); if (num <= 触发概率) { if (启用冷却) { float num2 = Time.time - 上次触发时间; if (正在冷却中 && num2 < 冷却时间) { Debug.Log((object)$"受伤事件冷却中,还需 {冷却时间 - num2:F2} 秒"); } else if (num2 >= 冷却时间) { 上次触发时间 = Time.time; 正在冷却中 = true; UnityEvent obj = 随机事件; if (obj != null) { obj.Invoke(); } } } else { UnityEvent obj2 = 随机事件; if (obj2 != null) { obj2.Invoke(); } } } else if (启用冷却) { float num3 = Time.time - 上次触发时间; if (正在冷却中 && num3 < 冷却时间) { Debug.Log((object)$"受伤事件冷却中,还需 {冷却时间 - num3:F2} 秒"); } else if (num3 >= 冷却时间) { 上次触发时间 = Time.time; 正在冷却中 = true; UnityEvent obj3 = 反向事件; if (obj3 != null) { obj3.Invoke(); } } } else { UnityEvent obj4 = 反向事件; if (obj4 != null) { obj4.Invoke(); } } } [IteratorStateMachine(typeof(<重置冷却>d__8))] private IEnumerator 重置冷却() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <重置冷却>d__8(0) { <>4__this = this }; } } public class 单位受伤事件 : MonoBehaviour { [CompilerGenerated] private sealed class <重置冷却>d__13 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 单位受伤事件 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <重置冷却>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.正在冷却中 = true; <>2__current = (object)new WaitForSeconds(<>4__this.冷却时间); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.正在冷却中 = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit unit; public UnityEvent 单位受伤事件ww; [SerializeField] private bool 启用冷却 = false; [SerializeField] private float 冷却时间 = 0.5f; private float 上次受伤时间 = 0f; private bool 正在冷却中 = false; private bool 事件是否开启 = true; private void Start() { Debug.Log((object)"单位受伤事件获取unit组件"); unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); if ((Object)(object)unit != (Object)null) { Unit obj = unit; obj.WasDealtDamageAction = (Action)Delegate.Combine(obj.WasDealtDamageAction, new Action(OnUnitDamaged)); } } private void OnUnitDamaged(float www) { if (!事件是否开启) { Debug.Log((object)"受伤事件当前已关闭,不触发"); } else if (启用冷却) { float num = Time.time - 上次受伤时间; if (正在冷却中 && num < 冷却时间) { Debug.Log((object)$"受伤事件冷却中,还需 {冷却时间 - num:F2} 秒"); } else if (num >= 冷却时间) { 上次受伤时间 = Time.time; 正在冷却中 = true; UnityEvent obj = 单位受伤事件ww; if (obj != null) { obj.Invoke(); } } } else { UnityEvent obj2 = 单位受伤事件ww; if (obj2 != null) { obj2.Invoke(); } } } public void 开启受伤事件() { 事件是否开启 = true; Debug.Log((object)"受伤事件已开启"); } public void 关闭受伤事件() { 事件是否开启 = false; Debug.Log((object)"受伤事件已关闭"); } public void 设置受伤事件开关(bool 是否开启) { 事件是否开启 = 是否开启; Debug.Log((object)("受伤事件已设置为: " + (是否开启 ? "开启" : "关闭"))); } public bool 获取受伤事件开关状态() { return 事件是否开启; } [IteratorStateMachine(typeof(<重置冷却>d__13))] private IEnumerator 重置冷却() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <重置冷却>d__13(0) { <>4__this = this }; } public void 重置冷却状态() { 正在冷却中 = false; 上次受伤时间 = 0f; } public void 设置冷却时间(float 新冷却时间) { 冷却时间 = Mathf.Max(0f, 新冷却时间); } public bool 是否在冷却中() { return 正在冷却中; } public float 获取剩余冷却时间() { if (!正在冷却中) { return 0f; } float num = Time.time - 上次受伤时间; float num2 = 冷却时间 - num; return Mathf.Max(0f, num2); } private void OnDestroy() { if ((Object)(object)unit != (Object)null) { Unit obj = unit; obj.WasDealtDamageAction = (Action)Delegate.Remove(obj.WasDealtDamageAction, new Action(OnUnitDamaged)); } } } public class 单位状态控制器 : MonoBehaviour { private Unit unit; private DataHandler 单位数据; public bool 平衡数据 = true; public bool 启用摔落伤害 = true; public bool 可能会摔倒 = false; private void Start() { Debug.Log((object)"获取unit组件"); unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogWarning((object)"无法获取unit组件请确保此组件为技能"); return; } 单位数据 = unit.data; if ((Object)(object)单位数据 == (Object)null) { Debug.LogWarning((object)"无法获取unit.data组件请确保单位完整性"); return; } 单位数据.takeFallDamage = 启用摔落伤害; 单位数据.canFall = 可能会摔倒; Balance component = ((Component)单位数据).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ((Behaviour)component).enabled = 平衡数据; } } public void 设置最大生命值(float h = 1f) { if (!((Object)(object)单位数据 == (Object)null)) { 单位数据.maxHealth = h; } } public void 设置最当前命值(float h1 = 1f) { if (!((Object)(object)单位数据 == (Object)null)) { if (h1 > 单位数据.maxHealth) { 单位数据.health = 单位数据.maxHealth; } else { 单位数据.health = h1; } } } public void 对当前单位造成伤害(float deamage = 1f) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)单位数据 == (Object)null)) { ((Damagable)单位数据.healthHandler).TakeDamage(deamage, 单位数据.mainRig.position, (Unit)null, (DamageType)0); } } public void 对当前单位目标造成伤害(float deamage = 1f) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)单位数据 == (Object)null) && !((Object)(object)单位数据.targetData == (Object)null)) { ((Damagable)单位数据.targetData.healthHandler).TakeDamage(deamage, 单位数据.targetData.mainRig.position, (Unit)null, (DamageType)0); } } public void 增加无敌时间(float time = 0.5f) { DataHandler data = unit.data; data.immunityForSeconds += time; } } public class 效果事件ddd : UnitEffectBase { public UnityEvent 执行效果事件; public UnityEvent 叠加效果事件; public override void DoEffect() { UnityEvent obj = 执行效果事件; if (obj != null) { obj.Invoke(); } } public override void Ping() { UnityEvent obj = 叠加效果事件; if (obj != null) { obj.Invoke(); } } } public class 颜色效果设置42 : MonoBehaviour { [Header("颜色设置")] public string colorName = "EffectColor1awq"; public Color effectColor = Color.red; public float colorIntensity = 1f; public float effectDuration = 3f; [Header("渐变设置")] public float fadeInTime = 0.5f; public float fadeOutTime = 0.5f; private UnitColorHandler colorHandler; private float currentTime = 0f; private bool isActive = false; private void Awake() { Transform root = ((Component)this).transform.root; if ((Object)(object)root != (Object)null) { colorHandler = ((Component)root).GetComponentInChildren(); } } public void ActivateColorEffect() { if ((Object)(object)colorHandler == (Object)null) { Debug.LogWarning((object)"UnitColorHandler not found!"); return; } currentTime = 0f; isActive = true; ApplyColorEffect(1f); } public void StopColorEffect() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0029: 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_0034: Expected O, but got Unknown if ((Object)(object)colorHandler == (Object)null) { return; } UnitColorInstance val = new UnitColorInstance { colorName = colorName, color = effectColor }; for (int i = 0; i < colorHandler.colors.Count; i++) { if (val.colorName == colorHandler.colors[i].colorName) { colorHandler.colors.RemoveAt(i); break; } } colorHandler.UpdateColors(); isActive = false; } private void Update() { if (isActive && !((Object)(object)colorHandler == (Object)null)) { currentTime += Time.deltaTime; if (currentTime >= effectDuration) { StopColorEffect(); return; } float intensity = CalculateCurrentIntensity(); ApplyColorEffect(intensity); } } private float CalculateCurrentIntensity() { float num = currentTime / effectDuration; if (fadeInTime > 0f && currentTime < fadeInTime) { return Mathf.Lerp(0f, colorIntensity, currentTime / fadeInTime); } if (fadeOutTime > 0f && currentTime > effectDuration - fadeOutTime) { float num2 = currentTime - (effectDuration - fadeOutTime); return Mathf.Lerp(colorIntensity, 0f, num2 / fadeOutTime); } return colorIntensity; } private void ApplyColorEffect(float intensity) { //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_0012: 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_0019: 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_0026: Expected O, but got Unknown UnitColorInstance val = new UnitColorInstance { colorName = colorName, color = effectColor, currentValue = intensity }; colorHandler.SetColor(val, intensity); } private void OnDestroy() { if (isActive && (Object)(object)colorHandler != (Object)null) { StopColorEffect(); } } } public class 计时事件q : MonoBehaviour { [CompilerGenerated] private sealed class <计时协程>d__15 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 计时事件q <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <计时协程>d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; UnityEvent 计时器触发时的事件 = <>4__this.计时器触发时的事件; if (计时器触发时的事件 != null) { 计时器触发时的事件.Invoke(); } if (!<>4__this.是否循环触发 || !<>4__this.是否正在计时) { <>4__this.是否正在计时 = false; <>4__this.正在运行的携程 = null; return false; } } else { <>1__state = -1; } <>2__current = (object)new WaitForSeconds(<>4__this.触发间隔时间); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("计时器设置")] [SerializeField] private float 触发间隔时间 = 1f; [SerializeField] private bool 启用时自动开始计时 = false; [SerializeField] private bool 是否循环触发 = true; [Header("触发事件")] public UnityEvent 计时器触发时的事件; [Header("状态显示")] [SerializeField] private bool 是否正在计时 = false; private Coroutine 正在运行的携程; private GameStateManager man; private void OnEnable() { if (启用时自动开始计时) { 开始计时(); } } private void OnDisable() { 停止计时(); } private void Start() { man = ServiceLocator.GetService(); } public void 开始计时() { if (是否正在计时) { 停止计时(); } 是否正在计时 = true; 正在运行的携程 = ((MonoBehaviour)this).StartCoroutine(计时协程()); } public void 停止计时() { if (是否正在计时) { 是否正在计时 = false; if (正在运行的携程 != null) { ((MonoBehaviour)this).StopCoroutine(正在运行的携程); 正在运行的携程 = null; } } } public void 重置并开始计时() { 停止计时(); 开始计时(); } public void 立即触发事件() { UnityEvent obj = 计时器触发时的事件; if (obj != null) { obj.Invoke(); } } public void 设置触发间隔时间(float 新间隔时间) { bool flag = 是否正在计时; if (flag) { 停止计时(); } 触发间隔时间 = 新间隔时间; if (flag) { 开始计时(); } } [IteratorStateMachine(typeof(<计时协程>d__15))] private IEnumerator 计时协程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <计时协程>d__15(0) { <>4__this = this }; } public bool 是否正在运行() { return 是否正在计时; } public float 获取触发间隔时间() { return 触发间隔时间; } public void 重新开始计时() { 开始计时(); } } public class 技能禁用装置 : MonoBehaviour { [CompilerGenerated] private sealed class <暂停技能协程>d__15 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float 秒数; public 技能禁用装置 <>4__this; private bool[] <原状态>5__1; private int 5__2; private int 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <暂停技能协程>d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <原状态>5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <原状态>5__1 = new bool[<>4__this.技能组.Length]; 5__2 = 0; while (5__2 < <>4__this.技能组.Length) { if ((Object)(object)<>4__this.技能组[5__2] != (Object)null) { <原状态>5__1[5__2] = ((Behaviour)<>4__this.技能组[5__2]).enabled; ((Behaviour)<>4__this.技能组[5__2]).enabled = false; } 5__2++; } <>2__current = (object)new WaitForSeconds(秒数); <>1__state = 1; return true; case 1: <>1__state = -1; 5__3 = 0; while (5__3 < <>4__this.技能组.Length) { if ((Object)(object)<>4__this.技能组[5__3] != (Object)null) { ((Behaviour)<>4__this.技能组[5__3]).enabled = <原状态>5__1[5__3]; } 5__3++; } Debug.Log((object)$"技能暂停 {秒数} 秒结束"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <获取技能>d__4 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 技能禁用装置 <>4__this; private int 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <获取技能>d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.技能组 = ((Component)((Component)<>4__this).transform.root).GetComponentsInChildren(); 5__1 = 0; while (5__1 < <>4__this.技能组.Length) { if ((Object)(object)<>4__this.技能组[5__1] != (Object)null) { <>4__this.技能原始状态[5__1] = ((Behaviour)<>4__this.技能组[5__1]).enabled; } 5__1++; } <>4__this.已初始化 = true; Debug.Log((object)$"技能禁用装置初始化完成,找到 {<>4__this.技能组.Length} 个技能"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private ConditionalEvent[] 技能组; private Dictionary 技能原始状态 = new Dictionary(); private bool 已初始化 = false; private void Start() { ((MonoBehaviour)this).StartCoroutine(获取技能()); } [IteratorStateMachine(typeof(<获取技能>d__4))] private IEnumerator 获取技能() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <获取技能>d__4(0) { <>4__this = this }; } public void 设置全部技能事件(bool 启用 = true) { if (!已初始化) { Debug.LogWarning((object)"技能组尚未初始化完成"); return; } ConditionalEvent[] array = 技能组; foreach (ConditionalEvent val in array) { if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = 启用; } } Debug.Log((object)("已" + (启用 ? "启用" : "禁用") + "全部技能事件")); } public void 眩晕全部技能事件(float 秒数 = 3f) { if (!已初始化) { Debug.LogWarning((object)"技能组尚未初始化完成"); return; } ConditionalEvent[] array = 技能组; foreach (ConditionalEvent val in array) { if ((Object)(object)val != (Object)null && val.isStunnable) { val.StunAllOfMyMovesFor(秒数); } } Debug.Log((object)$"已眩晕全部技能事件 {秒数} 秒"); } public void 开启特定技能(int 技能ID) { if (!已初始化) { return; } ConditionalEvent[] array = 技能组; foreach (ConditionalEvent val in array) { if ((Object)(object)val != (Object)null) { val.TurnOnEvent(技能ID); } } } public void 关闭特定技能(int 技能ID) { if (!已初始化) { return; } ConditionalEvent[] array = 技能组; foreach (ConditionalEvent val in array) { if ((Object)(object)val != (Object)null) { val.TurnOffEvent(技能ID); } } } public void 重置技能状态() { if (!已初始化) { return; } for (int i = 0; i < 技能组.Length; i++) { if ((Object)(object)技能组[i] != (Object)null && 技能原始状态.ContainsKey(i)) { ((Behaviour)技能组[i]).enabled = 技能原始状态[i]; } } Debug.Log((object)"已重置所有技能到初始状态"); } public void 增加技能范围(float 额外范围) { if (!已初始化) { return; } ConditionalEvent[] array = 技能组; foreach (ConditionalEvent val in array) { if ((Object)(object)val != (Object)null) { val.AddRangeToAllConditions(额外范围); } } Debug.Log((object)$"已为所有技能增加 {额外范围} 范围"); } public void 强制检查技能条件(bool 强制失败 = false) { if (!已初始化) { return; } ConditionalEvent[] array = 技能组; foreach (ConditionalEvent val in array) { if ((Object)(object)val != (Object)null && ((Behaviour)val).enabled) { val.CheckConditionsUpdate(强制失败); } } } public int 获取激活技能数量() { if (!已初始化) { return 0; } int num = 0; ConditionalEvent[] array = 技能组; foreach (ConditionalEvent val in array) { if ((Object)(object)val != (Object)null && ((Behaviour)val).enabled) { num++; } } return num; } public bool 检查技能是否激活(int 技能ID) { if (!已初始化) { return false; } ConditionalEvent[] array = 技能组; foreach (ConditionalEvent val in array) { if (!((Object)(object)val != (Object)null)) { continue; } ConditionalEventInstance[] events = val.events; foreach (ConditionalEventInstance val2 in events) { if (val2 != null && val2.NetworkId == 技能ID) { return val2.isOn; } } } return false; } public void 暂停所有技能(float 秒数) { if (已初始化) { ((MonoBehaviour)this).StartCoroutine(暂停技能协程(秒数)); } } [IteratorStateMachine(typeof(<暂停技能协程>d__15))] private IEnumerator 暂停技能协程(float 秒数) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <暂停技能协程>d__15(0) { <>4__this = this, 秒数 = 秒数 }; } public void 打印技能信息() { if (!已初始化 || 技能组 == null) { Debug.Log((object)"技能组未初始化"); return; } Debug.Log((object)$"=== 技能信息总览 (共 {技能组.Length} 个技能) ==="); for (int i = 0; i < 技能组.Length; i++) { ConditionalEvent val = 技能组[i]; if ((Object)(object)val == (Object)null) { continue; } Debug.Log((object)$"技能 {i}:"); Debug.Log((object)$" - 启用状态: {((Behaviour)val).enabled}"); Debug.Log((object)$" - 可被眩晕: {val.isStunnable}"); Debug.Log((object)$" - 忽略附身: {val.ignorePossession}"); Debug.Log((object)$" - 忽略死亡: {val.ignoreDead}"); ConditionalEventInstance[] events = val.events; Debug.Log((object)$" - 事件数量: {((events != null) ? events.Length : 0)}"); if (val.events == null) { continue; } for (int j = 0; j < val.events.Length; j++) { ConditionalEventInstance val2 = val.events[j]; if (val2 != null) { Debug.Log((object)$" - 事件 {j}: ID={val2.NetworkId}, 激活={val2.isOn}, 延迟={val2.delay}"); } } } } public void 清理技能冷却() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Invalid comparison between Unknown and I4 if (!已初始化) { return; } ConditionalEvent[] array = 技能组; foreach (ConditionalEvent val in array) { if ((Object)(object)val == (Object)null) { continue; } ConditionalEventInstance[] events = val.events; foreach (ConditionalEventInstance val2 in events) { if (val2 == null) { continue; } EventCondition[] conditions = val2.conditions; foreach (EventCondition val3 in conditions) { if (val3 != null && (int)val3.conditionType == 0) { val3.counter = val3.value + 1f; } } } } Debug.Log((object)"已清理所有技能冷却"); } } public class 受伤技能禁用装置 : MonoBehaviour { [CompilerGenerated] private sealed class <获取技能>d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 受伤技能禁用装置 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <获取技能>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.技能组 = ((Component)((Component)<>4__this).transform.root).GetComponentsInChildren<单位受伤事件>(); <>4__this.已初始化 = true; Debug.Log((object)$"技能禁用装置初始化完成,找到 {<>4__this.技能组.Length} 个技能"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private 单位受伤事件[] 技能组; private bool 已初始化 = false; private void Start() { ((MonoBehaviour)this).StartCoroutine(获取技能()); } [IteratorStateMachine(typeof(<获取技能>d__3))] private IEnumerator 获取技能() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <获取技能>d__3(0) { <>4__this = this }; } public void 控制全部受伤事件开启(bool a = true) { if (!已初始化) { return; } if (a) { for (int i = 0; i < 技能组.Length; i++) { 技能组[i].开启受伤事件(); } } if (!a) { for (int j = 0; j < 技能组.Length; j++) { 技能组[j].关闭受伤事件(); } } } } public class 元素召唤234 : MonoBehaviour { [CompilerGenerated] private sealed class <元素技能释放器>d__60 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float duration; public 元素召唤234 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <元素技能释放器>d__60(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(duration); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.animationeqwd.SetTrigger("suofangchufaq"); <>2__current = (object)new WaitForSeconds(1.1f); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.合成粒子位置.GetComponent().Play(); <>4__this.animationeqwd.SetTrigger("xuanzhuanchud"); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; <>4__this.元素分配43(); <>4__this.播放物体音效(<>4__this.发球融合音效位置); <>4__this.删除子物体3223(<>4__this.元素位置1); <>4__this.删除子物体3223(<>4__this.元素位置2); <>4__this.删除子物体3223(<>4__this.元素位置3); <>4__this.已积攒元素 = 0; <>4__this.技能释放控制器 = true; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <更换武器弹药携程>d__73 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 元素召唤234 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <更换武器弹药携程>d__73(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.更换武器弹药(<>4__this.冰冰冰1); <>4__this.寒冰飞弹发射位置.SetActive(true); <>4__this.魔法飞弹发射位置.SetActive(false); <>2__current = (object)new WaitForSeconds(20f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.更换武器弹药(<>4__this.魔法子弹2344); <>4__this.寒冰飞弹发射位置.SetActive(false); <>4__this.魔法飞弹发射位置.SetActive(true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <更换雷电弹药携程>d__74 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 元素召唤234 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <更换雷电弹药携程>d__74(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.更换武器弹药(<>4__this.连锁雷电球); <>4__this.雷电飞弹发射位置.SetActive(true); <>4__this.魔法飞弹发射位置.SetActive(false); <>2__current = (object)new WaitForSeconds(20f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.更换武器弹药(<>4__this.魔法子弹2344); <>4__this.雷电飞弹发射位置.SetActive(false); <>4__this.魔法飞弹发射位置.SetActive(true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <隐身saassad>d__75 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float invisibilityDuration; public 元素召唤234 <>4__this; private SkinnedMeshRenderer[] <>s__1; private int <>s__2; private SkinnedMeshRenderer 5__3; private MeshRenderer[] <>s__4; private int <>s__5; private MeshRenderer 5__6; private MeshRenderer[] <>s__7; private int <>s__8; private MeshRenderer 5__9; private SkinnedMeshRenderer[] <>s__10; private int <>s__11; private SkinnedMeshRenderer 5__12; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <隐身saassad>d__75(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; 5__3 = null; <>s__4 = null; 5__6 = null; <>s__7 = null; 5__9 = null; <>s__10 = null; 5__12 = null; <>1__state = -2; } private bool MoveNext() { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>s__1 = <>4__this.全部渲染器; for (<>s__2 = 0; <>s__2 < <>s__1.Length; <>s__2++) { 5__3 = <>s__1[<>s__2]; ((Renderer)5__3).enabled = false; 5__3 = null; } <>s__1 = null; <>s__4 = <>4__this.全部表面渲染器; for (<>s__5 = 0; <>s__5 < <>s__4.Length; <>s__5++) { 5__6 = <>s__4[<>s__5]; ((Renderer)5__6).enabled = false; 5__6 = null; } <>s__4 = null; <>4__this.unit.targetingPriorityMultiplier = float.NaN; <>2__current = (object)new WaitForSeconds(invisibilityDuration); <>1__state = 1; return true; case 1: <>1__state = -1; <>s__7 = <>4__this.全部表面渲染器; for (<>s__8 = 0; <>s__8 < <>s__7.Length; <>s__8++) { 5__9 = <>s__7[<>s__8]; ((Renderer)5__9).enabled = true; 5__9 = null; } <>s__7 = null; <>s__10 = <>4__this.全部渲染器; for (<>s__11 = 0; <>s__11 < <>s__10.Length; <>s__11++) { 5__12 = <>s__10[<>s__11]; ((Renderer)5__12).enabled = true; 5__12 = null; } <>s__10 = null; <>4__this.unit.targetingPriorityMultiplier = <>4__this.当前优先级; <>4__this.会写计时器 = 0f; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit unit; private bool 判断1 = true; private float 计时器 = 0f; private int 元素火 = 0; private int 元素冰 = 0; private int 元素雷 = 0; private int 已积攒元素 = 0; private GameObject 元素位置1; private GameObject 元素位置2; private GameObject 元素位置3; private GameObject 粒子位置; public Material 无元素材质; public Material 火元素材质; public Material 冰元素材质; public Material 雷元素材质; public GameObject 魔法子弹2344; public GameObject 冰冰冰1; public GameObject 冰火雷1; public GameObject 冰火冰1; public bool 冰雷冰1 = false; public GameObject 冰雷雷1; public GameObject 冰火火1; public UnitBlueprint 冰火火熔炉精灵1; public GameObject 雷火火1; public GameObject[] 雷雷火1; public GameObject 雷雷雷1; public GameObject 火火火1; public GameObject 冰元素求; public GameObject 火元素求; public GameObject 雷元素求; private bool 技能释放控制器 = true; public GameObject 连锁雷电球; public GameObject 近距离冲击波; public GameObject[] 混乱技能检测; private bool 开启更换弹药即时 = false; private float 会写计时器 = 0f; private bool 会写 = false; private GameObject 当前弹药; private GameObject 迷雾3423; private GameObject 合成粒子位置; private Animator animationeqwd; private SkinnedMeshRenderer[] 全部渲染器; private MeshRenderer[] 全部表面渲染器; private GameObject 魔法飞弹发射位置; private GameObject 雷电飞弹发射位置; private GameObject 寒冰飞弹发射位置; private ParticleSystem 冰火雷粒子; private ParticleSystem 冰雷粒子; private ParticleSystem 火雷粒子; private ParticleSystem 冰火粒子; private ParticleSystem 雷粒子; private ParticleSystem 冰粒子; private ParticleSystem 火粒子; private float 当前优先级; private GameObject 发球融合音效位置; public LayerMask 地面层掩码 = LayerMask.op_Implicit(512); private Material 护盾材质; private float 回血212 = 0f; public void Start() { //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Expected O, but got Unknown unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); 元素位置1 = ((Component)((Component)this).gameObject.transform.Find("旋转341").Find("元素求一号343")).gameObject; 元素位置2 = ((Component)((Component)this).gameObject.transform.Find("旋转341").Find("元素求2号324")).gameObject; 元素位置3 = ((Component)((Component)this).gameObject.transform.Find("旋转341").Find("元素求3号234")).gameObject; 粒子位置 = ((Component)((Component)this).gameObject.transform.Find("Particl3234")).gameObject; 迷雾3423 = ((Component)((Component)this).gameObject.transform.Find("迷雾位置32423")).gameObject; 当前弹药 = ((Component)this).gameObject.GetComponent().ObjectToSpawn; 全部渲染器 = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentsInChildren(); 全部表面渲染器 = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentsInChildren(); 合成粒子位置 = ((Component)((Component)this).gameObject.transform.Find("旋转341").Find("hechengchuahsd")).gameObject; animationeqwd = ((Component)((Component)this).gameObject.transform.Find("旋转341")).gameObject.GetComponent(); 魔法飞弹发射位置 = ((Component)((Component)this).gameObject.transform.Find("dsfiwefe")).gameObject; 雷电飞弹发射位置 = ((Component)((Component)this).gameObject.transform.Find("l了人球发射特效31")).gameObject; 寒冰飞弹发射位置 = ((Component)((Component)this).gameObject.transform.Find("ice冰求发射特效123")).gameObject; 冰火雷粒子 = ((Component)((Component)this).gameObject.transform.Find("召唤他微笑32").Find("雷火冰3")).gameObject.GetComponent(); 冰雷粒子 = ((Component)((Component)this).gameObject.transform.Find("召唤他微笑32").Find("雷加冰")).gameObject.GetComponent(); 火雷粒子 = ((Component)((Component)this).gameObject.transform.Find("召唤他微笑32").Find("火加雷")).gameObject.GetComponent(); 冰火粒子 = ((Component)((Component)this).gameObject.transform.Find("召唤他微笑32").Find("火加冰")).gameObject.GetComponent(); 冰粒子 = ((Component)((Component)this).gameObject.transform.Find("召唤他微笑32").Find("纯冰23")).gameObject.GetComponent(); 火粒子 = ((Component)((Component)this).gameObject.transform.Find("召唤他微笑32").Find("纯火312")).gameObject.GetComponent(); 雷粒子 = ((Component)((Component)this).gameObject.transform.Find("召唤他微笑32").Find("纯雷sdf")).gameObject.GetComponent(); 发球融合音效位置 = ((Component)((Component)this).gameObject.transform.Find("foqouusds")).gameObject; 当前优先级 = unit.targetingPriorityMultiplier; RangeWeapon componentInChildren = ((Component)this).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.shootEvent.AddListener(new UnityAction(计算元素累计)); } } public void 计算元素累计() { GameObject 父物体 = 元素位置1; if (已积攒元素 == 0) { 父物体 = 元素位置1; } if (已积攒元素 == 1) { 父物体 = 元素位置2; } if (已积攒元素 == 2) { 父物体 = 元素位置3; } int num = Random.Range(0, 3); if (技能释放控制器) { if (num == 0) { 动态元素求生成(冰元素求, 父物体); 元素冰++; } if (num == 1) { 动态元素求生成(火元素求, 父物体); 元素火++; } if (num == 2) { 动态元素求生成(雷元素求, 父物体); 元素雷++; } if (num == 3) { 动态元素求生成(火元素求, 父物体); 元素火++; } 已积攒元素++; } } public void 元素材质赋予(GameObject gameObject212, Material 元素材质) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown MeshRenderer[] componentsInChildren = gameObject212.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Renderer)componentsInChildren[i]).materials = (Material[])(object)new Material[1] { new Material(元素材质) }; } } public void 元素分配43() { //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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) Unit val = unit.data.targetData.unit; Vector3 position = val.data.mainRig.position; Vector3 position2 = ((Component)val).transform.position; if (元素冰 == 1 && 元素火 == 1 && 元素雷 == 1) { 冰火雷粒子.Play(); ((Component)this).gameObject.GetComponent().DoMove(); if (unit.data.distanceToTarget <= 15f) { TeamHolder.AddTeamHolder(Object.Instantiate(近距离冲击波, unit.data.mainRig.position, Quaternion.identity), ((Component)this).gameObject); } else { 冲击波生成1(冰火雷1); } 播放物体音效(((Component)冰火雷粒子).gameObject); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } if (元素冰 == 1 && 元素火 == 2 && 元素雷 == 0) { 冰火粒子.Play(); ((Component)this).gameObject.GetComponent().DoMove(); 生成熔炉精灵事件32(); 播放物体音效(((Component)冰粒子).gameObject); 播放物体音效(((Component)火粒子).gameObject); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } if (元素冰 == 2 && 元素火 == 1 && 元素雷 == 0) { 冰火粒子.Play(); ((Component)this).gameObject.GetComponent().DoMove(); 冰墙生成(冰火冰1); 播放物体音效(((Component)冰粒子).gameObject); 播放物体音效(((Component)火粒子).gameObject); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } if (元素冰 == 0 && 元素火 == 1 && 元素雷 == 2) { 火雷粒子.Play(); ((Component)this).gameObject.GetComponent().DoMove(); 技能生成(雷雷火1); 播放物体音效(((Component)雷粒子).gameObject); 播放物体音效(((Component)火粒子).gameObject); ((MonoBehaviour)this).StartCoroutine(更换雷电弹药携程()); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } if (元素冰 == 0 && 元素火 == 2 && 元素雷 == 1) { 火雷粒子.Play(); ((Component)((Component)this).gameObject.transform.Find("火火雷陨石31223")).gameObject.GetComponent().DoMove(); 投射物生成(雷火火1, Random.Range(-300, 300), 90f, Random.Range(-300, 300)); 播放物体音效(((Component)雷粒子).gameObject); 播放物体音效(((Component)火粒子).gameObject); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } if (元素冰 == 2 && 元素火 == 0 && 元素雷 == 1) { 冰雷粒子.Play(); ((Component)this).gameObject.GetComponent().DoMove(); 冰雷冰1 = true; 迷雾3423.GetComponent().Play(); 技能生成(混乱技能检测); 播放物体音效(((Component)雷粒子).gameObject); 播放物体音效(((Component)冰粒子).gameObject); ((MonoBehaviour)this).StartCoroutine(隐身saassad(10f)); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } if (元素冰 == 1 && 元素火 == 0 && 元素雷 == 2) { 冰雷粒子.Play(); ((Component)this).gameObject.GetComponent().DoMove(); TeamHolder.AddTeamHolder(Object.Instantiate(冰雷雷1, position2, Quaternion.identity), ((Component)this).gameObject); 播放物体音效(((Component)雷粒子).gameObject); 播放物体音效(((Component)冰粒子).gameObject); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } if (元素冰 == 3 && 元素火 == 0 && 元素雷 == 0) { 冰粒子.Play(); ((Component)this).gameObject.GetComponent().DoMove(); 播放物体音效(((Component)冰粒子).gameObject); ((MonoBehaviour)this).StartCoroutine(更换武器弹药携程()); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } if (元素冰 == 0 && 元素火 == 3 && 元素雷 == 0) { 火粒子.Play(); ((Component)this).gameObject.GetComponent().DoMove(); TeamHolder.AddTeamHolder(Object.Instantiate(火火火1, position, Quaternion.identity), ((Component)this).gameObject); 播放物体音效(((Component)火粒子).gameObject); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } if (元素冰 == 0 && 元素火 == 0 && 元素雷 == 3) { 雷粒子.Play(); ((Component)this).gameObject.GetComponent().DoMove(); TeamHolder.AddTeamHolder(Object.Instantiate(雷雷雷1, position, Quaternion.identity), ((Component)this).gameObject); 播放物体音效(((Component)雷粒子).gameObject); 元素冰 = 0; 元素火 = 0; 元素雷 = 0; } } [IteratorStateMachine(typeof(<元素技能释放器>d__60))] private IEnumerator 元素技能释放器(float duration = 0.5f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <元素技能释放器>d__60(0) { <>4__this = this, duration = duration }; } public void 元素技能生成() { if (元素冰 + 元素火 + 元素雷 >= 3 && 技能释放控制器) { 技能释放控制器 = false; ((MonoBehaviour)this).StartCoroutine(元素技能释放器()); } } public void 火火冰熔炉精灵生成32(Vector3 补偿位置, UnitBlueprint unitBlueprint223) { //IL_0008: 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) //IL_000e: 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_0024: Unknown result type (might be due to invalid IL or missing references) unitBlueprint223.Spawn(获取地面位置345() + 补偿位置, 获取面向目标y轴旋转(), unit.data.team, 1f, (UnitPoolInfo?)null); } private void 生成熔炉精灵事件32() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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) GameObject val = new GameObject(); val.transform.position = ((Component)unit.data.mainRig).transform.position; val.transform.rotation = 获取面向目标y轴旋转(); try { 火火冰熔炉精灵生成32(val.transform.right * 10f, 冰火火熔炉精灵1); 火火冰熔炉精灵生成32(val.transform.right * -10f, 冰火火熔炉精灵1); } finally { Object.Destroy((Object)(object)val); } } public void 投射物生成(GameObject gameObject321, float x, float y, float z) { //IL_0022: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) Unit val = unit.data.targetData.unit; Vector3 val2 = val.data.mainRig.position + new Vector3(x, y, z); Quaternion val3 = Quaternion.LookRotation(val.data.mainRig.position - val2); TeamHolder.AddTeamHolder(Object.Instantiate(gameObject321, val2, val3), ((Component)this).gameObject); } public void 冲击波生成1(GameObject gameObject34545) { //IL_0020: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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) Quaternion val = Quaternion.LookRotation(unit.data.targetData.unit.data.mainRig.position - unit.data.mainRig.position); GameObject val2 = Object.Instantiate(gameObject34545, unit.data.mainRig.position + ((Component)unit.data.mainRig).transform.forward * 2f, val); GameObject gameObject34546 = ((Component)val2.transform.Find("冲及波455")).gameObject; TeamHolder.AddTeamHolder(gameObject34546, ((Component)this).gameObject); } public void 动态元素求生成(GameObject 子物体, GameObject 父物体) { Object.Instantiate(子物体, 父物体.transform); } public void 技能生成(GameObject[] move23) { //IL_002e: 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) if (move23 == null) { return; } for (int i = 0; i < move23.Length; i++) { if (!((Object)(object)move23[i] == (Object)null)) { GameObject val = Object.Instantiate(move23[i], ((Component)unit).transform.position, ((Component)unit).transform.rotation, ((Component)unit).transform); TeamHolder.AddTeamHolder(move23[i], ((Component)this).gameObject); } } } public void 冰墙生成(GameObject gameObject321) { //IL_0022: 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) float distanceToTarget = unit.data.distanceToTarget; int num = (int)distanceToTarget; float 密度间隔 = 2f; GameObject val = Object.Instantiate(gameObject321, 获取地面位置345(), 获取面向目标y轴旋转()); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); val.GetComponentInChildren<冰墙召唤13222>().数量 = num / 3; val.GetComponentInChildren<冰墙召唤13222>().密度间隔 = 密度间隔; val.GetComponentInChildren<冰墙召唤13222>().召唤时间间隔 = 0.1f; } private Quaternion 获取面向目标y轴旋转() { //IL_0020: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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) Quaternion val = Quaternion.LookRotation(unit.data.targetData.unit.data.mainRig.position - unit.data.mainRig.position); Vector3 eulerAngles = ((Quaternion)(ref val)).eulerAngles; return Quaternion.Euler(0f, eulerAngles.y, 0f); } public Vector3 获取地面位置345(float 检测高度 = 30f) { //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) //IL_0017: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0031: 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_003b: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = unit.data.mainRig.position; Vector3 val = position + Vector3.up * 检测高度; float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, LayerMask.op_Implicit(地面层掩码))) { return ((RaycastHit)(ref val2)).point; } return ((Component)this).transform.position; } public void 删除子物体3223(GameObject gameObject23423) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown foreach (Transform item in gameObject23423.transform) { Transform val = item; Object.Destroy((Object)(object)((Component)val).gameObject); } } public void 更换武器弹药(GameObject 打麻药) { RangeWeapon component = ((Component)this).gameObject.GetComponent(); component.ObjectToSpawn = 打麻药; } [IteratorStateMachine(typeof(<更换武器弹药携程>d__73))] private IEnumerator 更换武器弹药携程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <更换武器弹药携程>d__73(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<更换雷电弹药携程>d__74))] private IEnumerator 更换雷电弹药携程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <更换雷电弹药携程>d__74(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<隐身saassad>d__75))] private IEnumerator 隐身saassad(float invisibilityDuration = 12f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <隐身saassad>d__75(0) { <>4__this = this, invisibilityDuration = invisibilityDuration }; } private void 单位回血(float heer) { if (unit.data.health < unit.data.maxHealth) { DataHandler data = unit.data; data.health += heer; } else if (((Component)this).GetComponentInChildren<护盾脚本>().护盾值 < 4000f) { ((Component)this).GetComponentInChildren<护盾脚本>().护盾值 += heer; } } private void 护盾shah() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) 迷雾3423.transform.position = unit.data.mainRig.position; if (冰雷冰1) { 会写计时器 += Time.deltaTime; 回血212 += Time.deltaTime; if ((double)回血212 > 0.1) { 单位回血(50f); 回血212 = 0f; } if (会写计时器 >= 10f) { 冰雷冰1 = false; } } } private void 播放物体音效(GameObject 拥有音效控制器脚本物体) { if ((Object)(object)拥有音效控制器脚本物体 == (Object)null) { Debug.LogWarning((object)"目标物体为空"); return; } PlaySoundEffect component = 拥有音效控制器脚本物体.GetComponent(); if ((Object)(object)component != (Object)null) { component.Go(); } else { Debug.LogWarning((object)("物体 " + ((Object)拥有音效控制器脚本物体).name + " 上没有找到 PlaySoundEffect 组件")); } } public void Update() { 元素技能生成(); 设置平滑跟随(((Component)((Component)this).gameObject.transform.Find("旋转341")).gameObject, ((Component)unit.data.mainRig).gameObject); 护盾shah(); } public void 设置平滑跟随(GameObject 物体, GameObject 跟随物体, float 速度 = 0.3f) { //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_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_001e: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Vector3 zero = Vector3.zero; Vector3 zero2 = Vector3.zero; Vector3 val = 跟随物体.transform.position + 跟随物体.transform.forward * -1.5f; 物体.transform.position = Vector3.SmoothDamp(物体.transform.position, val, ref zero2, 速度); } } public class 火焰柱召唤23 : MonoBehaviour { private Unit unit; private bool 判断1 = true; private float 计时器 = 0f; public float cd = 0.2f; public GameObject exp23; private LayerMask 地面层掩码 = LayerMask.op_Implicit(512); public void Start() { } public Vector3 获取随机地面位置(float 范围 = 4f, float 检测高度 = 100f) { //IL_0007: 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_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_002c: 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_0033: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_006d: 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) Vector3 val = ((Component)this).transform.position + new Vector3(Random.Range(0f - 范围, 范围), 0f, Random.Range(0f - 范围, 范围)); Vector3 val2 = val + Vector3.up * 检测高度; float num = 检测高度 * 10f; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val2, Vector3.down, ref val3, num, LayerMask.op_Implicit(地面层掩码))) { return ((RaycastHit)(ref val3)).point; } return ((Component)this).transform.position; } public void Update() { //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) if (Object.op_Implicit((Object)(object)((Component)this).gameObject)) { 计时器 += Time.deltaTime; if (计时器 > cd) { TeamHolder.AddTeamHolder(Object.Instantiate(exp23, 获取随机地面位置(12f, 10f), Quaternion.identity), ((Component)this).gameObject); 计时器 = 0f; } } } } public class 无物理弹性 : MonoBehaviour { public void Start() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown PhysicMaterial val = new PhysicMaterial(); val.bounciness = 0f; val.bounceCombine = (PhysicMaterialCombine)3; Collider componentInChildren = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); componentInChildren.material = val; } } public class 刚体抽搐效果23 : MonoBehaviour { [Header("抽搐设置")] public List connectedBodies = new List(); public float twitchForce = 100f; public float twitchTorque = 5f; public float minTwitchInterval = 0.1f; public float maxTwitchInterval = 0.5f; [Header("抽搐范围")] public Vector3 forceRange = new Vector3(1f, 1f, 1f); public Vector3 torqueRange = new Vector3(1f, 1f, 1f); private float nextTwitchTime; private List joints = new List(); private void Start() { if (connectedBodies.Count == 0) { Rigidbody[] componentsInChildren = ((Component)this).GetComponentsInChildren(); connectedBodies.AddRange(componentsInChildren); } ConfigurableJoint[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(); joints.AddRange(componentsInChildren2); nextTwitchTime = Time.time + Random.Range(minTwitchInterval, maxTwitchInterval); } private void Update() { nextTwitchTime += Time.deltaTime; if (nextTwitchTime >= 0.2f) { TwitchRandomBody(); nextTwitchTime = Time.time + Random.Range(minTwitchInterval, maxTwitchInterval); } } private void TwitchRandomBody() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) if (connectedBodies.Count != 0) { int index = Random.Range(0, connectedBodies.Count); Rigidbody val = connectedBodies[index]; if ((Object)(object)val != (Object)null) { Vector3 val2 = new Vector3(Random.Range(0f - forceRange.x, forceRange.x), Random.Range(0f - forceRange.y, forceRange.y), Random.Range(0f - forceRange.z, forceRange.z)) * twitchForce; val.AddForce(val2, (ForceMode)1); Vector3 val3 = new Vector3(Random.Range(0f - torqueRange.x, torqueRange.x), Random.Range(0f - torqueRange.y, torqueRange.y), Random.Range(0f - torqueRange.z, torqueRange.z)) * twitchTorque; val.AddTorque(val3, (ForceMode)1); } } } public void TriggerTwitch() { TwitchRandomBody(); } public void TriggerAllBodiesTwitch() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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) //IL_0100: Unknown result type (might be due to invalid IL or missing references) foreach (Rigidbody connectedBody in connectedBodies) { if ((Object)(object)connectedBody != (Object)null) { Vector3 val = new Vector3(Random.Range(0f - forceRange.x, forceRange.x), Random.Range(0f - forceRange.y, forceRange.y), Random.Range(0f - forceRange.z, forceRange.z)) * twitchForce; Vector3 val2 = new Vector3(Random.Range(0f - torqueRange.x, torqueRange.x), Random.Range(0f - torqueRange.y, torqueRange.y), Random.Range(0f - torqueRange.z, torqueRange.z)) * twitchTorque; connectedBody.AddForce(val, (ForceMode)1); connectedBody.AddTorque(val2, (ForceMode)1); } } } } public class 断开Joints连接 : MonoBehaviour { [CompilerGenerated] private sealed class <爆炸234>d__4 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float duration; public 断开Joints连接 <>4__this; private GameObject 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <爆炸234>d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = ((Component)((Component)<>4__this).gameObject.transform.Find("Rigidbodies").Find("Torso").Find("ersgweewfew")).gameObject; ((Component)((Component)<>4__this).gameObject.transform.Find("Rigidbodies").Find("Torso").Find("ersgweewfew")).gameObject.GetComponentInChildren().Play(); ((Component)((Component)<>4__this).gameObject.transform.Find("Rigidbodies").Find("Torso").Find("ersgweewfew")).gameObject.GetComponentInChildren().Go(); <>2__current = (object)new WaitForSeconds(duration); <>1__state = 1; return true; case 1: <>1__state = -1; TeamHolder.AddTeamHolder(Object.Instantiate(<>4__this.exp34, 5__1.transform.position, Quaternion.identity), ((Component)<>4__this).gameObject); <>4__this.DestroyAllJoints(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public GameObject exp34; private Unit unit; private float 几十万; public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); unit.data.healthHandler.AddDieAction((Action)delegate { ((MonoBehaviour)this).StartCoroutine(爆炸234()); }); } [IteratorStateMachine(typeof(<爆炸234>d__4))] private IEnumerator 爆炸234(float duration = 4f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <爆炸234>d__4(0) { <>4__this = this, duration = duration }; } private void DestroyAllJoints() { ConfigurableJoint[] componentsInChildren = ((Component)this).GetComponentsInChildren(); ConfigurableJoint[] array = componentsInChildren; foreach (ConfigurableJoint val in array) { Object.Destroy((Object)(object)val); } Debug.Log((object)$"已销毁 {componentsInChildren.Length} 个连接关节"); } } public class 兵种ai地面检测 : MonoBehaviour { private Unit unit; private bool 判断1 = true; private float 计时器 = 0f; private LayerMask 地面层掩码 = LayerMask.op_Implicit(512); public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); } public Vector3 获取地面位置(float 检测高度 = 10f) { //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) //IL_0017: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0031: 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_003b: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = unit.data.mainRig.position; Vector3 val = position + Vector3.up * 检测高度; float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, LayerMask.op_Implicit(地面层掩码))) { return ((RaycastHit)(ref val2)).point; } return ((Component)this).transform.position; } public void Update() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)unit)) { 计时器 += Time.deltaTime; if (计时器 > 1f) { unit.data.TouchGround(获取地面位置(), 获取地面位置(), (Rigidbody)null); } } } } public class 位置召唤游戏物体324 : MonoBehaviour { private Unit unit; private float 计时器 = 0f; public float cd = 1f; public GameObject exp; public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); } private void spwow(GameObject gameObject121, Vector3 pont, Vector3 buchangpont, Quaternion quaternion) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) TeamHolder.AddTeamHolder(Object.Instantiate(gameObject121, pont + buchangpont, quaternion), ((Component)this).gameObject); } public void Update() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)unit) && !unit.data.Dead) { 计时器 += Time.deltaTime; if (计时器 > cd) { spwow(exp, unit.data.mainRig.position, new Vector3(0f, 0f, 0f), Quaternion.identity); ((Damagable)unit.data.healthHandler).TakeDamage(100f, ((Component)unit).transform.position, unit, (DamageType)0); 计时器 = 0f; } } } } public class 冰墙召唤13222 : MonoBehaviour { public GameObject 无实体短暂冰墙; public UnitBlueprint 有实体冰墙; public float 初始密度间隔 = 1f; public float 密度间隔 = 2f; public float 召唤时间间隔 = 0.5f; public bool 停止释放 = false; public int 初始数量 = 0; public int 数量 = 10; private Transform objtan; private float 计时器; public void Start() { objtan = ((Component)this).gameObject.transform; } private void 召唤www() { //IL_0018: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_003a: 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) //IL_004d: 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_00ac: 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) if (!停止释放) { Vector3 forward = objtan.forward; Vector3 val = objtan.position + forward * 初始密度间隔; TeamHolder.AddTeamHolder(Object.Instantiate(无实体短暂冰墙, val, ((Component)this).gameObject.transform.rotation), ((Component)this).gameObject); 初始密度间隔 += 密度间隔; 初始数量++; if (初始数量 >= 数量) { 有实体冰墙.Spawn(val, ((Component)this).gameObject.transform.rotation, ((Component)this).gameObject.GetComponentInChildren().team, 1f, (UnitPoolInfo?)null); 停止释放 = true; Object.Destroy((Object)(object)((Component)this).gameObject); } } } public void Update() { if (Object.op_Implicit((Object)(object)((Component)this).gameObject)) { 计时器 += Time.deltaTime; if (计时器 > 召唤时间间隔) { 召唤www(); 计时器 = 0f; } } } } public class n秒后移除物体 : MonoBehaviour { public float cd = 20f; public void Start() { Object.Destroy((Object)(object)((Component)this).gameObject, cd); } } public class 可调用物体 : MonoBehaviour { public float cd = 10f; public void dele(float oioi) { Object.Destroy((Object)(object)((Component)this).gameObject, oioi); } } public class 最近单位获取1 : MonoBehaviour { public bool useUnitTeam = false; private Unit unit; private Team team; private TeamHolder teamholder; private TeamSystem m_teamSystem; private List orderedUnits; private void Start() { SetTeamSystem(); } private List GetUnitsAndSort() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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) team = GetTeam(); List teamUnits = m_teamSystem.GetTeamUnits((Team)(((int)team == 0) ? 1 : 0)); teamUnits.Sort((Unit x, Unit y) => Vector3.Distance(((Component)this).transform.position, x.data.mainRig.position).CompareTo(Vector3.Distance(((Component)this).transform.position, y.data.mainRig.position))); return teamUnits; } public List GetTargets(float? maxRange = 0f) { //IL_004e: 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) orderedUnits = new List(); orderedUnits.AddRange(GetUnitsAndSort()); if (maxRange != 0f) { for (int i = 0; i < orderedUnits.Count; i++) { if (Vector3.Distance(((Component)this).transform.position, ((Component)orderedUnits[i].data.mainRig).transform.position) > maxRange) { orderedUnits.RemoveRange(i, orderedUnits.Count - i); break; } } } return orderedUnits; } private Team GetTeam() { //IL_0066: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (useUnitTeam) { unit = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)unit)) { team = unit.Team; } } else { teamholder = ((Component)((Component)this).transform).GetComponent(); if (Object.op_Implicit((Object)(object)teamholder)) { team = teamholder.team; } } return team; } private void SetTeamSystem() { m_teamSystem = World.Active.GetOrCreateManager(); } } public class 雷电传播 : MonoBehaviour { private float 计时器 = 0f; private float 计时器2 = 0f; public GameObject exp43; public float 传播速度 = 0.1f; public float 传播范围 = 800f; private ParticleSystem 粒子效果; private Explosion 爆炸效果; private 最近单位获取1 单位获取器; private List 已传播单位 = new List(); private bool 启用 = true; public int 最大攻击数量 = 20; private int 当前攻击数量; private PlaySoundEffect 音频播放器; public void Start() { 单位获取器 = ((Component)this).GetComponent<最近单位获取1>(); 粒子效果 = ((Component)((Component)this).gameObject.transform.Find("zhajd")).GetComponent(); 爆炸效果 = ((Component)((Component)this).gameObject.transform.Find("zhajd")).GetComponent(); 音频播放器 = ((Component)this).gameObject.GetComponent(); 当前攻击数量 = 0; } private Unit 获取下一个目标() { List targets = 单位获取器.GetTargets(传播范围); if (targets == null || targets.Count == 0) { 启用 = false; return null; } targets = targets.Where((Unit unit) => !已传播单位.Contains(unit)).ToList(); if (targets.Count == 0) { 启用 = false; return null; } Unit val = targets[0]; 已传播单位.Add(val); return val; } private void 执行连锁闪电() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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) Unit val = 获取下一个目标(); if (!((Object)(object)val == (Object)null)) { Vector3 position = val.data.mainRig.position; ((Component)this).transform.position = position; 粒子效果.Play(); 爆炸效果.Explode(); 音频播放器.Go(); 当前攻击数量++; if (当前攻击数量 >= 最大攻击数量) { 启用 = false; } } } public void Update() { 计时器 += Time.deltaTime; if (计时器 > 传播速度 && 启用) { 执行连锁闪电(); 计时器 = 0f; } if (!启用) { 计时器2 += Time.deltaTime; if (计时器2 > 2f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public class 可视化护盾条 : MonoBehaviour { private Unit unit; private 护盾脚本 护盾脚本1; private float 当前护盾值; public float 最大护盾值 = 4000f; [Header("UI引用")] private GameObject healthBarCanvas; private Slider healthSlider; private Image fillImage; private TextMeshProUGUI 护盾数值文本; [Header("跟随设置")] public Vector3 offset = new Vector3(0f, 0.6f, 0f); [Header("外观设置")] public Color 护盾颜色 = Color.green; [Header("数值显示设置")] public bool 显示数值 = true; public Color 文本颜色 = Color.gray; public int 字体大小 = 1; public Vector2 文本偏移 = new Vector2(0f, 0f); private Camera mainCamera; private bool ui组件初始化成功 = false; private SettingsInstance 游戏内健康条状态; private GlobalSettingsHandler settingsHandler; private bool 健康条已启用 = true; private ParticleSystem system234; private GameObject system23412; private void Start() { //IL_00cf: 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) system234 = ((Component)((Component)this).transform.Find("xcjhhsdee")).GetComponent(); system23412 = ((Component)((Component)this).transform.Find("xcjhhsdee")).gameObject; ui组件初始化成功 = 初始化UI组件(); if (!ui组件初始化成功) { Debug.LogError((object)"UI组件初始化失败!"); return; } SetWorldSpace(); mainCamera = Camera.main; 初始化引用(); if ((Object)(object)healthSlider != (Object)null) { healthSlider.maxValue = 最大护盾值; healthSlider.value = 当前护盾值; } 初始化数值文本(); 健康条已启用 = 获取健康条设置(); healthBarCanvas.transform.position = 获取头部位置() + offset; 更新护盾条外观(); } private bool 获取健康条设置() { try { settingsHandler = ServiceLocator.GetService(); if ((Object)(object)settingsHandler != (Object)null) { 游戏内健康条状态 = settingsHandler.GetSettingsInstance("GAMEPLAY_HEALTHBARS"); if (游戏内健康条状态 != null) { return 游戏内健康条状态.currentValue == 1; } } } catch (Exception ex) { Debug.LogWarning((object)("获取健康条设置时出错: " + ex.Message)); } return true; } private void SetWorldSpace() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) Canvas val = healthBarCanvas.GetComponent(); if ((Object)(object)val == (Object)null) { val = healthBarCanvas.AddComponent(); } val.renderMode = (RenderMode)2; RectTransform component = healthBarCanvas.GetComponent(); component.sizeDelta = new Vector2(2f, 0.3f); } private bool 初始化UI组件() { try { healthBarCanvas = ((Component)((Component)this).transform.Find("美观234护盾条")).gameObject; if ((Object)(object)healthBarCanvas == (Object)null) { Debug.LogError((object)"找不到 '美观234护盾条' 游戏对象"); return false; } Canvas component = healthBarCanvas.GetComponent(); if ((Object)(object)component != (Object)null) { component.renderMode = (RenderMode)2; } Transform val = ((Component)component).transform.Find("护盾条42"); if ((Object)(object)val == (Object)null) { Debug.LogError((object)"找不到 '护盾条42'"); return false; } healthSlider = ((Component)val).GetComponent(); if ((Object)(object)healthSlider == (Object)null) { Debug.LogError((object)"在 '护盾条42' 上找不到 Slider 组件"); return false; } Transform val2 = val.Find("Fill Area"); if ((Object)(object)val2 == (Object)null) { Debug.LogError((object)"找不到 'Fill Area'"); return false; } Transform val3 = val2.Find("Fill"); if ((Object)(object)val3 == (Object)null) { Debug.LogError((object)"找不到 'Fill'"); return false; } fillImage = ((Component)val3).GetComponent(); if ((Object)(object)fillImage == (Object)null) { Debug.LogError((object)"在 'Fill' 上找不到 Image 组件"); return false; } Debug.Log((object)"UI组件初始化成功!"); return true; } catch (Exception ex) { Debug.LogError((object)("初始化UI组件时出错: " + ex.Message)); return false; } } private void 初始化数值文本() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Invalid comparison between Unknown and I4 //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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) try { Transform val = healthBarCanvas.transform.Find("护盾条42"); if ((Object)(object)val == (Object)null) { return; } Transform val2 = val.Find("护盾数值文本"); GameObject val3; if ((Object)(object)val2 != (Object)null) { val3 = ((Component)val2).gameObject; } else { val3 = new GameObject("护盾数值文本"); val3.transform.SetParent(val, false); RectTransform val4 = val3.AddComponent(); val4.sizeDelta = new Vector2(200f, 50f); val4.anchoredPosition = 文本偏移; 护盾数值文本 = val3.AddComponent(); } if ((Object)(object)护盾数值文本 == (Object)null) { 护盾数值文本 = val3.GetComponent(); if ((Object)(object)护盾数值文本 == (Object)null) { 护盾数值文本 = val3.AddComponent(); } } if ((int)unit.data.team == 0) { 文本颜色 = Color.red; } else { 文本颜色 = Color.blue; } ((Graphic)护盾数值文本).color = 文本颜色; ((TMP_Text)护盾数值文本).fontSize = 字体大小; ((TMP_Text)护盾数值文本).alignment = (TextAlignmentOptions)514; ((TMP_Text)护盾数值文本).enableAutoSizing = true; ((TMP_Text)护盾数值文本).fontSizeMin = 0f; ((TMP_Text)护盾数值文本).fontSizeMax = 字体大小; 更新数值文本(); Debug.Log((object)"数值文本初始化成功!"); } catch (Exception ex) { Debug.LogError((object)("初始化数值文本时出错: " + ex.Message)); } } private void 初始化引用() { try { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); 护盾脚本1 = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<护盾脚本>(); if ((Object)(object)护盾脚本1 != (Object)null) { 当前护盾值 = 护盾脚本1.护盾值; } else { Debug.LogWarning((object)"未找到护盾脚本!"); } } catch (Exception ex) { Debug.LogError((object)("初始化引用时出错: " + ex.Message)); } } private void Update() { if (ui组件初始化成功) { 检查设置变化(); 更新护盾值(); 更新位置和旋转(); 更新UI显示(); } } private void 检查设置变化() { bool flag = 获取健康条设置(); if (flag != 健康条已启用) { 健康条已启用 = flag; 更新护盾条可见性(); } } private void 更新护盾值() { if ((Object)(object)护盾脚本1 != (Object)null) { float 护盾值 = 护盾脚本1.护盾值; if (护盾值 != 当前护盾值) { 当前护盾值 = 护盾值; 更新护盾条可见性(); } } } private void 更新位置和旋转() { //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) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)healthBarCanvas == (Object)null || (Object)(object)mainCamera == (Object)null) { return; } try { Vector3 val = 获取头部位置(); healthBarCanvas.transform.position = val + offset; 面向摄像机(); } catch (Exception ex) { Debug.LogWarning((object)("更新护盾条位置时出错: " + ex.Message)); } } private Vector3 获取头部位置() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_006c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)unit != (Object)null && (Object)(object)unit.data != (Object)null && (Object)(object)unit.data.head != (Object)null) { return ((Component)unit.data.head).transform.position; } return ((Component)this).transform.position; } private void 面向摄像机() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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) if (!((Object)(object)mainCamera == (Object)null)) { healthBarCanvas.transform.LookAt(healthBarCanvas.transform.position + ((Component)mainCamera).transform.rotation * Vector3.forward, ((Component)mainCamera).transform.rotation * Vector3.up); } } private void 更新UI显示() { if ((Object)(object)healthSlider != (Object)null) { healthSlider.value = 当前护盾值; } 更新数值文本(); } private void 更新数值文本() { if ((Object)(object)护盾数值文本 != (Object)null) { if (显示数值 && 当前护盾值 > 0f && 健康条已启用) { ((TMP_Text)护盾数值文本).text = $"{当前护盾值:F0}/{最大护盾值:F0}"; ((Component)护盾数值文本).gameObject.SetActive(true); } else { ((Component)护盾数值文本).gameObject.SetActive(false); } } } private void 更新护盾条可见性() { if ((Object)(object)healthBarCanvas != (Object)null) { bool flag = 健康条已启用 && 当前护盾值 > 0f; if (healthBarCanvas.activeSelf != flag) { healthBarCanvas.SetActive(flag); system23412.SetActive(flag); } } } private void 更新护盾条外观() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fillImage != (Object)null) { ((Graphic)fillImage).color = 护盾颜色; } 更新护盾条可见性(); 更新数值文本(); } public void 强制更新护盾显示() { 初始化引用(); 健康条已启用 = 获取健康条设置(); 更新护盾条外观(); } private void OnEnable() { if ((Object)(object)healthBarCanvas != (Object)null && ui组件初始化成功) { 健康条已启用 = 获取健康条设置(); 更新护盾条可见性(); 更新数值文本(); } } private void OnDisable() { if ((Object)(object)healthBarCanvas != (Object)null && ui组件初始化成功) { healthBarCanvas.SetActive(false); } } private void OnDrawGizmosSelected() { //IL_001c: 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) if (Application.isPlaying && (Object)(object)healthBarCanvas != (Object)null) { Gizmos.color = Color.blue; Gizmos.DrawWireSphere(healthBarCanvas.transform.position, 0.1f); } } public void 设置数值显示(bool 显示) { 显示数值 = 显示; 更新数值文本(); } public void 设置文本颜色(Color 颜色) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) 文本颜色 = 颜色; if ((Object)(object)护盾数值文本 != (Object)null) { ((Graphic)护盾数值文本).color = 文本颜色; } } public void 设置健康条状态(bool 启用) { 健康条已启用 = 启用; 更新护盾条可见性(); 更新数值文本(); } public bool 获取当前健康条状态() { return 健康条已启用; } } public class 冲击波无有伤脚本 : MonoBehaviour { public void Start() { TeamHolder.AddTeamHolder(((Component)((Component)this).gameObject.transform.Find("冲及波455")).gameObject, ((Component)this).gameObject); } } [StructLayout(LayoutKind.Sequential, Size = 1)] public struct 被斧王嘲讽单位 : ITargetingComponent, IComponentData { } [StructLayout(LayoutKind.Sequential, Size = 1)] public struct 斧王专用标签 : IComponentData { } public class 设置攻击对象www : MonoBehaviour { [CompilerGenerated] private sealed class d__11 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 设置攻击对象www <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.isTauntActive = true; if ((Object)(object)<>4__this.unitAPI != (Object)null) { <>4__this.unitAPI.SetTargetingType((ITargetingComponent)(object)default(被斧王嘲讽单位)); } <>4__this.正在被嘲讽 = true; <>2__current = (object)new WaitForSeconds(<>4__this.tauntDuration); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>4__this.unitAPI != (Object)null) { <>4__this.unitAPI.SetTargetingType(<>4__this.unitAPI.DefaultTargetingType); } <>4__this.正在被嘲讽 = false; <>4__this.isTauntActive = false; <>4__this.activeTauntCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("嘲讽设置")] [SerializeField] private float tauntDuration = 12f; private UnitAPI unitAPI; private Coroutine activeTauntCoroutine; private bool isTauntActive = false; private bool 正在被嘲讽 = false; [Range(0f, 1f)] public float 伤害倍率 = 0.25f; public bool 当前嘲讽状态 { get { return 正在被嘲讽; } set { } } private void Start() { unitAPI = ((Component)((Component)this).transform.root).GetComponent(); if (!((Object)(object)unitAPI != (Object)null)) { Debug.LogError((object)("UnitAPI组件未找到在 " + ((Object)((Component)this).transform.root).name + " 上"), (Object)(object)this); } } private void OnDestroy() { StopAllTauntCoroutines(); if (isTauntActive && (Object)(object)unitAPI != (Object)null) { unitAPI.SetTargetingType(unitAPI.DefaultTargetingType); } } [IteratorStateMachine(typeof(d__11))] private IEnumerator TauntCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this }; } private void StopAllTauntCoroutines() { if (activeTauntCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(activeTauntCoroutine); activeTauntCoroutine = null; } isTauntActive = false; } public void 启用新的嘲讽效果() { StopAllTauntCoroutines(); if ((Object)(object)unitAPI != (Object)null && ((Component)this).gameObject.activeInHierarchy) { activeTauntCoroutine = ((MonoBehaviour)this).StartCoroutine(TauntCoroutine()); } } public void 强制停止所有效果() { StopAllTauntCoroutines(); } public bool IsTauntActive() { return isTauntActive; } public float GetRemainingTauntTime() { if (!isTauntActive || activeTauntCoroutine == null) { return 0f; } return 0f; } } public class 斧王api : MonoBehaviour, IRemotelyControllable { [CompilerGenerated] private sealed class d__5 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 斧王api <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.InitializeECSUnit(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 斧王api <>4__this; private int 5__1; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 10; 5__2 = 0; break; case 1: <>1__state = -1; 5__2++; break; } if (5__2 < 5__1 && (!((Object)(object)<>4__this.m_goEntity != (Object)null) || <>4__this.m_goEntity.EntityManager == null)) { <>2__current = null; <>1__state = 1; return true; } <>4__this.InitializeECSUnit(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private GameObjectEntity m_goEntity; private bool m_isInitialized = false; public bool IsRemotelyControlled => false; private void Awake() { m_goEntity = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); if ((Object)(object)m_goEntity == (Object)null) { m_goEntity = ((Component)((Component)this).transform.root).gameObject.AddComponent(); Debug.Log((object)"添加了 GameObjectEntity 组件", (Object)(object)((Component)this).gameObject); } ((MonoBehaviour)this).StartCoroutine(InitializeWhenReady()); } [IteratorStateMachine(typeof(d__3))] private IEnumerator InitializeWhenReady() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { <>4__this = this }; } private void Start() { if (!m_isInitialized) { ((MonoBehaviour)this).StartCoroutine(DelayedInitialize()); } } [IteratorStateMachine(typeof(d__5))] private IEnumerator DelayedInitialize() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { <>4__this = this }; } private void InitializeECSUnit() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00ec: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (World.Active == null) { Debug.LogWarning((object)$"ECS World 尚未激活: DefaultWorld, Active={World.Active}", (Object)(object)((Component)this).gameObject); return; } if ((Object)(object)m_goEntity == (Object)null) { Debug.LogError((object)"GameObjectEntity 组件丢失", (Object)(object)((Component)this).gameObject); return; } if (m_goEntity.Entity == Entity.Null) { Debug.LogWarning((object)"Entity 尚未创建,将稍后重试", (Object)(object)((Component)this).gameObject); return; } EntityManager entityManager = m_goEntity.EntityManager; if (entityManager == null) { Debug.LogError((object)"实体管理器为空", (Object)(object)((Component)this).gameObject); return; } Entity entity = m_goEntity.Entity; if (!entityManager.HasComponent<斧王专用标签>(entity)) { try { entityManager.AddComponentData<斧王专用标签>(entity, default(斧王专用标签)); Debug.Log((object)$"成功添加斧王专用标签到实体: {entity.Index}", (Object)(object)((Component)this).gameObject); m_isInitialized = true; if (entityManager.HasComponent<斧王专用标签>(entity)) { Debug.Log((object)$"验证成功: 实体 {entity.Index} 已拥有斧王专用标签", (Object)(object)((Component)this).gameObject); } else { Debug.LogError((object)$"验证失败: 实体 {entity.Index} 未检测到斧王专用标签", (Object)(object)((Component)this).gameObject); } return; } catch (Exception ex) { Debug.LogError((object)("添加组件时出错: " + ex.Message), (Object)(object)((Component)this).gameObject); return; } } Debug.Log((object)"实体已拥有斧王专用标签", (Object)(object)((Component)this).gameObject); m_isInitialized = true; } [ContextMenu("手动添加斧王专用标签")] private void ManuallyAddVipTag() { if (Application.isPlaying) { InitializeECSUnit(); } else { Debug.LogWarning((object)"请进入运行模式后使用此功能"); } } [ContextMenu("检查标签状态")] private void CheckTagStatus() { //IL_003d: 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) //IL_0043: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_009d: 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) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) if (!Application.isPlaying || !((Object)(object)m_goEntity != (Object)null)) { return; } EntityManager entityManager = m_goEntity.EntityManager; if (entityManager == null) { return; } Entity entity = m_goEntity.Entity; if (!(entity != Entity.Null)) { return; } bool flag = entityManager.HasComponent<斧王专用标签>(entity); Debug.Log((object)$"检查状态: Entity={entity.Index}, HasVIPTag={flag}", (Object)(object)((Component)this).gameObject); NativeArray componentTypes = entityManager.GetComponentTypes(entity, (Allocator)2); string text = "拥有的组件: "; Enumerator enumerator = componentTypes.GetEnumerator(); try { while (enumerator.MoveNext()) { ComponentType current = enumerator.Current; text = text + "\n- " + ((ComponentType)(ref current)).GetManagedType().Name; } } finally { ((IDisposable)enumerator).Dispose(); } Debug.Log((object)text); componentTypes.Dispose(); } private bool Has会员标签() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) if ((Object)(object)m_goEntity == (Object)null || m_goEntity.Entity == Entity.Null) { return false; } EntityManager entityManager = m_goEntity.EntityManager; if (entityManager == null) { return false; } Entity entity = m_goEntity.Entity; return entityManager.HasComponent<斧王专用标签>(entity); } public void SetIsRemotelyControlled(bool isRemotelyControlled) { } private void OnDestroy() { } } public class 不死图腾效果123 : MonoBehaviour { [CompilerGenerated] private sealed class <秒回血5>d__14 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float duration; public 不死图腾效果123 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <秒回血5>d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.开启回血 = true; <>2__current = (object)new WaitForSeconds(duration); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.开启回血 = false; <>4__this.计时器 = 0f; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public int 执行次数 = 1; public bool 是否启用 = true; public bool 无限执行 = false; private bool 开启回血 = false; public bool 开启回血携程 = false; public GameObject effectbase = UManager.绿色治疗效果; private Unit unitfd; private float 计时器 = 0f; private ParticleSystem particle1; private PlaySoundEffect playSound1; private float 比例回血值; private void Start() { unitfd = ((Component)((Component)this).transform.root).gameObject.GetComponentInChildren(); particle1 = ((Component)((Component)this).transform.Find("Particleaffd")).gameObject.GetComponent(); playSound1 = ((Component)((Component)this).transform.Find("Particleaffd")).gameObject.GetComponent(); 比例回血值 = unitfd.data.maxHealth * 0.1f; } private void Update() { if (开启回血携程) { ((MonoBehaviour)this).StartCoroutine(秒回血5()); 开启回血携程 = false; } if (开启回血) { 计时器 += Time.deltaTime; 持续回血(); if (计时器 > 5f) { 开启回血 = false; } } } private void 持续回血() { DataHandler data = unitfd.data; data.health += Time.deltaTime * 比例回血值; } [IteratorStateMachine(typeof(<秒回血5>d__14))] private IEnumerator 秒回血5(float duration = 1f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <秒回血5>d__14(0) { <>4__this = this, duration = duration }; } public void 播放粒子及音效() { particle1.Play(); playSound1.Go(); if (Object.op_Implicit((Object)(object)effectbase)) { GameObject val = Object.Instantiate(effectbase, ((Component)((Component)this).transform.root).transform); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); val.GetComponentInChildren().DoEffect(); } } } public class 护盾脚本 : MonoBehaviour { public bool 是否启用护盾 = true; public float 护盾值 = 0f; } [Serializable] public class 伤害免疫组件_最小化 : MonoBehaviour { [CompilerGenerated] private sealed class <间隔4>d__6 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float duration; public 伤害免疫组件_最小化 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <间隔4>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.是否启用 = true; <>2__current = (object)new WaitForSeconds(duration); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.是否启用 = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public bool 是否启用 = false; [Range(0f, 1f)] public float 减伤比例 = 0f; private Coroutine 正在执行的携程; public float 处理伤害(float 输入伤害, string 伤害类型 = "") { if (!是否启用 || 输入伤害 <= 0f) { return 输入伤害; } return 输入伤害 * (1f - 减伤比例); } public void 免伤设置启用(bool ddsw = true) { 是否启用 = ddsw; } public void 免伤设置启用一段时间(float sspp = 2f) { if (正在执行的携程 != null) { ((MonoBehaviour)this).StopCoroutine(正在执行的携程); } 正在执行的携程 = ((MonoBehaviour)this).StartCoroutine(间隔4(sspp)); } [IteratorStateMachine(typeof(<间隔4>d__6))] private IEnumerator 间隔4(float duration = 1f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <间隔4>d__6(0) { <>4__this = this, duration = duration }; } } [Serializable] public class 简单免疫死亡组件 : MonoBehaviour { public bool 启用 = true; } public class 反伤3224 : MonoBehaviour { private Unit unit; private bool 判断1 = true; private bool 判断2 = true; private bool 判断3 = true; private bool 判断4 = true; private float 计时器 = 0f; private float 收到伤害 = 0f; private float 爆炸乘数 = 0f; private Explosion explosion; private ParticleSystem particleSystem; private GameObject gameObject34; private GameObject 怒吼1; public GameObject 爆炸; public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); gameObject34 = ((Component)((Component)this).gameObject.transform.Find("Particle System")).gameObject; 怒吼1 = ((Component)((Component)this).gameObject.transform.Find("超级怒吼4521")).gameObject; particleSystem = gameObject34.GetComponent(); explosion = gameObject34.GetComponent(); } private void 重新计算(float rew = 1.1f) { ParticleSystem obj = particleSystem; obj.startSize *= rew; ParticleSystem obj2 = particleSystem; obj2.startSpeed *= rew; Explosion obj3 = explosion; obj3.damage *= rew * 1.3f; Explosion obj4 = explosion; obj4.radius *= rew; } private void 生成爆炸(float rew = 1.5f) { //IL_001c: 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) TeamHolder.AddTeamHolder(Object.Instantiate(爆炸, ((Component)unit.data.mainRig).transform.position, Quaternion.identity), ((Component)this).gameObject); unit.data.immunityForSeconds = 2f; } public void Update() { if (!unit.data.Dead && 判断2 && unit.data.health < unit.data.maxHealth * 0.5f) { MovementHandler componentInChildren = ((Component)unit).GetComponentInChildren(); componentInChildren.multiplier *= 2f; 重新计算(); 生成爆炸(); 判断2 = false; } } } public class 半血附魔 : MonoBehaviour { private Unit unit; private bool 判断1 = true; private bool 判断2 = true; private bool 判断3 = true; private bool 判断4 = true; private float 计时器 = 0f; private float 收到伤害 = 0f; private float 爆炸乘数 = 0f; public Material material; public Material material1; public Material material2; public Material material3; public Material material4; public GameObject effect; public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); } private void 附魔1111() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown MeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Renderer)componentsInChildren[i]).materials = (Material[])(object)new Material[5] { new Material(material1), new Material(material3), new Material(material2), new Material(material4), new Material(material) }; } ((Component)this).GetComponent().DoMove(); } public void Update() { if (!unit.data.Dead && 判断1 && unit.data.health < unit.data.maxHealth * 0.5f) { ((Component)((Component)this).gameObject.transform.Find("rfwjiosfgrr")).gameObject.GetComponent().Play(); ((Component)((Component)this).gameObject.transform.Find("二阶段3拖尾34")).gameObject.SetActive(true); CollisionWeapon componentInChildren = ((Component)this).gameObject.GetComponentInChildren(); componentInChildren.damage *= 1.6f; 附魔1111(); 判断1 = false; } } } public class 伤害补丁获取值 : MonoBehaviour { public bool 是否反弹 = true; public bool 是否启用 = true; public Unit 伤害者; public float 伤害补丁乘数 = 0.25f; } public class 爆炸材质消散 : MonoBehaviour { public Material explosionMaterial; public float explosionDuration = 8f; public AnimationCurve dissolveCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); private float timer = 0f; private void Start() { if ((Object)(object)explosionMaterial == (Object)null) { explosionMaterial = ((Component)this).GetComponent().material; } } private void Update() { timer += Time.deltaTime; float num = timer / explosionDuration; float num2 = dissolveCurve.Evaluate(num); explosionMaterial.SetFloat("_DissolveAmount", num2); if (timer >= explosionDuration) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class 半血红眼 : MonoBehaviour { private Unit unit; private bool 判断1 = true; private float 计时器 = 0f; public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); } public void Update() { if (判断1 && unit.data.Dead) { ((Component)((Component)this).gameObject.transform.Find("喷火眼睛34")).gameObject.GetComponentInChildren().Play(); ((Component)((Component)this).gameObject.transform.Find("红眼4")).gameObject.SetActive(false); 判断1 = false; } } } } namespace rwdseerfd.角色类.检测接口 { public class 检测目标并操作父类 : MonoBehaviour { private Unit 此单位; private void Start() { 此单位 = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)此单位 == (Object)null) { TeamHolder component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { 此单位 = component.spawner.GetComponent(); } if ((Object)(object)此单位 == (Object)null) { Debug.LogError((object)("检测目标并操作父类: 在 " + ((Object)((Component)this).transform.root).name + " 上未找到 Unit 组件")); } } } public void 进行目标检测() { if ((Object)(object)此单位 == (Object)null) { Debug.LogError((object)"检测目标并操作父类: 此单位未初始化"); return; } DataHandler data = 此单位.data; if ((Object)(object)data == (Object)null) { Debug.LogError((object)("检测目标并操作父类: " + ((Object)此单位).name + " 的 data 为空")); return; } DataHandler targetData = data.targetData; 检测操作逻辑(此单位, data, targetData); } public virtual void 检测操作逻辑(Unit 此单位, DataHandler 此单位数据, DataHandler 目标单位数据) { if ((Object)(object)此单位 == (Object)null || (Object)(object)此单位数据 == (Object)null) { Debug.LogError((object)"检测目标并操作父类: 检测操作逻辑参数无效"); } } } public class 触发器碰撞伤害基类 : MonoBehaviour { public float 碰撞伤害 = 400f; public float 伤害冷却时间 = 0.1f; public LayerMask 目标层 = LayerMask.op_Implicit(16385); public UnityEvent 检测到进入碰撞体事件; private Unit 当前单位; private Team 当前队伍; private Dictionary 上次伤害时间 = new Dictionary(); private void Start() { //IL_005d: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) 当前单位 = ((Component)this).GetComponentInParent(); if ((Object)(object)当前单位 == (Object)null) { TeamHolder componentInParent = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent)) { 当前队伍 = ((Component)this).GetComponentInParent().team; } else { 当前队伍 = (Team)0; } } else { 当前队伍 = 当前单位.data.team; } } private void OnTriggerEnter(Collider other) { if (IsInTargetLayer(((Component)other).gameObject)) { UnityEvent obj = 检测到进入碰撞体事件; if (obj != null) { obj.Invoke(); } 尝试造成伤害(other); } } private void OnTriggerStay(Collider other) { if (IsInTargetLayer(((Component)other).gameObject)) { 尝试造成伤害(other); } } private bool IsInTargetLayer(GameObject obj) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return ((1 << obj.layer) & LayerMask.op_Implicit(目标层)) != 0; } private void 尝试造成伤害(Collider other) { //IL_0012: 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_0076: Unknown result type (might be due to invalid IL or missing references) DataHandler componentInParent = ((Component)other).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && componentInParent.team != 当前队伍 && !componentInParent.Dead && (!上次伤害时间.TryGetValue(other, out var value) || !(Time.time - value < 伤害冷却时间))) { ((Damagable)componentInParent.healthHandler).TakeDamage(碰撞伤害, ((Component)other).transform.position, (Unit)null, (DamageType)0); 碰撞逻辑(other, componentInParent, 当前单位); 上次伤害时间[other] = Time.time; } } private void OnTriggerExit(Collider other) { 上次伤害时间.Remove(other); } protected virtual void 碰撞逻辑(Collider other, DataHandler 目标单位, Unit 这个单位) { } } public class 碰撞检测获取单位基类 : MonoBehaviour { public enum 施加方式 { 对敌方, 全部, 对自己和对于, 仅自己 } public enum 检测方式 { 物体, 单位 } public UnitEffectBase 效果设置; public float 检测半径 = 6f; public LayerMask 检测层; private Unit 存储单位; public 施加方式 效果施加对应 = 施加方式.对敌方; private Team 队伍信息; public 检测方式 sss = 检测方式.单位; private void Start() { //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) //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) if (sss == 检测方式.单位) { 存储单位 = ((Component)this).GetComponentInParent(); 队伍信息 = 存储单位.data.team; } if (sss == 检测方式.物体) { 队伍信息 = ((Component)this).GetComponentInParent().team; } } public void 开始检测() { //IL_0007: 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_00b1: 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_00d1: 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) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 检测半径, LayerMask.op_Implicit(检测层)); if (array.Length == 0) { 完成所有检测(存储单位, null); return; } List list = new List(); for (int i = 0; i < array.Length; i++) { Unit componentInParent = ((Component)array[i]).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || componentInParent.data.Dead) { continue; } bool flag = false; switch (效果施加对应) { case 施加方式.对敌方: flag = componentInParent.data.team != 队伍信息; break; case 施加方式.全部: flag = true; break; case 施加方式.对自己和对于: flag = componentInParent.data.team == 队伍信息; break; case 施加方式.仅自己: { Unit componentInParent2 = ((Component)this).GetComponentInParent(); flag = (Object)(object)componentInParent == (Object)(object)componentInParent2; break; } } if (!flag) { continue; } list.Add(componentInParent); if (Object.op_Implicit((Object)(object)效果设置)) { UnitEffectBase val = UnitEffectBase.AddEffectToTarget(((Component)((Component)array[i]).transform).gameObject, 效果设置); if ((Object)(object)val == (Object)null) { val = Object.Instantiate(效果设置, ((Component)array[i]).transform); ((Component)val).transform.SetPositionAndRotation(((Component)array[i]).transform.position, Quaternion.identity); TeamHolder.AddTeamHolder(((Component)val).gameObject, ((Component)this).gameObject); val.DoEffect(); } else { val.Ping(); } 完成单次检测(val, 存储单位, componentInParent, ((Component)((Component)this).transform).gameObject); } else { 完成单次检测(null, 存储单位, componentInParent, ((Component)((Component)this).transform).gameObject); } } 完成所有检测(存储单位, list.ToArray()); } public virtual void 完成单次检测(UnitEffectBase 效果实例, Unit 召唤者, Unit 受影响者, GameObject 召唤物体) { } public virtual void 完成所有检测(Unit 召唤者, Unit[] 受影响者) { } private void OnDrawGizmos() { //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) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = new Color(0f, 1f, 0f, 0.3f); Gizmos.DrawSphere(((Component)this).transform.position, 检测半径); Gizmos.color = Color.green; Gizmos.DrawWireSphere(((Component)this).transform.position, 检测半径); } } } namespace rwdseerfd.角色类.恶魔巫师 { public class 共享事件联动事件 : MonoBehaviour { [Serializable] public class 共享事件组合 { public string 事件名称; public UnityEvent 事件; public void 触发事件() { UnityEvent obj = 事件; if (obj != null) { obj.Invoke(); } } } public List<共享事件组合> 事件字典 = new List<共享事件组合>(); private 共享事件联动事件[] 所有共享事件; private void Start() { 所有共享事件 = ((Component)((Component)this).transform.root).GetComponentsInChildren<共享事件联动事件>(); } public void 触发指定名称事件(string 事件名称) { 共享事件联动事件[] array = 所有共享事件; foreach (共享事件联动事件 共享事件联动事件2 in array) { foreach (共享事件组合 item in 共享事件联动事件2.事件字典) { if (item.事件名称 == 事件名称) { item.触发事件(); } } } } public void 触发自己的事件(string 事件名称) { foreach (共享事件组合 item in 事件字典) { if (item.事件名称 == 事件名称) { item.触发事件(); } } } public void 添加事件(string 事件名称) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown 事件字典.Add(new 共享事件组合 { 事件名称 = 事件名称, 事件 = new UnityEvent() }); } public UnityEvent 获取事件(string 事件名称) { return 事件字典.Find((共享事件组合 e) => e.事件名称 == 事件名称)?.事件; } } public class 剑气碰撞伤害事件 : 触发器碰撞伤害基类 { [Header("剑气特效设置")] public GameObject 实例化预制体; protected override void 碰撞逻辑(Collider other, DataHandler 目标单位, Unit 这个单位) { //IL_0033: 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) if ((Object)(object)实例化预制体 != (Object)null && (Object)(object)目标单位 != (Object)null && (Object)(object)other != (Object)null) { GameObject val = Object.Instantiate(实例化预制体, ((Component)other).transform.position, ((Component)other).transform.rotation); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); } } } public class 动态修改攻击距离工具 : MonoBehaviour { private Unit 这个单位; private UnitAPI 单位ai; private float 原始攻击距离; private float 原始偏好距离; private void Start() { 这个单位 = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)这个单位 != (Object)null) { 单位ai = 这个单位.api; } else { Debug.LogError((object)"未找到Unit组件!"); } } public void 修改攻击距离(float AttackRange) { if (!((Object)(object)这个单位 == (Object)null)) { 这个单位.m_AttackDistance = AttackRange; if ((Object)(object)单位ai != (Object)null) { 单位ai.UpdateECSValues(); } Debug.Log((object)$"已将单位 [{((Object)这个单位).name}] 的攻击距离修改为: {AttackRange}"); } } public void 修改攻击偏好距离(float PreferredRange) { if (!((Object)(object)这个单位 == (Object)null)) { 这个单位.m_PreferedDistance = PreferredRange; if ((Object)(object)单位ai != (Object)null) { 单位ai.UpdateECSValues(); } Debug.Log((object)$"已将单位 [{((Object)这个单位).name}] 的攻击偏好距离修改为: {PreferredRange}"); } } public void 修改攻击和偏好距离(float AttackRange, float PreferredRange) { if (!((Object)(object)这个单位 == (Object)null)) { 这个单位.m_AttackDistance = AttackRange; 这个单位.m_PreferedDistance = PreferredRange; if ((Object)(object)单位ai != (Object)null) { 单位ai.UpdateECSValues(); } Debug.Log((object)$"已修改攻击距离: {AttackRange}, 偏好距离: {PreferredRange}"); } } public float 获取攻击距离() { return ((Object)(object)这个单位 != (Object)null) ? 这个单位.m_AttackDistance : 0f; } public void 临时增加攻击距离(float 增加量) { if (!((Object)(object)这个单位 == (Object)null)) { if (原始攻击距离 == 0f) { 原始攻击距离 = 这个单位.m_AttackDistance; 原始偏好距离 = 这个单位.m_PreferedDistance; } 修改攻击和偏好距离(原始攻击距离 + 增加量, 原始偏好距离 + 增加量); } } public void 恢复原始攻击距离() { if (原始攻击距离 != 0f) { 修改攻击和偏好距离(原始攻击距离, 原始偏好距离); 原始攻击距离 = 0f; } } } public class 单位半血事件 : MonoBehaviour { private Unit 这个单位; private DataHandler 单位数据; private bool 已触发半血事件 = false; public UnityEvent 半血事件; private void Start() { if ((Object)(object)((Component)this).transform.root == (Object)null) { Debug.LogError((object)"单位半血事件: 无法获取根对象"); return; } 这个单位 = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)这个单位 == (Object)null) { Debug.LogError((object)"单位半血事件: 未找到Unit组件"); return; } 单位数据 = 这个单位.data; if ((Object)(object)单位数据 == (Object)null) { Debug.LogError((object)"单位半血事件: 单位数据为空"); } } private void Update() { if (已触发半血事件) { return; } if ((Object)(object)单位数据 == (Object)null) { Debug.LogWarning((object)"单位半血事件: 单位数据丢失"); } else if (单位数据.health <= 单位数据.maxHealth * 0.5f) { UnityEvent obj = 半血事件; if (obj != null) { obj.Invoke(); } 已触发半血事件 = true; } } } public class 单位死亡事件 : MonoBehaviour { [Header("死亡事件")] public UnityEvent 死亡事件; [Header("调试选项")] [SerializeField] private bool 显示调试日志 = false; private HealthHandler 健康管理器; private Unit 单位; private bool 已订阅 = false; private void Start() { 单位 = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)单位 == (Object)null) { Debug.LogError((object)("单位死亡事件: 在 " + ((Object)((Component)this).transform.root).name + " 上找不到 Unit 组件"), (Object)(object)this); return; } 健康管理器 = 单位.data?.healthHandler; if ((Object)(object)健康管理器 == (Object)null) { Debug.LogError((object)("单位死亡事件: 在 " + ((Object)单位).name + " 上找不到 HealthHandler 组件"), (Object)(object)this); } else { 订阅死亡事件(); } } private void 订阅死亡事件() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown if ((Object)(object)健康管理器 == (Object)null) { Debug.LogWarning((object)"单位死亡事件: 健康管理器为空,无法订阅", (Object)(object)this); return; } if (已订阅) { if (显示调试日志) { Debug.Log((object)"单位死亡事件: 已经订阅过死亡事件", (Object)(object)this); } return; } 健康管理器.UnitDied += 当单位死亡时; UnityEvent deathEvent = 健康管理器.deathEvent; if (deathEvent != null) { deathEvent.AddListener(new UnityAction(当UnityEvent死亡时)); } 已订阅 = true; if (显示调试日志) { Debug.Log((object)("单位死亡事件: 已成功订阅 " + ((Object)单位).name + " 的死亡事件"), (Object)(object)this); } } private void 当单位死亡时(Unit 死亡单位) { if ((Object)(object)死亡单位 == (Object)null) { Debug.LogWarning((object)"单位死亡事件: 死亡单位参数为空", (Object)(object)this); } else if ((Object)(object)死亡单位 != (Object)(object)单位) { if (显示调试日志) { Debug.Log((object)("单位死亡事件: 收到其他单位死亡事件 - " + ((Object)死亡单位).name), (Object)(object)this); } } else { 触发事件(); } } private void 当UnityEvent死亡时() { 触发事件(); } public void 触发事件() { if (死亡事件 == null) { if (显示调试日志) { Debug.Log((object)"单位死亡事件: 死亡事件为空,未执行任何操作", (Object)(object)this); } return; } UnityEvent obj = 死亡事件; if (obj != null) { obj.Invoke(); } if (显示调试日志) { Unit obj2 = 单位; Debug.Log((object)("单位死亡事件: 已触发 " + (((obj2 != null) ? ((Object)obj2).name : null) ?? "未知单位") + " 的死亡事件"), (Object)(object)this); } } public void 手动订阅(HealthHandler 目标健康管理器) { if ((Object)(object)目标健康管理器 == (Object)null) { Debug.LogError((object)"单位死亡事件: 手动订阅失败,目标健康管理器为空", (Object)(object)this); return; } 取消订阅(); 健康管理器 = 目标健康管理器; 单位 = ((Component)健康管理器).GetComponentInParent(); 订阅死亡事件(); } private void 取消订阅() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown if ((Object)(object)健康管理器 != (Object)null && 已订阅) { 健康管理器.UnitDied -= 当单位死亡时; UnityEvent deathEvent = 健康管理器.deathEvent; if (deathEvent != null) { deathEvent.RemoveListener(new UnityAction(当UnityEvent死亡时)); } 已订阅 = false; if (显示调试日志) { Debug.Log((object)"单位死亡事件: 已取消订阅", (Object)(object)this); } } } private void OnDestroy() { 取消订阅(); } private void OnDisable() { } private void OnEnable() { if ((Object)(object)健康管理器 != (Object)null && !已订阅) { 订阅死亡事件(); } } public void 设置单位状态(bool f) { if ((Object)(object)单位 != (Object)null) { ((Component)单位).gameObject.SetActive(f); } } } public class 单位停止攻击行为 : MonoBehaviour { public float time = 9f; private Unit 这个单位; private void Start() { 这个单位 = ((Component)((Component)this).transform.root).GetComponent(); } public void Go() { if ((Object)(object)这个单位 != (Object)null) { 这个单位.data.weaponHandler.StopAttacksFor(time); } } } public class 单位被分解并实例化 : MonoBehaviour { public Unit 这个单位; public GameObject 残影粒子; private float 粒子持续时间 = 3f; private void Start() { if ((Object)(object)这个单位 == (Object)null) { 这个单位 = ((Component)((Component)this).transform.root).GetComponent(); } } public void 分解() { if ((Object)(object)这个单位 == (Object)null) { return; } SkinnedMeshRenderer[] componentsInChildren = ((Component)这个单位).GetComponentsInChildren(); SkinnedMeshRenderer[] array = componentsInChildren; foreach (SkinnedMeshRenderer val in array) { if (((Component)val).CompareTag("UnitMesh")) { 创建粒子特效(val); break; } } 强制死亡(这个单位); } private void 创建默认粒子特效() { //IL_000d: 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) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(残影粒子, ((Component)this).transform.position, Quaternion.identity); ParticleSystem component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ShapeModule shape = component.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.5f; component.Play(); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); } } private void 创建粒子特效(SkinnedMeshRenderer 蒙皮渲染器) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)残影粒子 == (Object)null) { Debug.LogError((object)"残影粒子预制体未设置!"); return; } Mesh val = new Mesh(); 蒙皮渲染器.BakeMesh(val); if ((Object)(object)val == (Object)null || val.triangles.Length == 0) { Debug.LogWarning((object)"烘焙网格无效,使用默认形状"); Object.Destroy((Object)(object)val); 创建默认粒子特效(); return; } GameObject val2 = Object.Instantiate(残影粒子, ((Component)蒙皮渲染器).transform.position, ((Component)蒙皮渲染器).transform.rotation); ParticleSystem component = val2.GetComponent(); if ((Object)(object)component == (Object)null) { Debug.LogError((object)"预制体缺少ParticleSystem组件!"); Object.Destroy((Object)(object)val2); Object.Destroy((Object)(object)val); return; } ShapeModule shape = component.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)6; ((ShapeModule)(ref shape)).mesh = val; ((ShapeModule)(ref shape)).meshShapeType = (ParticleSystemMeshShapeType)2; ((ShapeModule)(ref shape)).position = Vector3.zero; ((ShapeModule)(ref shape)).rotation = Vector3.zero; ((ShapeModule)(ref shape)).scale = Vector3.one; component.Play(); Object.Destroy((Object)(object)val, 粒子持续时间 + 0.5f); Object.Destroy((Object)(object)val2, 粒子持续时间); TeamHolder.AddTeamHolder(val2, ((Component)this).gameObject); } private void 强制死亡(Unit 单位) { if (!((Object)(object)单位 == (Object)null)) { GameModeService service = ServiceLocator.GetService(); if (((service != null) ? service.CurrentGameMode : null) == null) { Debug.LogError((object)"Could not find CurrentGameMode!"); Object.Destroy((Object)(object)((Component)单位).gameObject); } else { service.CurrentGameMode.OnUnitDied(单位); Object.Destroy((Object)(object)((Component)单位).gameObject); } } } } public class 碰撞检测并实例化物体 : MonoBehaviour { public enum 施加方式 { 对敌方, 全部, 对自己和对于, 仅自己 } public enum 检测方式 { 物体, 单位 } public UnitEffectBase 效果设置; public float 检测半径 = 6f; public LayerMask 检测层; public GameObject 实例化灵魂; public Transform 预制位置; private Unit 存储单位; public 施加方式 效果施加对应 = 施加方式.对敌方; private Team 队伍信息; public 检测方式 sss = 检测方式.单位; private void Start() { //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) //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) if (sss == 检测方式.单位) { 存储单位 = ((Component)this).GetComponentInParent(); 队伍信息 = 存储单位.data.team; } if (sss == 检测方式.物体) { 队伍信息 = ((Component)this).GetComponentInParent().team; } } public void 开始检测() { //IL_0012: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"开始检测OO"); Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 检测半径, LayerMask.op_Implicit(检测层)); if (array.Length == 0) { return; } Debug.Log((object)"开始检测OqqqqO"); for (int i = 0; i < array.Length; i++) { Unit componentInParent = ((Component)array[i]).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || componentInParent.data.Dead) { continue; } bool flag = false; switch (效果施加对应) { case 施加方式.对敌方: flag = componentInParent.data.team != 队伍信息; break; case 施加方式.全部: flag = true; break; case 施加方式.对自己和对于: flag = componentInParent.data.team == 队伍信息; break; case 施加方式.仅自己: { Unit componentInParent2 = ((Component)this).GetComponentInParent(); flag = (Object)(object)componentInParent == (Object)(object)componentInParent2; break; } } if (!flag) { continue; } UnitEffectBase val = UnitEffectBase.AddEffectToTarget(((Component)((Component)array[i]).transform).gameObject, 效果设置); if ((Object)(object)val == (Object)null) { val = Object.Instantiate(效果设置, ((Component)array[i]).transform); ((Component)val).transform.SetPositionAndRotation(((Component)array[i]).transform.position, Quaternion.identity); TeamHolder.AddTeamHolder(((Component)val).gameObject, ((Component)this).gameObject); val.DoEffect(); } else { val.Ping(); } 单位被分解并实例化 component = ((Component)((Component)val).transform).GetComponent<单位被分解并实例化>(); if ((Object)(object)component != (Object)null) { component.这个单位 = componentInParent; } if (!((Object)(object)实例化灵魂 != (Object)null)) { continue; } GameObject val2 = Object.Instantiate(实例化灵魂, componentInParent.data.mainRig.position, Quaternion.identity); val2.transform.localScale = ((Component)componentInParent.data.mainRig).transform.localScale; TeamHolder.AddTeamHolder(val2, ((Component)this).gameObject); 灵魂移动到物体 component2 = ((Component)val2.transform).GetComponent<灵魂移动到物体>(); if ((Object)(object)component2 != (Object)null && (Object)(object)预制位置 != (Object)null) { component2.目标 = ((Component)预制位置).transform; if ((Object)(object)存储单位 != (Object)null) { component2.unit1 = 存储单位; } } } } private void OnDrawGizmos() { //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) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = new Color(0f, 1f, 0f, 0.3f); Gizmos.DrawSphere(((Component)this).transform.position, 检测半径); Gizmos.color = Color.green; Gizmos.DrawWireSphere(((Component)this).transform.position, 检测半径); } } public class 灵魂移动到物体 : MonoBehaviour { public Transform 目标; public Unit unit1; public float speed; public UnityEvent 到达事件; private bool g = true; private void Update() { //IL_001c: 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_0038: 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_0054: Unknown result type (might be due to invalid IL or missing references) if (!g) { return; } ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, 目标.position, speed * Time.deltaTime); float num = Vector3.Distance(((Component)this).transform.position, 目标.position); if ((double)num <= 0.01) { UnityEvent obj = 到达事件; if (obj != null) { obj.Invoke(); } g = false; } } public void 单位受伤(float fe = -900f) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)unit1 != (Object)null) { ((Damagable)unit1.data.healthHandler).TakeDamage(fe, ((Component)this).transform.position, (Unit)null, (DamageType)0); Debug.Log((object)"已成伤害!!"); } else { Debug.Log((object)"单位为空!!"); } } } public class DissolveController : MonoBehaviour { [Tooltip("溶解动画时长(秒)")] public float dissolveDuration = 2f; [Tooltip("动画开始时是否自动播放")] public bool autoPlayOnStart = true; private Material material; private float currentDissolveAmount = 0f; private float dissolveSpeed = 0f; private bool isDissolving = false; private void Start() { Renderer component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { material = component.material; material.SetFloat("_DissolveAmount", 0f); currentDissolveAmount = 0f; if (autoPlayOnStart) { StartDissolve(); } } else { Debug.LogError((object)"找不到Renderer组件!"); } } private void Update() { if (isDissolving) { currentDissolveAmount += dissolveSpeed * Time.deltaTime; if (currentDissolveAmount >= 1f) { currentDissolveAmount = 1f; isDissolving = false; Debug.Log((object)"溶解动画完成 - 物体已完全溶解"); } material.SetFloat("_DissolveAmount", currentDissolveAmount); } } public void StartDissolve() { if (!((Object)(object)material == (Object)null)) { isDissolving = true; dissolveSpeed = 1f / dissolveDuration; currentDissolveAmount = 0f; material.SetFloat("_DissolveAmount", currentDissolveAmount); } } public void SetDissolveAmount(float amount) { if (!((Object)(object)material == (Object)null)) { amount = Mathf.Clamp01(amount); currentDissolveAmount = amount; material.SetFloat("_DissolveAmount", currentDissolveAmount); isDissolving = false; } } public float GetCurrentDissolveAmount() { return currentDissolveAmount; } public void ResetToVisible() { if (!((Object)(object)material == (Object)null)) { isDissolving = false; currentDissolveAmount = 0f; material.SetFloat("_DissolveAmount", 0f); } } } public class 在目标位置实例化 : MonoBehaviour { private Unit 单位此; public bool 计算地面 = false; private void Start() { 单位此 = ((Component)((Component)this).transform.root).GetComponent(); } public void 实例化物体(GameObject fff) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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) if ((Object)(object)单位此 != (Object)null) { DataHandler targetData = 单位此.data.targetData; if ((Object)(object)targetData != (Object)null) { Vector3 val = ((!计算地面) ? targetData.mainRig.position : 获取地面位置(targetData.mainRig.position)); GameObject val2 = Object.Instantiate(fff, val, Quaternion.identity); TeamHolder.AddTeamHolder(val2, ((Component)this).gameObject); } } } public Vector3 获取地面位置(Vector3 测试位置, float 检测高度 = 10f, int 地面层级 = 512) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(测试位置.x, 测试位置.y + 检测高度, 测试位置.z); float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, 地面层级)) { return ((RaycastHit)(ref val2)).point; } return new Vector3(测试位置.x, 测试位置.y - 检测高度 * 0.5f, 测试位置.z); } } public class 定住单位 : MonoBehaviour { public Rigidbody[] rigidbodies; private void Start() { rigidbodies = ((Component)((Component)this).transform.root).GetComponentsInChildren(); } public void 设置开启(bool d = true) { if (rigidbodies != null && rigidbodies.Length != 0) { for (int i = 0; i < rigidbodies.Length; i++) { rigidbodies[i].isKinematic = d; } } } } public class 单位生命值固定器 : MonoBehaviour { [SerializeField] private bool 使用蓝图生命值 = true; [SerializeField] private float 自定义生命值 = 100f; private void Start() { Unit component = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.data != (Object)null) { float num = ((使用蓝图生命值 && (Object)(object)component.unitBlueprint != (Object)null) ? component.unitBlueprint.health : 自定义生命值); component.data.maxHealth = num; component.data.health = num; } } } public class 开局面向摄像机 : MonoBehaviour { private Transform mainCameraTransform; private void Start() { Camera main = Camera.main; if ((Object)(object)main != (Object)null) { mainCameraTransform = ((Component)main).transform; FaceCameraHorizontally(); } else { Debug.LogWarning((object)"未找到主摄像机,请确保场景中存在Tag为'MainCamera'的摄像机"); } } private void FaceCameraHorizontally() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) if (!((Object)(object)mainCameraTransform == (Object)null)) { Vector3 val = mainCameraTransform.position - ((Component)this).transform.position; val.y = 0f; if (val != Vector3.zero) { Quaternion val2 = Quaternion.LookRotation(val); ((Component)this).transform.rotation = Quaternion.Euler(0f, ((Quaternion)(ref val2)).eulerAngles.y, 0f); } } } } public class 恶魔巫师剑气 : 检测目标并操作父类 { public Transform 检测位置; public GameObject[] 剑气组; private Transform 当前检测物体; public override void 检测操作逻辑(Unit 此单位, DataHandler 此单位数据, DataHandler 目标单位数据) { //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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_0093: 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_00d1: 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_00e7: 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_00f6: 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) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) base.检测操作逻辑(此单位, 此单位数据, 目标单位数据); if ((Object)(object)目标单位数据.mainRig == (Object)null) { Debug.LogError((object)("[恶魔巫师剑气] 错误: 目标单位数据的mainRig为空! 目标单位: " + ((Object)目标单位数据).name)); return; } if ((Object)(object)检测位置 == (Object)null) { Debug.LogWarning((object)("[恶魔巫师剑气] 检测位置未赋值,将使用当前物体transform作为检测位置。单位: " + ((Object)此单位).name)); 检测位置 = ((Component)this).transform; } Vector3 val = 目标单位数据.mainRig.position - 检测位置.position; Vector3 normalized = ((Vector3)(ref val)).normalized; GameObject val2 = 剑气组[Random.Range(0, 剑气组.Length)]; if ((Object)(object)val2 == (Object)null) { Debug.LogError((object)("[恶魔巫师剑气] 错误: 随机选择的剑气为空! 单位: " + ((Object)此单位).name)); return; } Quaternion val3 = Quaternion.LookRotation(normalized); Quaternion val4 = Quaternion.Euler(0f, 0f, 检测位置.eulerAngles.z); Quaternion val5 = val3 * val4; GameObject val6 = Object.Instantiate(val2, 检测位置.position, val5); val6.transform.localScale = 检测位置.localScale; 当前检测物体 = val6.transform; TeamHolder.AddTeamHolder(val6, ((Component)this).gameObject); } } public class 剑气速度曲线 : MonoBehaviour { [CompilerGenerated] private sealed class <减速携程>d__6 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 剑气速度曲线 <>4__this; private float <当前时间>5__1; private float <起始速度>5__2; private float 5__3; private float <曲线值>5__4; private float <新速度>5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <减速携程>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <当前时间>5__1 = 0f; <起始速度>5__2 = <>4__this.指定类.移动速度; break; case 1: <>1__state = -1; break; } if (<当前时间>5__1 < <>4__this.减速总时间) { if ((Object)(object)<>4__this.指定类 == (Object)null) { return false; } 5__3 = <当前时间>5__1 / <>4__this.减速总时间; <曲线值>5__4 = <>4__this.速度曲线.Evaluate(5__3); <新速度>5__5 = Mathf.Lerp(<起始速度>5__2, <>4__this.目标速度, <曲线值>5__4); <>4__this.指定类.移动速度 = <新速度>5__5; <当前时间>5__1 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)<>4__this.指定类 != (Object)null) { <>4__this.指定类.移动速度 = <>4__this.目标速度; } <>4__this.当前减速协程 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public AnimationCurve 速度曲线; public float 目标速度 = 9f; public float 减速总时间 = 1f; public 剑气类方向移动碰撞检测 指定类; private Coroutine 当前减速协程; public void 应用减速() { if (!((Object)(object)指定类 == (Object)null) && 速度曲线 != null && !(减速总时间 <= 0f)) { if (当前减速协程 != null) { ((MonoBehaviour)this).StopCoroutine(当前减速协程); } 当前减速协程 = ((MonoBehaviour)this).StartCoroutine(减速携程()); } } [IteratorStateMachine(typeof(<减速携程>d__6))] private IEnumerator 减速携程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <减速携程>d__6(0) { <>4__this = this }; } } public class 剑气类方向移动碰撞检测 : MonoBehaviour { public UnityEvent 碰撞事件; public LayerMask 受影响层; public float 移动速度 = 5f; public bool 是否碰撞 = true; private bool 碰撞成功 = false; private bool 成功获取队伍标识 = true; private Team 队伍标识; private void Start() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) TeamHolder component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { 队伍标识 = component.team; } else { 成功获取队伍标识 = false; } } private void Update() { //IL_0007: 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) //IL_001c: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.Translate(Vector3.forward * 移动速度 * Time.deltaTime); } public void 禁用碰撞(bool gg = false) { 是否碰撞 = gg; if (!gg) { 碰撞成功 = false; } } private void OnTriggerEnter(Collider other) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (碰撞成功) { return; } if (((Component)other).gameObject.layer == 9) { UnityEvent obj = 碰撞事件; if (obj != null) { obj.Invoke(); } 碰撞成功 = true; } else { if (((1 << ((Component)other).gameObject.layer) & LayerMask.op_Implicit(受影响层)) == 0 || !成功获取队伍标识) { return; } Unit component = ((Component)((Component)other).transform.root).GetComponent(); if ((Object)(object)component != (Object)null && component.data.team != 队伍标识 && !component.data.Dead) { UnityEvent obj2 = 碰撞事件; if (obj2 != null) { obj2.Invoke(); } 碰撞成功 = true; } } } public void 停止移动() { 碰撞成功 = true; } public void 重置碰撞状态() { 碰撞成功 = false; } } public class 恶魔巫师抛射物反弹 : ProjectileSurfaceEffect { [Header("事件")] public UnityEvent 触发格挡事件 = new UnityEvent(); public bool 检测追踪 = true; public bool 完全格挡 = true; [Range(0f, 1f)] public float 设置减免伤害百分比 = 0.5f; [Header("特效设置")] public ParticleSystem 反弹特效预制体; public string 反弹音效; public float 特效大小 = 1f; private SoundPlayer 音效播放器; private void Start() { 音效播放器 = ServiceLocator.GetService(); } public override bool DoEffect(HitData hit, GameObject projectile) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (检测追踪) { MoveTransformMissile component = projectile.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { return false; } } ProjectileHit component2 = projectile.GetComponent(); if ((Object)(object)component2 == (Object)null) { return false; } Vector3 val = Vector3.Reflect(projectile.transform.forward, hit.normal); MoveTransform component3 = projectile.GetComponent(); if ((Object)(object)component3 != (Object)null) { float magnitude = ((Vector3)(ref component3.velocity)).magnitude; component3.velocity = ((Vector3)(ref val)).normalized * magnitude; } PlayReflectEffect(hit.point, hit.normal); component2.allowedHits--; UnityEvent obj = 触发格挡事件; if (obj != null) { obj.Invoke(); } if (!完全格挡) { } return true; } private void PlayReflectEffect(Vector3 position, Vector3 normal) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)反弹特效预制体 != (Object)null) { ParticleSystem val = Object.Instantiate(反弹特效预制体, position, Quaternion.LookRotation(normal)); ((Component)val).transform.localScale = Vector3.one * 特效大小; val.Play(); GameObject gameObject = ((Component)val).gameObject; MainModule main = val.main; Object.Destroy((Object)(object)gameObject, ((MainModule)(ref main)).duration); } if (反弹音效 != null && (Object)(object)音效播放器 != (Object)null) { 音效播放器.PlaySoundEffect(反弹音效, 1f, position, (MaterialType)0, (Transform)null, 1f); } } } public class 简易格挡添加器 : MonoBehaviour { [Header("基本设置")] public bool 自动初始化 = true; public bool 格挡启用 = true; [Header("反弹特效设置")] public ParticleSystem 反弹特效预制体; public string 反弹音效; public float 特效大小 = 1f; [Header("事件设置")] public UnityEvent 格挡事件; [Header("调试")] public bool 显示日志 = false; private Unit 单位; private List<恶魔巫师抛射物反弹> 格挡组件列表 = new List<恶魔巫师抛射物反弹>(); private bool 已初始化 = false; private void Start() { if (自动初始化) { 初始化(); } } private void OnDestroy() { 清理所有格挡(); } public void 初始化() { if (已初始化) { return; } 单位 = ((Component)this).GetComponentInParent(); if ((Object)(object)单位 == (Object)null) { if (显示日志) { Debug.LogWarning((object)(((Object)((Component)this).gameObject).name + " 未找到Unit组件!"), (Object)(object)((Component)this).gameObject); } return; } 为所有刚体添加格挡(); 已初始化 = true; if (显示日志) { Debug.Log((object)$"为 {((Object)单位).name} 添加了 {格挡组件列表.Count} 个格挡组件"); } } private void 为所有刚体添加格挡() { DataHandler data = 单位.data; object obj; if (data == null) { obj = null; } else { RigidbodyHolder allRigs = data.allRigs; obj = ((allRigs != null) ? allRigs.AllRigs : null); } if (obj == null) { if (显示日志) { Debug.LogWarning((object)(((Object)单位).name + " 没有找到刚体!")); } return; } Rigidbody[] allRigs2 = 单位.data.allRigs.AllRigs; foreach (Rigidbody val in allRigs2) { if (!((Object)(object)val == (Object)null)) { 添加单体格挡(((Component)val).gameObject); } } } private void 添加单体格挡(GameObject 目标物体) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown 恶魔巫师抛射物反弹 恶魔巫师抛射物反弹2 = 目标物体.GetComponent<恶魔巫师抛射物反弹>(); if ((Object)(object)恶魔巫师抛射物反弹2 == (Object)null) { 恶魔巫师抛射物反弹2 = 目标物体.AddComponent<恶魔巫师抛射物反弹>(); 恶魔巫师抛射物反弹2.反弹特效预制体 = 反弹特效预制体; 恶魔巫师抛射物反弹2.反弹音效 = 反弹音效; 恶魔巫师抛射物反弹2.特效大小 = 特效大小; if (显示日志) { Debug.Log((object)("为 " + ((Object)目标物体).name + " 添加格挡组件,并设置特效/音效")); } } 恶魔巫师抛射物反弹2.触发格挡事件.RemoveListener(new UnityAction(处理格挡)); 恶魔巫师抛射物反弹2.触发格挡事件.AddListener(new UnityAction(处理格挡)); ((Behaviour)恶魔巫师抛射物反弹2).enabled = 格挡启用; if (!格挡组件列表.Contains(恶魔巫师抛射物反弹2)) { 格挡组件列表.Add(恶魔巫师抛射物反弹2); } } private void 处理格挡() { UnityEvent obj = 格挡事件; if (obj != null) { obj.Invoke(); } if (显示日志) { Unit obj2 = 单位; Debug.Log((object)(((obj2 != null) ? ((Object)obj2).name : null) + " 触发了格挡!")); } } public void 清理所有格挡() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown foreach (恶魔巫师抛射物反弹 item in 格挡组件列表) { if ((Object)(object)item != (Object)null) { item.触发格挡事件.RemoveListener(new UnityAction(处理格挡)); Object.Destroy((Object)(object)item); } } 格挡组件列表.Clear(); if (显示日志) { Debug.Log((object)"已清理所有格挡组件"); } } public void 开关格挡(bool 启用) { 格挡启用 = 启用; foreach (恶魔巫师抛射物反弹 item in 格挡组件列表) { if ((Object)(object)item != (Object)null) { ((Behaviour)item).enabled = 启用; } } } public void 重新绑定() { 清理所有格挡(); 为所有刚体添加格挡(); } public void 更新特效设置() { foreach (恶魔巫师抛射物反弹 item in 格挡组件列表) { if ((Object)(object)item != (Object)null) { item.反弹特效预制体 = 反弹特效预制体; item.反弹音效 = 反弹音效; item.特效大小 = 特效大小; } } if (显示日志) { Debug.Log((object)"已更新所有格挡组件的特效设置"); } } } public class 恶魔远程格挡 : ProjectileSurfaceEffect { [Header("特效设置")] public ParticleSystem 格挡特效; public Vector3 特效偏移 = Vector3.zero; public bool 特效跟随抛射物旋转 = false; public float 特效持续时间 = 0f; [Header("事件")] public UnityEvent 触发格挡事件 = new UnityEvent(); [Header("音效(可选)")] public AudioPathData 格挡音效; public float 音效音量 = 1f; [Header("其他")] public bool 禁用抛射物而非销毁 = false; private SoundPlayer soundPlayer; private void Start() { soundPlayer = ServiceLocator.GetService(); } public override bool DoEffect(HitData hit, GameObject projectile) { 播放格挡特效(hit); 播放格挡音效(hit); 销毁抛射物(projectile); UnityEvent obj = 触发格挡事件; if (obj != null) { obj.Invoke(); } return true; } private void 播放格挡特效(HitData hit) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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) if ((Object)(object)格挡特效 == (Object)null) { Debug.LogWarning((object)"恶魔远程格挡:未设置格挡特效!", (Object)(object)((Component)this).gameObject); return; } Vector3 val = hit.point + 特效偏移; Quaternion identity = Quaternion.identity; identity = ((!特效跟随抛射物旋转 || !((Object)(object)hit.rigidbody != (Object)null)) ? Quaternion.LookRotation(hit.normal) : ((Component)hit.rigidbody).transform.rotation); ParticleSystem val2 = Object.Instantiate(格挡特效, val, identity); val2.Play(); float duration; if (!(特效持续时间 > 0f)) { MainModule main = val2.main; duration = ((MainModule)(ref main)).duration; } else { duration = 特效持续时间; } float num = duration; Object.Destroy((Object)(object)((Component)val2).gameObject, num); } private void 播放格挡音效(HitData hit) { //IL_0034: 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) if (!((Object)(object)soundPlayer == (Object)null) && 格挡音效 != null) { soundPlayer.PlaySoundEffectNonAlloc(格挡音效, 音效音量, hit.point, SoundEffectVariations.GetMaterialType(((Component)hit.transform).gameObject, hit.rigidbody), (Transform)null, 1f); } } private void 销毁抛射物(GameObject projectile) { if ((Object)(object)projectile == (Object)null) { return; } ProjectileHit component = projectile.GetComponent(); if ((Object)(object)component != (Object)null) { if (component.IsManagedByPool) { if (禁用抛射物而非销毁) { component.DisableProjectile(); } if (component.ReleaseSelf != null) { component.ReleaseSelf(); } } else if (禁用抛射物而非销毁) { component.DisableProjectile(); } else { Object.Destroy((Object)(object)projectile); } } else { Object.Destroy((Object)(object)projectile); } } } public class 恶魔远程格挡添加器 : MonoBehaviour { [CompilerGenerated] private sealed class <重置触发标志>d__19 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 恶魔远程格挡添加器 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <重置触发标志>d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.已触发本次 = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("特效设置")] public ParticleSystem 统一格挡特效; [Header("事件设置")] public UnityEvent 每次格挡事件; public bool 每个刚体单独触发事件 = true; [Header("筛选设置")] public bool 只添加到特定层级的刚体 = true; public LayerMask 目标层级 = LayerMask.op_Implicit(-1); [Header("调试")] public bool 显示调试日志 = false; public Color 调试颜色 = Color.red; private List<恶魔远程格挡> 格挡列表 = new List<恶魔远程格挡>(); private Unit 这个单位; private bool 已初始化 = false; private bool 已触发本次 = false; private void Start() { 初始化格挡系统(); } private void OnEnable() { if (已初始化) { 重新绑定格挡组件(); } } private void OnDisable() { 移除所有事件监听(); } public void 初始化格挡系统() { 这个单位 = ((Component)this).GetComponentInParent(); if ((Object)(object)这个单位 == (Object)null) { if (显示调试日志) { Debug.LogWarning((object)("恶魔远程格挡添加器:在 " + ((Object)((Component)this).gameObject).name + " 及其父级中未找到Unit组件!"), (Object)(object)((Component)this).gameObject); } return; } 查找并添加格挡组件(); 已初始化 = true; if (显示调试日志) { Debug.Log((object)$"恶魔远程格挡添加器:已为 {((Object)这个单位).name} 初始化,共添加 {格挡列表.Count} 个格挡组件", (Object)(object)((Component)this).gameObject); } } private void 查找并添加格挡组件() { if ((Object)(object)这个单位.data == (Object)null || (Object)(object)这个单位.data.allRigs == (Object)null) { if (显示调试日志) { Debug.LogWarning((object)("恶魔远程格挡添加器:单位 " + ((Object)这个单位).name + " 的 data.allRigs 为空!"), (Object)(object)((Component)this).gameObject); } return; } Rigidbody[] allRigs = 这个单位.data.allRigs.AllRigs; if (allRigs == null || allRigs.Length == 0) { if (显示调试日志) { Debug.LogWarning((object)("恶魔远程格挡添加器:单位 " + ((Object)这个单位).name + " 没有找到任何刚体!"), (Object)(object)((Component)this).gameObject); } return; } int num = 0; for (int i = 0; i < allRigs.Length; i++) { if ((Object)(object)allRigs[i] == (Object)null) { continue; } GameObject gameObject = ((Component)allRigs[i]).gameObject; if (只添加到特定层级的刚体 && (1 << gameObject.layer != 1 << gameObject.layer || 1 << gameObject.layer != (((LayerMask)(ref 目标层级)).value & (1 << gameObject.layer)))) { if (显示调试日志) { Debug.Log((object)("跳过刚体 " + ((Object)gameObject).name + ",层级不匹配"), (Object)(object)gameObject); } continue; } 恶魔远程格挡 恶魔远程格挡2 = gameObject.GetComponent<恶魔远程格挡>(); if ((Object)(object)恶魔远程格挡2 == (Object)null) { 恶魔远程格挡2 = gameObject.AddComponent<恶魔远程格挡>(); if (显示调试日志) { Debug.Log((object)("为 " + ((Object)gameObject).name + " 添加了恶魔远程格挡组件"), (Object)(object)gameObject); } num++; } 配置格挡组件(恶魔远程格挡2); 添加事件监听(恶魔远程格挡2); if (!格挡列表.Contains(恶魔远程格挡2)) { 格挡列表.Add(恶魔远程格挡2); } } if (显示调试日志) { Debug.Log((object)$"恶魔远程格挡添加器:共添加了 {num} 个新的格挡组件,总计 {格挡列表.Count} 个", (Object)(object)((Component)this).gameObject); } } private void 配置格挡组件(恶魔远程格挡 格挡组件) { if (!((Object)(object)格挡组件 == (Object)null) && (Object)(object)统一格挡特效 != (Object)null) { 格挡组件.格挡特效 = 统一格挡特效; } } private void 添加事件监听(恶魔远程格挡 格挡组件) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown if ((Object)(object)格挡组件 == (Object)null) { return; } 格挡组件.触发格挡事件.RemoveListener(new UnityAction(触发事件)); if (每个刚体单独触发事件) { 格挡组件.触发格挡事件.AddListener(new UnityAction(触发事件)); return; } 格挡组件.触发格挡事件.AddListener((UnityAction)delegate { 触发事件单次(); }); } private void 触发事件单次() { if (!已触发本次) { 已触发本次 = true; 触发事件(); ((MonoBehaviour)this).StartCoroutine(重置触发标志()); } } [IteratorStateMachine(typeof(<重置触发标志>d__19))] private IEnumerator 重置触发标志() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <重置触发标志>d__19(0) { <>4__this = this }; } public void 触发事件() { UnityEvent obj = 每次格挡事件; if (obj != null) { obj.Invoke(); } if (显示调试日志) { Debug.Log((object)"恶魔远程格挡:触发了格挡事件", (Object)(object)((Component)this).gameObject); } } public void 重新绑定格挡组件() { 格挡列表.Clear(); 查找并添加格挡组件(); if (显示调试日志) { Debug.Log((object)$"恶魔远程格挡添加器:已重新绑定,当前有 {格挡列表.Count} 个格挡组件", (Object)(object)((Component)this).gameObject); } } private void 移除所有事件监听() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown foreach (恶魔远程格挡 item in 格挡列表) { if ((Object)(object)item != (Object)null) { item.触发格挡事件.RemoveListener(new UnityAction(触发事件)); } } } public void 添加单个刚体格挡(Rigidbody 目标刚体) { if (!((Object)(object)目标刚体 == (Object)null)) { 恶魔远程格挡 恶魔远程格挡2 = ((Component)目标刚体).gameObject.GetComponent<恶魔远程格挡>(); if ((Object)(object)恶魔远程格挡2 == (Object)null) { 恶魔远程格挡2 = ((Component)目标刚体).gameObject.AddComponent<恶魔远程格挡>(); } 配置格挡组件(恶魔远程格挡2); 添加事件监听(恶魔远程格挡2); if (!格挡列表.Contains(恶魔远程格挡2)) { 格挡列表.Add(恶魔远程格挡2); } if (显示调试日志) { Debug.Log((object)("手动为 " + ((Object)目标刚体).name + " 添加了格挡组件"), (Object)(object)((Component)this).gameObject); } } } public void 移除单个刚体格挡(Rigidbody 目标刚体) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown if ((Object)(object)目标刚体 == (Object)null) { return; } 恶魔远程格挡 component = ((Component)目标刚体).gameObject.GetComponent<恶魔远程格挡>(); if ((Object)(object)component != (Object)null) { component.触发格挡事件.RemoveListener(new UnityAction(触发事件)); Object.Destroy((Object)(object)component); 格挡列表.Remove(component); if (显示调试日志) { Debug.Log((object)("移除了 " + ((Object)目标刚体).name + " 的格挡组件"), (Object)(object)((Component)this).gameObject); } } } public void 设置格挡启用(bool 启用) { foreach (恶魔远程格挡 item in 格挡列表) { if ((Object)(object)item != (Object)null) { ((Behaviour)item).enabled = 启用; } } if (显示调试日志) { Debug.Log((object)("格挡系统已" + (启用 ? "启用" : "禁用")), (Object)(object)((Component)this).gameObject); } } public int 获取格挡组件数量() { return 格挡列表.Count; } private void OnDestroy() { 移除所有事件监听(); } } public class 自由切换武器 : MonoBehaviour { public Unit 当前单位; public DataHandler 当前单位数据; private GameObject 当前右手武器; private GameObject 当前左手武器; public Transform 右手挂载点; public Transform 左手挂载点; public 动态修改攻击距离工具 切换攻击距离工具; public float 质量补偿 = 1.4f; private GameObject 原始右手武器; private GameObject 原始左手武器; private PropItemData 原始右手武器数据; private PropItemData 原始左手武器数据; private void Start() { Transform root = ((Component)this).transform.root; 当前单位 = ((Component)root).GetComponent(); 当前单位数据 = 当前单位.data; if ((Object)(object)右手挂载点 == (Object)null) { HandRight componentInChildren = ((Component)root).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { 右手挂载点 = ((Component)componentInChildren).transform; } } if ((Object)(object)左手挂载点 == (Object)null) { HandLeft componentInChildren2 = ((Component)root).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { 左手挂载点 = ((Component)componentInChildren2).transform; } } WeaponHandler componentInChildren3 = ((Component)当前单位).GetComponentInChildren(); if ((Object)(object)componentInChildren3 != (Object)null) { if ((Object)(object)componentInChildren3.rightWeapon != (Object)null) { 当前右手武器 = ((Component)componentInChildren3.rightWeapon).gameObject; 原始右手武器 = 当前右手武器; } if ((Object)(object)componentInChildren3.leftWeapon != (Object)null) { 当前左手武器 = ((Component)componentInChildren3.leftWeapon).gameObject; 原始左手武器 = 当前左手武器; } } } public void 切换右手武器(GameObject 新武器) { 切换右手武器(新武器, 保持双持偏移: true); } public void 切换左手武器(GameObject 新武器) { 切换左手武器(新武器, 保持双持偏移: true); } public void 切换右手武器(GameObject 新武器, bool 保持双持偏移 = true) { if (!((Object)(object)右手挂载点 == (Object)null)) { Debug.Log((object)"开始切换右手武器"); if ((Object)(object)当前右手武器 != (Object)null) { Object.Destroy((Object)(object)当前右手武器); } if ((Object)(object)新武器 != (Object)null) { 当前右手武器 = 实例化武器(新武器, 右手挂载点, 保持双持偏移); 配置武器组件(当前右手武器, (HandType)0); } } } public void 切换左手武器(GameObject 新武器, bool 保持双持偏移 = true) { if (!((Object)(object)左手挂载点 == (Object)null)) { Debug.Log((object)"开始切换左手武器"); if ((Object)(object)当前左手武器 != (Object)null) { Object.Destroy((Object)(object)当前左手武器); } if ((Object)(object)新武器 != (Object)null) { 当前左手武器 = 实例化武器(新武器, 左手挂载点, 保持双持偏移); 配置武器组件(当前左手武器, (HandType)1); } } } public void 切换双持武器(GameObject 右手武器, GameObject 左手武器) { bool flag = true; 切换右手武器(右手武器, !flag); 切换左手武器(左手武器, !flag); Debug.Log((object)"双持武器切换完成"); } private GameObject 实例化武器(GameObject 武器预制体, Transform 挂载点, bool 执行偏移修正) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00b3: 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_00c1: 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_00d3: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(武器预制体, 挂载点.position, 挂载点.rotation, ((Component)当前单位).transform); if (执行偏移修正) { HandRight componentInChildren = val.GetComponentInChildren(); HandLeft componentInChildren2 = val.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { Vector3 val2 = 挂载点.position - ((Component)componentInChildren).transform.position; Transform transform = val.transform; transform.position += val2; Debug.Log((object)$"右手武器位置修正: {val2}"); } else if ((Object)(object)componentInChildren2 != (Object)null) { Vector3 val3 = 挂载点.position - ((Component)componentInChildren2).transform.position; Transform transform2 = val.transform; transform2.position += val3; Debug.Log((object)$"左手武器位置修正: {val3}"); } } return val; } private void 配置武器组件(GameObject 武器对象, HandType 手部类型) { //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Invalid comparison between Unknown and I4 //IL_016d: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) Holdable component = 武器对象.GetComponent(); WeaponItem component2 = 武器对象.GetComponent(); Weapon component3 = 武器对象.GetComponent(); WeaponHandler componentInChildren = ((Component)当前单位).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return; } if ((Object)(object)component != (Object)null) { component.holdingHandler = 当前单位.holdingHandler; if ((int)手部类型 == 0) { 当前单位.holdingHandler.rightHandActivity = (HandActivity)1; 当前单位.holdingHandler.rightObject = component; if ((Object)(object)当前左手武器 != (Object)null) { HoldableDataInstance holdableData = component.holdableData; holdableData.relativePosition.x = holdableData.relativePosition.x + 0.5f; } } else { 当前单位.holdingHandler.leftHandActivity = (HandActivity)2; 当前单位.holdingHandler.leftObject = component; HoldableDataInstance holdableData2 = component.holdableData; holdableData2.relativePosition.x = Mathf.Abs(holdableData2.relativePosition.x) * -1f; holdableData2.upRotation.x = holdableData2.upRotation.x * -1f; holdableData2.forwardRotation.x = holdableData2.forwardRotation.x * -1f; } } componentInChildren.SetWeapon(component3, 手部类型); if ((Object)(object)component2 != (Object)null) { component2.Initialize(当前单位.Team); } if ((Object)(object)componentInChildren != (Object)null && (Object)(object)component3 != (Object)null && (Object)(object)当前单位.unitBlueprint != (Object)null) { UnitBlueprint unitBlueprint = 当前单位.unitBlueprint; component3.maxRange *= unitBlueprint.rangeMultiplier; component3.internalCooldown /= unitBlueprint.attackSpeedMultiplier; Level component4 = ((Component)component3).GetComponent(); if ((Object)(object)component4 != (Object)null) { component4.levelMultiplier *= unitBlueprint.damageMultiplier; } if (Object.op_Implicit((Object)(object)切换攻击距离工具)) { 切换攻击距离工具.修改攻击和偏好距离(component3.maxRange, component3.maxRange - 0.5f); } } if ((Object)(object)component3 != (Object)null && (Object)(object)component3.rigidbody != (Object)null && (Object)(object)当前单位.unitBlueprint != (Object)null) { Rigidbody rigidbody = component3.rigidbody; rigidbody.mass *= 当前单位.unitBlueprint.massMultiplier * 质量补偿; } Debug.Log((object)$"武器配置完成 - 手部: {手部类型}"); } public void 恢复原始武器() { if ((Object)(object)原始右手武器 != (Object)null) { 切换右手武器(原始右手武器, 保持双持偏移: true); } if ((Object)(object)原始左手武器 != (Object)null) { 切换左手武器(原始左手武器, 保持双持偏移: true); } Debug.Log((object)"已恢复原始武器配置"); } public void 卸下右手武器() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)当前右手武器 != (Object)null) { Object.Destroy((Object)(object)当前右手武器); 当前右手武器 = null; WeaponHandler componentInChildren = ((Component)当前单位).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.SetWeapon((Weapon)null, (HandType)0); 当前单位.holdingHandler.rightHandActivity = (HandActivity)0; 当前单位.holdingHandler.rightObject = null; } } } public void 卸下左手武器() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)当前左手武器 != (Object)null) { Object.Destroy((Object)(object)当前左手武器); 当前左手武器 = null; WeaponHandler componentInChildren = ((Component)当前单位).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.SetWeapon((Weapon)null, (HandType)1); 当前单位.holdingHandler.leftHandActivity = (HandActivity)0; 当前单位.holdingHandler.leftObject = null; } } } public void 卸下所有武器() { 卸下右手武器(); 卸下左手武器(); } public string 获取武器信息() { string text = (((Object)(object)当前右手武器 != (Object)null) ? ((Object)当前右手武器).name : "空"); string text2 = (((Object)(object)当前左手武器 != (Object)null) ? ((Object)当前左手武器).name : "空"); return "右手武器: " + text + ", 左手武器: " + text2; } } public class 武器飞到手中 : MonoBehaviour { public enum 移动目标 { 左手, 右手 } public 移动目标 目标 = 移动目标.右手; public float 移动时间 = 1f; public UnityEvent 到达位置事件; public Vector3 旋转方向 = new Vector3(1f, 1f, 0f); public float 旋转速度 = 90f; public GameObject 到达位置爆炸; private Unit 此单位; private Transform 左手变换; private Transform 右手变换; private bool 开始 = false; private float 已用时间 = 0f; private Vector3 起始位置; private Vector3 起始目标位置; private float df = 1f; private void Start() { 此单位 = ((Component)((Component)this).transform.root).GetComponent(); 左手变换 = 此单位.data.leftHand; 右手变换 = 此单位.data.rightHand; } public void 开始飞行() { //IL_0008: 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) //IL_002e: 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_0033: Unknown result type (might be due to invalid IL or missing references) 起始位置 = ((Component)this).transform.position; 起始目标位置 = ((目标 == 移动目标.左手) ? 左手变换.position : 右手变换.position); df = ((目标 == 移动目标.左手) ? 1 : (-1)); 已用时间 = 0f; 开始 = true; } private void Update() { //IL_0116: 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_0080: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)左手变换) || !Object.op_Implicit((Object)(object)右手变换) || !开始) { return; } 已用时间 += Time.deltaTime; if (已用时间 >= 移动时间) { Vector3 val = ((目标 == 移动目标.左手) ? 左手变换.position : 右手变换.position); ((Component)this).transform.position = val; if (Object.op_Implicit((Object)(object)到达位置爆炸)) { GameObject val2 = Object.Instantiate(到达位置爆炸, val, Quaternion.identity); TeamHolder.AddTeamHolder(val2, ((Component)此单位).gameObject); } UnityEvent obj = 到达位置事件; if (obj != null) { obj.Invoke(); } 开始 = false; } else { float num = 已用时间 / 移动时间; Vector3 val3 = ((目标 == 移动目标.左手) ? 左手变换.position : 右手变换.position); Vector3 val4 = val3 - 起始目标位置; Vector3 val5 = val3; ((Component)this).transform.position = Vector3.Lerp(起始位置, val5, num); Vector3 val6 = default(Vector3); ((Vector3)(ref val6))..ctor(旋转方向.x, 旋转方向.y * df, 旋转方向.z); Transform transform = ((Component)this).transform; transform.rotation *= Quaternion.Euler(val6 * 旋转速度 * Time.deltaTime); } } } public class 生成新的单位在此处 : MonoBehaviour { public bool 删除原单位 = true; public UnitBlueprint 单位蓝图; private Unit 这个单位; private void Start() { 这个单位 = ((Component)((Component)this).transform.root).GetComponent(); } public void 生成单位() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)这个单位 != (Object)null && (Object)(object)单位蓝图 != (Object)null) { 单位蓝图.Spawn(((Component)this).transform.position, ((Component)this).transform.rotation, 这个单位.data.team, 1f, (UnitPoolInfo?)null); if (删除原单位) { Object.Destroy((Object)(object)((Component)这个单位).gameObject); } } } } public class 触发器碰撞伤害 : MonoBehaviour { [SerializeField] public float 碰撞伤害 = 400f; [SerializeField] private float 伤害冷却时间 = 0.1f; [SerializeField] private LayerMask 目标层 = LayerMask.op_Implicit(16385); private Unit 当前单位; private Team 当前队伍; private Dictionary 上次伤害时间 = new Dictionary(); private void Start() { //IL_005d: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) 当前单位 = ((Component)this).GetComponentInParent(); if ((Object)(object)当前单位 == (Object)null) { TeamHolder componentInParent = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent)) { 当前队伍 = ((Component)this).GetComponentInParent().team; } else { 当前队伍 = (Team)0; } } else { 当前队伍 = 当前单位.data.team; } } private void OnTriggerEnter(Collider other) { if (IsInTargetLayer(((Component)other).gameObject)) { 尝试造成伤害(other); } } private void OnTriggerStay(Collider other) { if (IsInTargetLayer(((Component)other).gameObject)) { 尝试造成伤害(other); } } private bool IsInTargetLayer(GameObject obj) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return ((1 << obj.layer) & LayerMask.op_Implicit(目标层)) != 0; } private void 尝试造成伤害(Collider other) { //IL_0012: 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_0076: Unknown result type (might be due to invalid IL or missing references) DataHandler componentInParent = ((Component)other).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && componentInParent.team != 当前队伍 && !componentInParent.Dead && (!上次伤害时间.TryGetValue(other, out var value) || !(Time.time - value < 伤害冷却时间))) { ((Damagable)componentInParent.healthHandler).TakeDamage(碰撞伤害, ((Component)other).transform.position, (Unit)null, (DamageType)0); 上次伤害时间[other] = Time.time; } } private void OnTriggerExit(Collider other) { 上次伤害时间.Remove(other); } } public class 碰撞检测实例化效果父类 : MonoBehaviour { public enum 施加方式 { 对敌方, 全部, 对自己和对于, 仅自己 } public enum 检测方式 { 物体, 单位 } public UnitEffectBase 效果设置; public float 检测半径 = 6f; public LayerMask 检测层; private Unit 存储单位; public 施加方式 效果施加对应 = 施加方式.对敌方; private Team 队伍信息; public 检测方式 sss = 检测方式.单位; private void Start() { //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) //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) if (sss == 检测方式.单位) { 存储单位 = ((Component)this).GetComponentInParent(); 队伍信息 = 存储单位.data.team; } if (sss == 检测方式.物体) { 队伍信息 = ((Component)this).GetComponentInParent().team; } } public void 开始检测() { //IL_0007: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 检测半径, LayerMask.op_Implicit(检测层)); if (array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { Unit componentInParent = ((Component)array[i]).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || componentInParent.data.Dead) { continue; } bool flag = false; switch (效果施加对应) { case 施加方式.对敌方: flag = componentInParent.data.team != 队伍信息; break; case 施加方式.全部: flag = true; break; case 施加方式.对自己和对于: flag = componentInParent.data.team == 队伍信息; break; case 施加方式.仅自己: { Unit componentInParent2 = ((Component)this).GetComponentInParent(); flag = (Object)(object)componentInParent == (Object)(object)componentInParent2; break; } } if (flag) { UnitEffectBase val = UnitEffectBase.AddEffectToTarget(((Component)((Component)array[i]).transform).gameObject, 效果设置); if ((Object)(object)val == (Object)null) { val = Object.Instantiate(效果设置, ((Component)array[i]).transform); ((Component)val).transform.SetPositionAndRotation(((Component)array[i]).transform.position, Quaternion.identity); TeamHolder.AddTeamHolder(((Component)val).gameObject, ((Component)this).gameObject); val.DoEffect(); } else { val.Ping(); } 完成检测(val, 存储单位, componentInParent, ((Component)((Component)this).transform).gameObject); } } } public virtual void 完成检测(UnitEffectBase 效果实例, Unit 召唤者, Unit 受影响者, GameObject 召唤物体) { } private void OnDrawGizmos() { //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) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = new Color(0f, 1f, 0f, 0.3f); Gizmos.DrawSphere(((Component)this).transform.position, 检测半径); Gizmos.color = Color.green; Gizmos.DrawWireSphere(((Component)this).transform.position, 检测半径); } } public class 禁锢效果专用碰撞 : 碰撞检测实例化效果父类 { public override void 完成检测(UnitEffectBase 效果实例, Unit 召唤者, Unit 受影响者, GameObject 召唤物体) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)效果实例 != (Object)null) { 卫兹南禁锢效果 component = ((Component)效果实例).GetComponent<卫兹南禁锢效果>(); if ((Object)(object)component != (Object)null) { component.召唤物 = 召唤物体; component.这个单位 = 受影响者; } if (((Object)((Component)效果实例).transform.parent).name == "TankBase") { Transform transform = ((Component)效果实例).transform; transform.localScale *= 0.03f; } } } } public class 卫兹南禁锢效果 : MonoBehaviour { public Unit 这个单位; public GameObject 召唤物; public GameObject 禁锢召唤wu; public float 地面高度 = 30f; public void 开始禁锢() { if ((Object)(object)这个单位 != (Object)null && 这个单位.data.isGrounded) { 这个单位.data.mainRig.isKinematic = true; } } public void 结束禁锢() { if ((Object)(object)这个单位 != (Object)null) { 这个单位.data.mainRig.isKinematic = false; } } public void 在单位位置召唤地面禁锢特效() { //IL_003e: 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_0053: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)这个单位 != (Object)null && 这个单位.data.isGrounded) { GameObject val = Object.Instantiate(禁锢召唤wu, 获取地面位置(这个单位.data.mainRig.position, 地面高度), Quaternion.identity); if ((Object)(object)召唤物 != (Object)null) { TeamHolder.AddTeamHolder(val, 召唤物); } } } private Vector3 获取地面位置(Vector3 测试位置, float 检测高度 = 10f, int 地面层级 = 512) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) RaycastHit val = default(RaycastHit); if (Physics.Raycast(测试位置, Vector3.down, ref val, 检测高度, 地面层级)) { return ((RaycastHit)(ref val)).point; } return new Vector3(测试位置.x, 测试位置.y - 检测高度 * 0.5f, 测试位置.z); } } public class 离开父级可控版本 : MonoBehaviour { public bool playOnStart = false; private GameObject 原父级; private void Start() { if (playOnStart) { play(); } } public void play() { Transform parent = ((Component)this).transform.parent; 原父级 = ((parent != null) ? ((Component)parent).gameObject : null); ((Component)this).transform.SetParent((Transform)null); if ((Object)(object)原父级 != (Object)null) { 父级销毁监听器222 父级销毁监听器223 = 原父级.AddComponent<父级销毁监听器222>(); 父级销毁监听器223.初始化(this); } } public void 父级被销毁() { Object.Destroy((Object)(object)((Component)this).gameObject); } } public class 父级销毁监听器222 : MonoBehaviour { private 离开父级可控版本 目标脚本; public void 初始化(离开父级可控版本 脚本) { 目标脚本 = 脚本; } private void OnDestroy() { if ((Object)(object)目标脚本 != (Object)null) { 目标脚本.父级被销毁(); } } } public class 积分事件 : MonoBehaviour { public UnityEvent 反向事件; public UnityEvent 事件; public int 临界值 = 5; public int 初始积分 = 0; public int 自动加分 = 1; public bool 自动重置 = true; private int 当前积分 = 0; private void Start() { 当前积分 = 初始积分; } public void 尝试触发() { 当前积分 += 自动加分; if (当前积分 >= 临界值) { UnityEvent obj = 事件; if (obj != null) { obj.Invoke(); } if (自动重置) { 重置积分(); } } else { UnityEvent obj2 = 反向事件; if (obj2 != null) { obj2.Invoke(); } } } public void 重置积分() { 当前积分 = 初始积分; } } public class 恶魔防火标识 : MonoBehaviour { } public class 防火添加器 : MonoBehaviour { private void Start() { 恶魔防火标识 恶魔防火标识2 = ((Component)((Component)this).transform.root).gameObject.AddComponent<恶魔防火标识>(); } } public class 粒子实例化脚本简易版asdfsd : MonoBehaviour { public GameObject gameObject1; public ParticleSystem 粒子发射器; public List 所有碰撞事件; private void OnParticleCollision(GameObject other) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)粒子发射器 == (Object)null) { return; } 所有碰撞事件 = new List(); int collisionEvents = ParticlePhysicsExtensions.GetCollisionEvents(粒子发射器, other, 所有碰撞事件); foreach (ParticleCollisionEvent item in 所有碰撞事件) { ParticleCollisionEvent current = item; TeamHolder.AddTeamHolder(Object.Instantiate(gameObject1, ((ParticleCollisionEvent)(ref current)).intersection, Quaternion.identity), ((Component)this).gameObject); } } private void Start() { if (!((Object)(object)粒子发射器 != (Object)null)) { 粒子发射器 = ((Component)this).GetComponent(); } } } public class 绿火碰撞生成小球 : 碰撞检测获取单位基类 { public GameObject 生成的火球; public Transform[] 组合发射; public float 预测发射位置 = 4f; public override void 完成所有检测(Unit 召唤者, Unit[] 受影响者) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) List list = new List(); if (受影响者 != null && 受影响者.Length != 0) { for (int i = 0; i < 受影响者.Length; i++) { list.Add(((Component)受影响者[i].data.mainRig).transform); } } 移动变换导弹[] array = 实例化抛射物组合发射内部(); if (list.Count != 0 && array != null && array.Length != 0) { for (int j = 0; j < array.Length; j++) { Vector3 cc = ((Component)array[j]).transform.TransformPoint(0f, 0f, 预测发射位置); Transform 追踪目标 = 最近获取(cc, list.ToArray()); array[j].追踪目标 = 追踪目标; } } } private Transform 最近获取(Vector3 cc, Transform[] 数组) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (数组 == null || 数组.Length == 0) { Debug.LogWarning((object)"参数无效:目标为空或数组为空"); return null; } Transform result = null; float num = float.PositiveInfinity; foreach (Transform val in 数组) { if (!((Object)(object)val == (Object)null)) { Vector3 val2 = cc - val.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = val; } } } return result; } public void 实例化抛射物() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)生成的火球 == (Object)null)) { GameObject val = Object.Instantiate(生成的火球, ((Component)this).transform.position, ((Component)this).transform.rotation); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); } } public void 实例化抛射物组合发射() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (组合发射 != null && 组合发射.Length != 0) { for (int i = 0; i < 组合发射.Length; i++) { GameObject val = Object.Instantiate(生成的火球, 组合发射[i].position, 组合发射[i].rotation); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); } } } private 移动变换导弹[] 实例化抛射物组合发射内部() { //IL_0034: 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) List<移动变换导弹> list = new List<移动变换导弹>(); if (组合发射 != null && 组合发射.Length != 0) { for (int i = 0; i < 组合发射.Length; i++) { GameObject val = Object.Instantiate(生成的火球, 组合发射[i].position, 组合发射[i].rotation); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); 移动变换导弹 component = val.GetComponent<移动变换导弹>(); if ((Object)(object)component != (Object)null) { list.Add(component); } } } return list.ToArray(); } } public class 移动变换导弹 : MonoBehaviour { [Header("追踪设置")] public Transform 追踪目标; public float 追踪力度 = 10f; public float 转换速度 = 1f; public float 增量速度 = 4f; [Header("目标重试设置")] public int 最大重试次数 = 7; private MoveTransform 移动组件; private TeamHolder 队伍; private float 当前运行时间 = 0f; private float 当前旋转速度 = 0f; private Vector3 初始速度; private int 当前重试次数 = 0; private void Start() { //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) 移动组件 = ((Component)this).GetComponent(); if ((Object)(object)移动组件 == (Object)null) { Debug.LogError((object)"移动变换导弹:缺少MoveTransform组件!"); ((Behaviour)this).enabled = false; } else { 队伍 = ((Component)((Component)this).transform.root).GetComponent(); 初始速度 = 移动组件.velocity; 当前重试次数 = 最大重试次数; } } private void Update() { if (!((Object)(object)移动组件 == (Object)null) && ((Behaviour)移动组件).enabled) { if ((Object)(object)追踪目标 == (Object)null) { 尝试获取追踪目标(); } else if ((Object)(object)追踪目标 == (Object)null || !((Component)追踪目标).gameObject.activeInHierarchy) { 追踪目标 = null; } else { 执行追踪(); } } } private void 尝试获取追踪目标() { if (当前重试次数 <= 0) { return; } 当前重试次数--; if ((Object)(object)队伍 == (Object)null || (Object)(object)队伍.spawner == (Object)null) { return; } GameObject spawner = 队伍.spawner; if ((Object)(object)spawner == (Object)null) { return; } Unit component = spawner.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.data != (Object)null && (Object)(object)component.data.targetData != (Object)null) { Transform transform = ((Component)component.data.targetData.mainRig).transform; if ((Object)(object)transform != (Object)null) { 追踪目标 = transform; Debug.Log((object)("成功获取追踪目标: " + ((Object)追踪目标).name)); } } } private void 执行追踪() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) 当前运行时间 += Time.deltaTime; if ((double)当前运行时间 > 0.2) { Vector3 val = 追踪目标.position - ((Component)this).transform.position; Vector3 val2 = ((Vector3)(ref val)).normalized * 追踪力度; 移动组件.velocity = Vector3.Lerp(移动组件.velocity, val2, Time.deltaTime * 转换速度); 转换速度 += Time.deltaTime * 增量速度; } } } public class 胸口雷电光线实例化 : 检测目标并操作父类 { [CompilerGenerated] private sealed class <更新闪电协程>d__29 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 胸口雷电光线实例化 <>4__this; private float <生命周期进度>5__1; private float <生命值>5__2; private float <抖动强度值>5__3; private int <新分段数>5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <更新闪电协程>d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (<>4__this.闪电激活 && <>4__this.当前时间 < <>4__this.闪电持续时间) { <>4__this.当前时间 += <>4__this.刷新频率; <生命周期进度>5__1 = <>4__this.当前时间 / <>4__this.闪电持续时间; <生命值>5__2 = <>4__this.闪电生命周期曲线.Evaluate(<生命周期进度>5__1); <抖动强度值>5__3 = <>4__this.抖动强度曲线.Evaluate(<生命周期进度>5__1) * <>4__this.最大抖动范围; <新分段数>5__4 = <>4__this.计算当前分段数(<生命周期进度>5__1); if (<新分段数>5__4 != <>4__this.当前分段数) { <>4__this.重新计算分段数(<新分段数>5__4); } <>4__this.更新闪电位置(<抖动强度值>5__3); <>4__this.更新闪电视觉效果(<生命值>5__2); <>2__current = (object)new WaitForSeconds(<>4__this.刷新频率); <>1__state = 1; return true; } if ((Object)(object)<>4__this.存储线渲染器 != (Object)null) { Object.Destroy((Object)(object)((Component)<>4__this.存储线渲染器).gameObject); } <>4__this.闪电激活 = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public GameObject 带有线渲染器的预制体; public float 击中伤害 = 900f; public UnitEffectBase 被添加的效果; public GameObject 在目标位置生成的预制体; public bool 生成预制体时计算地面 = false; public Transform 雷电起点; private Transform 雷电终点; private LineRenderer 存储线渲染器; [Header("闪电效果设置")] public AnimationCurve 闪电生命周期曲线; public AnimationCurve 抖动强度曲线; public AnimationCurve 闪电分段数曲线; public int 闪电分段数 = 10; public float 最大抖动范围 = 0.5f; public float 闪电持续时间 = 0.5f; public float 刷新频率 = 0.02f; public bool 使用世界坐标 = true; public bool 固定闪电落点 = false; private float 当前时间 = 0f; private bool 闪电激活 = false; private List 原始点位置 = new List(); private List 当前点位置 = new List(); private float 计时器 = 0f; private int 当前分段数 = 0; private Vector3 固定终点位置; public override void 检测操作逻辑(Unit 此单位, DataHandler 此单位数据, DataHandler 目标单位数据) { //IL_0089: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_0071: Unknown result type (might be due to invalid IL or missing references) base.检测操作逻辑(此单位, 此单位数据, 目标单位数据); 雷电终点 = ((Component)目标单位数据.mainRig).transform; GameObject val = 实例化物体(在目标位置生成的预制体); if (Object.op_Implicit((Object)(object)val)) { val.transform.position = 雷电终点.position; if (生成预制体时计算地面) { val.transform.position = 获取地面位置(val.transform.position); } } GameObject val2 = Object.Instantiate(带有线渲染器的预制体, ((Component)this).transform.position, Quaternion.identity); if ((Object)(object)val2 != (Object)null) { LineRenderer component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { 存储线渲染器 = component; 开始闪电效果(); } } ((Damagable)目标单位数据.healthHandler).TakeDamage(击中伤害, 雷电终点.position, 此单位, (DamageType)0); if ((Object)(object)被添加的效果 != (Object)null) { 添加效果(雷电终点); } } private void 开始闪电效果() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)存储线渲染器 == (Object)null) && !((Object)(object)雷电起点 == (Object)null) && !((Object)(object)雷电终点 == (Object)null)) { 闪电激活 = true; 当前时间 = 0f; 计时器 = 0f; if (固定闪电落点) { 固定终点位置 = 雷电终点.position; } 当前分段数 = 计算当前分段数(0f); 存储线渲染器.positionCount = 当前分段数; 存储线渲染器.useWorldSpace = 使用世界坐标; 计算原始直线点(); ((MonoBehaviour)this).StartCoroutine(更新闪电协程()); } } private int 计算当前分段数(float 进度) { if (闪电分段数曲线 == null || 闪电分段数曲线.keys.Length == 0) { return 闪电分段数; } float num = 闪电分段数曲线.Evaluate(进度); int num2 = 2; int num3 = Mathf.Max(num2 + 1, 闪电分段数 * 2); return Mathf.Clamp(Mathf.RoundToInt(Mathf.Lerp((float)num2, (float)num3, num)), num2, num3); } private void 重新计算分段数(int 新分段数) { if (当前分段数 != 新分段数) { 当前分段数 = 新分段数; 存储线渲染器.positionCount = 当前分段数; 计算原始直线点(); } } private void 计算原始直线点() { //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_002f: 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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) 原始点位置.Clear(); Vector3 position = 雷电起点.position; Vector3 val = (固定闪电落点 ? 固定终点位置 : 雷电终点.position); for (int i = 0; i < 当前分段数; i++) { float num = (float)i / (float)(当前分段数 - 1); Vector3 item = Vector3.Lerp(position, val, num); 原始点位置.Add(item); } } [IteratorStateMachine(typeof(<更新闪电协程>d__29))] private IEnumerator 更新闪电协程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <更新闪电协程>d__29(0) { <>4__this = this }; } private void 更新闪电位置(float 抖动强度) { //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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_009d: 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) //IL_00a4: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00bb: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00ca: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_00e8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)存储线渲染器 == (Object)null) { return; } 当前点位置.Clear(); Vector3 position = 雷电起点.position; Vector3 val = (固定闪电落点 ? 固定终点位置 : 雷电终点.position); for (int i = 0; i < 当前分段数; i++) { if (i == 0) { 当前点位置.Add(position); continue; } if (i == 当前分段数 - 1) { 当前点位置.Add(val); continue; } Vector3 val2 = 原始点位置[i]; Vector3 insideUnitSphere = Random.insideUnitSphere; Vector3 val3 = val - position; Vector3 normalized = ((Vector3)(ref val3)).normalized; val3 = Vector3.ProjectOnPlane(insideUnitSphere, normalized); insideUnitSphere = ((Vector3)(ref val3)).normalized; if (insideUnitSphere == Vector3.zero) { insideUnitSphere = Random.insideUnitSphere; } Vector3 val4 = insideUnitSphere * 抖动强度; float num = (float)i / (float)(当前分段数 - 1); float num2 = Mathf.Sin(num * (float)Math.PI); val4 *= num2; 当前点位置.Add(val2 + val4); } for (int j = 0; j < 当前分段数; j++) { 存储线渲染器.SetPosition(j, 当前点位置[j]); } } private void 更新闪电视觉效果(float 生命值) { //IL_005d: 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_006d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)存储线渲染器 == (Object)null)) { float num = Mathf.Lerp(0.1f, 0.5f, 生命值); 存储线渲染器.startWidth = num; 存储线渲染器.endWidth = num * 0.5f; Material material = ((Renderer)存储线渲染器).material; if ((Object)(object)material != (Object)null) { Color color = material.color; color.a = 生命值; material.color = color; } } } private void Update() { if (闪电激活 && (Object)(object)存储线渲染器 != (Object)null && (Object)(object)雷电起点 != (Object)null) { if (!固定闪电落点 && (Object)(object)雷电终点 != (Object)null) { 计算原始直线点(); } else if (固定闪电落点) { 计算原始直线点(); } } } public Vector3 获取地面位置(Vector3 测试位置, float 检测高度 = 10f, int 地面层级 = 512) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(测试位置.x, 测试位置.y + 检测高度, 测试位置.z); float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, 地面层级)) { return ((RaycastHit)(ref val2)).point; } return new Vector3(测试位置.x, 测试位置.y - 检测高度 * 0.5f, 测试位置.z); } private GameObject 实例化物体(GameObject obj) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)obj == (Object)null) { return null; } GameObject val = Object.Instantiate(obj, ((Component)this).transform.position, Quaternion.identity); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); return val; } private UnitEffectBase 添加效果(Transform 目标) { //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) if ((Object)(object)被添加的效果 == (Object)null) { return null; } UnitEffectBase val = UnitEffectBase.AddEffectToTarget(((Component)目标).gameObject, 被添加的效果); if ((Object)(object)val == (Object)null) { val = Object.Instantiate(被添加的效果, 目标); ((Component)val).transform.SetPositionAndRotation(目标.position, Quaternion.identity); TeamHolder.AddTeamHolder(((Component)val).gameObject, ((Component)this).gameObject); val.DoEffect(); } else { val.Ping(); } return val; } } public class 随机召唤陨石类 : MonoBehaviour { [Header("范围参数")] [Tooltip("陨石生成的高度范围(基于当前物体Y轴向上偏移)")] public float 高度; [Tooltip("地面目标点的水平范围(XZ平面随机偏移)")] public float 地面范围; [Tooltip("天空生成点的水平范围(XZ平面随机偏移,可独立于地面范围)")] public float 天空范围; [Header("陨石预制体")] public GameObject 陨石预制体; [Header("调试")] public bool 在生成时显示Gizmos = true; public void 召唤陨石() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)陨石预制体 == (Object)null) { Debug.LogError((object)"陨石预制体未赋值!"); return; } Vector3 val = 获取随机地面点(); Vector3 val2 = 获取随机天空点(); GameObject val3 = Object.Instantiate(陨石预制体, val2, Quaternion.identity); TeamHolder.AddTeamHolder(val3, ((Component)this).gameObject); val3.transform.LookAt(val); } public Vector3 获取随机地面点() { //IL_0001: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Random.insideUnitCircle * 地面范围; Vector3 result = default(Vector3); ((Vector3)(ref result))..ctor(((Component)this).transform.position.x + val.x, ((Component)this).transform.position.y, ((Component)this).transform.position.z + val.y); return result; } public Vector3 获取随机天空点() { //IL_0001: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) //IL_0062: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Random.insideUnitCircle * 天空范围; Vector3 result = default(Vector3); ((Vector3)(ref result))..ctor(((Component)this).transform.position.x + val.x, ((Component)this).transform.position.y + 高度, ((Component)this).transform.position.z + val.y); return result; } } } namespace rwdseerfd.角色类.小兵类.毒液佣兵 { public class 启动瓶子碎裂 : MonoBehaviour { public Rigidbody[] 碎片刚体; public Collider[] 碎片碰撞体; public float 最大力 = 300f; public float 最小力 = 30f; public Transform 中心; public void 施加力并释放碎片() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (碎片刚体 != null && 碎片碰撞体 != null && 碎片刚体.Length != 0 && 碎片碰撞体.Length != 0) { for (int i = 0; i < 碎片刚体.Length; i++) { 碎片刚体[i].isKinematic = false; Rigidbody obj = 碎片刚体[i]; Vector3 val = 碎片刚体[i].position - 中心.position; obj.AddForce(((Vector3)(ref val)).normalized * Random.Range(最小力, 最大力), (ForceMode)5); } for (int j = 0; j < 碎片碰撞体.Length; j++) { 碎片碰撞体[j].enabled = true; } } } } public class 毒药叠加层数 : MonoBehaviour { [Header("颜色设置")] public UnitColorInstance 中毒颜色 = new UnitColorInstance { colorName = "Poisonedcolor123", color = new Color(0f, 1.2f, 0f) }; [Header("层数设置")] public float 最大层数 = 100f; public float 最小层数 = 10f; public float 叠加值 = 10f; public float 下降速度 = 5f; [Header("伤害设置")] public float 伤害乘数 = 1f; public float 受伤间隔时间 = 0.5f; [Header("颜色过渡设置")] public float 颜色变化速度 = 2f; public float 颜色乘数 = 2f; [Header("层数临界值设置")] public float 临界值 = 50f; public UnityEvent 到达临界值事件; private Unit 这个单位; private UnitColorHandler 单位颜色; private HealthHandler 健康管理器; private float 当前层数 = 0f; private float 受伤计时器 = 0f; private float 当前颜色强度 = 0f; private bool 已初始化 = false; private TeamHolder team; private float 临界值计时器 = 0f; private void Start() { 初始化(); } private void 初始化() { if (已初始化) { return; } if ((Object)(object)((Component)this).transform.root == (Object)null) { Debug.LogError((object)"毒药叠加层数: transform.root 为空"); return; } 这个单位 = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)这个单位 == (Object)null) { Debug.LogError((object)"毒药叠加层数: 未找到 Unit 组件"); return; } if ((Object)(object)这个单位.data == (Object)null) { Debug.LogError((object)"毒药叠加层数: Unit.data 为空"); return; } 单位颜色 = ((Component)这个单位.data).GetComponent(); if ((Object)(object)单位颜色 == (Object)null) { Debug.LogWarning((object)"毒药叠加层数: 未找到 UnitColorHandler,颜色效果将禁用"); } 健康管理器 = 这个单位.data.healthHandler; if ((Object)(object)健康管理器 == (Object)null) { Debug.LogError((object)"毒药叠加层数: 未找到 HealthHandler,伤害系统将无法工作"); return; } team = ((Component)this).GetComponent(); 已初始化 = true; } public void 叠加层数() { if (当前层数 < 最大层数) { 当前层数 = Mathf.Min(当前层数 + 叠加值, 最大层数); } if (当前层数 >= 临界值 && (double)临界值计时器 >= 0.1) { UnityEvent obj = 到达临界值事件; if (obj != null) { obj.Invoke(); } 临界值计时器 = 0f; } } public void 设置层数(float f) { 当前层数 = f; } public void 召唤爆炸效果(GameObject obj) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)team == (Object)null || (Object)(object)obj == (Object)null || (Object)(object)这个单位 == (Object)null) { Debug.Log((object)"队伍系统或召唤物为null"); return; } GameObject val = Object.Instantiate(obj, 这个单位.data.mainRig.position, Quaternion.identity); TeamHolder.AddTeamHolder(val, team.spawner); } private void Update() { if (已初始化 && !((Object)(object)健康管理器 == (Object)null)) { if (当前层数 > 0f) { 当前层数 = Mathf.Max(0f, 当前层数 - 下降速度 * Time.deltaTime); 受伤计时器 += Time.deltaTime; 临界值计时器 += Time.deltaTime; 受伤调用(); } 颜色调用(); } } private void 受伤调用() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)健康管理器 == (Object)null) && !这个单位.data.Dead && 受伤计时器 >= 受伤间隔时间) { float num = 当前层数 * 伤害乘数; if (num > 0f) { ((Damagable)健康管理器).TakeDamage(num, ((Component)this).transform.position, (Unit)null, (DamageType)0); } 受伤计时器 = 0f; } } private void 颜色调用() { if (!((Object)(object)单位颜色 == (Object)null)) { float num = 0f; if (当前层数 >= 最小层数) { num = (当前层数 - 最小层数) / (最大层数 - 最小层数); } float num2 = Mathf.Clamp01(num * 颜色乘数); 当前颜色强度 = Mathf.Lerp(当前颜色强度, num2, 颜色变化速度 * Time.deltaTime); if (中毒颜色 != null) { 单位颜色.SetColor(中毒颜色, 当前颜色强度); } } } private void OnDestroy() { if ((Object)(object)单位颜色 != (Object)null && 中毒颜色 != null) { 中毒颜色.currentValue = 0f; 单位颜色.SetColor(中毒颜色, 0f); } } } public class MeleeWeaponAddEffect加强版 : CollisionWeaponEffect { public UnitEffectBase EffectPrefab; public bool ignoreTeamMates; public override void DoEffect(Transform hitTransform, Collision hit) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (ignoreTeamMates) { Unit component = ((Component)((Component)this).transform.root).GetComponent(); Unit component2 = ((Component)hitTransform.root).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && ((Object)(object)component == (Object)(object)component2 || component.Team == component2.Team)) { return; } } Type type = ((object)EffectPrefab).GetType(); UnitEffectBase val = (UnitEffectBase)((Component)hitTransform.root).GetComponentInChildren(type); if ((Object)(object)val == (Object)null) { GameObject val2 = Object.Instantiate(((Component)EffectPrefab).gameObject, hitTransform.root); TeamHolder.AddTeamHolder(val2, ((Component)this).gameObject); val2.transform.position = hitTransform.root.position; val2.GetComponent().DoEffect(); } else { val.Ping(); } } } } namespace rwdseerfd.unity脚本存放文件夹.雷电龙类 { public class SecretUnlock强化版 : GameStateListener { [SerializeField] private string m_秘密密钥 = ""; [SerializeField] private string m_秘密描述 = ""; [SerializeField] private Sprite m_秘密图标; [SerializeField] private float m_解锁距离 = 5f; [SerializeField] private RotationShake m_旋转震动; [SerializeField] private Rigidbody m_秘密物体; private float m_注视值; private float m_解锁进度; [SerializeField] public AudioClip 击中音效; private AudioSource 循环音源; private Transform m_主相机变换; [SerializeField] public UnityEvent 解锁事件; [SerializeField] public UnityEvent 隐藏事件; private bool 已完成; [SerializeField] public Color 发光颜色; [SerializeField] public GameObject 解锁火花特效; [Header("粒子系统设置")] [SerializeField] public ParticleSystem 粒子效果; [SerializeField] public float 最大粒子值 = 400f; [SerializeField] public float 粒子变化速度 = 5f; [SerializeField] public AnimationCurve 粒子曲线 = AnimationCurve.Linear(0f, 0f, 1f, 1f); private EmissionModule 粒子发射模块; private float 当前粒子发射率; private bool 是否正在注视; protected override void Awake() { //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_004e: Unknown result type (might be due to invalid IL or missing references) ((GameStateListener)this).Awake(); if ((Object)(object)m_主相机变换 == (Object)null) { 进入新场景(); } if ((Object)(object)粒子效果 != (Object)null) { 粒子发射模块 = 粒子效果.emission; ((EmissionModule)(ref 粒子发射模块)).rateOverTime = MinMaxCurve.op_Implicit(0f); 粒子效果.Stop(true, (ParticleSystemStopBehavior)1); 当前粒子发射率 = 0f; } } private void Update() { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)m_主相机变换 != (Object)null) || !Object.op_Implicit((Object)(object)m_秘密物体) || 已完成) { if ((Object)(object)粒子效果 != (Object)null && 是否正在注视) { 是否正在注视 = false; 设置粒子系统(); } return; } 循环音源.volume = Mathf.Clamp01(m_解锁进度); float num = 1f + 1f * m_解锁进度; 循环音源.pitch = ((num >= 0f) ? num : 0f); if (m_解锁进度 > 0f || m_注视值 > 10f) { 设置颜色(); } float num2 = Vector3.Distance(m_秘密物体.worldCenterOfMass, m_主相机变换.position); if (num2 > m_解锁距离) { m_解锁进度 -= Time.unscaledDeltaTime * 0.2f; 是否正在注视 = false; 设置粒子系统(); return; } float num3 = Vector3.Angle(m_主相机变换.forward, m_秘密物体.worldCenterOfMass - m_主相机变换.position); m_注视值 = 1000f / (num2 * num3); if (m_注视值 > 8f) { float num4 = 0.2f; m_解锁进度 += num4 * Time.unscaledDeltaTime; 解锁进度反馈(); 设置粒子系统(); if (m_解锁进度 > 1f) { 解锁秘密(); } } else { m_解锁进度 -= Time.unscaledDeltaTime * 0.2f; 是否正在注视 = false; 设置粒子系统(); } } private void 解锁进度反馈() { //IL_0060: 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_007f: 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) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)m_旋转震动)) { if (m_解锁进度 <= 0f) { m_旋转震动.AddForce(Random.onUnitSphere * 2f); m_解锁进度 = 0f; } ((Behaviour)m_旋转震动).enabled = true; m_旋转震动.AddForce(Random.onUnitSphere * m_解锁进度 * Time.deltaTime * 50f); } } private void 设置颜色() { //IL_008b: 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_00a0: Unknown result type (might be due to invalid IL or missing references) m_解锁进度 = Mathf.Clamp(m_解锁进度, 0f, float.PositiveInfinity); Renderer[] componentsInChildren = ((Component)m_秘密物体).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] materials = componentsInChildren[i].materials; Material[] array = materials; foreach (Material val in array) { if (!(((Object)val.shader).name == "TFBG/EmitVertexColor") && val.HasProperty("_EmissionColor")) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", 发光颜色 * m_解锁进度 * 2f); } } componentsInChildren[i].materials = materials; } } private void 设置粒子系统() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)粒子效果 == (Object)null) { return; } float num = 粒子曲线.Evaluate(m_解锁进度) * 最大粒子值; 当前粒子发射率 = Mathf.Lerp(当前粒子发射率, num, Time.unscaledDeltaTime * 粒子变化速度); ((EmissionModule)(ref 粒子发射模块)).rateOverTime = MinMaxCurve.op_Implicit(当前粒子发射率); if (当前粒子发射率 > 0.1f) { if (!粒子效果.isPlaying) { 粒子效果.Play(); } } else if (粒子效果.isPlaying) { 粒子效果.Stop(); } } private void 解锁秘密() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled || string.IsNullOrWhiteSpace(m_秘密密钥) || ServiceLocator.GetService().HasUnlockedSecret(m_秘密密钥)) { return; } if (Object.op_Implicit((Object)(object)ScreenShake.Instance)) { ScreenShake.Instance.AddForce(Vector3.up * 8f, ((Component)m_秘密物体).transform.position); } if (Object.op_Implicit((Object)(object)解锁火花特效)) { GameObject val = Object.Instantiate(解锁火花特效, ((Component)m_秘密物体).transform.position, ((Component)m_秘密物体).transform.rotation); val.AddComponent().seconds = 5f; } ((Component)m_秘密物体).gameObject.SetActive(false); UnityEvent obj = 解锁事件; if (obj != null) { obj.Invoke(); } 循环音源.Stop(); 循环音源.volume = 1f; 循环音源.PlayOneShot(击中音效); 已完成 = true; if (string.IsNullOrWhiteSpace(m_秘密密钥)) { return; } List list = ServiceLocator.GetService().UnlockSecret(m_秘密密钥); 检查成就(); ServiceLocator.GetService().OpenUnlockPanel(m_秘密描述, m_秘密图标); if (list != null && list.Count > 0) { foreach (SecretUnlockCondition item in list) { ServiceLocator.GetService().OpenUnlockPanel(item.m_unlockDescription, item.m_unlockImage); } } PlacementUI val2 = Object.FindObjectOfType(); if ((Object)(object)val2 != (Object)null) { val2.RedrawUI(m_秘密密钥); } } public override void OnEnterNewScene() { ((GameStateListener)this).OnEnterNewScene(); 循环音源 = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)循环音源)) { 循环音源.volume = 0f; } m_旋转震动 = ((Component)this).GetComponentInChildren(); m_秘密物体 = ((Component)this).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)m_秘密物体)) { m_秘密物体.isKinematic = true; } if (!string.IsNullOrWhiteSpace(m_秘密密钥) && ServiceLocator.GetService().HasUnlockedSecret(m_秘密密钥)) { if (Object.op_Implicit((Object)(object)m_秘密物体)) { ((Component)m_秘密物体).gameObject.SetActive(false); } ((Behaviour)this).enabled = false; UnityEvent obj = 隐藏事件; if (obj != null) { obj.Invoke(); } if ((Object)(object)粒子效果 != (Object)null) { 粒子效果.Stop(); } } PlayerCamerasManager service = ServiceLocator.GetService(); MainCam val = ((service != null) ? service.GetMainCam((Player)0) : null); m_主相机变换 = (((Object)(object)val != (Object)null) ? ((Component)val).transform : null); } public override void OnEnterPlacementState() { if ((Object)(object)粒子效果 != (Object)null && 粒子效果.isPlaying) { 粒子效果.Stop(); } } public override void OnEnterBattleState() { if ((Object)(object)粒子效果 != (Object)null && 粒子效果.isPlaying) { 粒子效果.Stop(); } } public static void 检查成就() { AchievementService service = ServiceLocator.GetService(); ISaveLoaderService secretService = ServiceLocator.GetService(); if (HasUnlockedFaction(874593522)) { service.UnlockAchievement("UNLOCKED_ALL_SECRET"); } if (HasUnlockedFaction(673578412)) { service.UnlockAchievement("UNLOCKED_ALL_LEGACY"); } bool HasUnlockedFaction(int factionId) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) UnitBlueprint[] units = ContentDatabase.Instance().GetFaction(new DatabaseID(-1, factionId)).Units; for (int i = 0; i < units.Length; i++) { string unlockKey = units[i].Entity.UnlockKey; if (!string.IsNullOrEmpty(unlockKey) && !secretService.HasUnlockedSecret(unlockKey)) { return false; } } return true; } } public void 进入新场景() { ((GameStateListener)this).OnEnterNewScene(); } private void OnDrawGizmosSelected() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_秘密物体 != (Object)null && (Object)(object)m_主相机变换 != (Object)null) { Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(m_秘密物体.worldCenterOfMass, m_解锁距离); } } } } namespace rwdseerfd.unity脚本存储文件夹.黑洞吸引 { public class 无血条qwqawqw : MonoBehaviour { private Unit unit; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponent(); unit.SetHealthBarActive(false); } } public class 场景音乐可替换恢复单例 { public class 数据组 { public float 值1 = 1f; public float 值2 = 2f; } private static 场景音乐可替换恢复单例 _场景音乐可替换恢复单例实例; private MusicHandler _音乐管理器; private string _原始音乐类别; private MapAsset _当前地图引用; public 数据组 数据组1 = new 数据组(); public static 场景音乐可替换恢复单例 场景音乐可替换恢复单例实例 { get { if (_场景音乐可替换恢复单例实例 == null) { _场景音乐可替换恢复单例实例 = new 场景音乐可替换恢复单例(); } return _场景音乐可替换恢复单例实例; } } private 场景音乐可替换恢复单例() { SceneManager.sceneLoaded += OnSceneLoaded; SceneManager.sceneUnloaded += OnSceneUnloaded; _音乐管理器 = ServiceLocator.GetService(); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { try { _当前地图引用 = TABSSceneManager.CurrentLoadedMap; if ((Object)(object)_当前地图引用 != (Object)null) { _原始音乐类别 = _当前地图引用.SongCategoryName; Debug.Log((object)("场景加载: " + ((Scene)(ref scene)).name + ", 地图: " + _当前地图引用.MapName + ", 原始音乐类别: " + _原始音乐类别)); } else { Debug.LogWarning((object)("场景加载: " + ((Scene)(ref scene)).name + " 但 CurrentLoadedMap 为空")); } } catch (Exception ex) { Debug.LogError((object)("OnSceneLoaded 异常: " + ex.Message)); } } private void OnSceneUnloaded(Scene unloadedScene) { try { if ((Object)(object)_当前地图引用 != (Object)null && !string.IsNullOrEmpty(_原始音乐类别)) { _当前地图引用.SongCategoryName = _原始音乐类别; Debug.Log((object)("场景卸载: " + ((Scene)(ref unloadedScene)).name + ", 音乐已恢复为: " + _原始音乐类别)); } else { Debug.LogWarning((object)("场景卸载: " + ((Scene)(ref unloadedScene)).name + ", 无法恢复音乐")); } _当前地图引用 = null; _原始音乐类别 = null; } catch (Exception ex) { Debug.LogError((object)("OnSceneUnloaded 异常: " + ex.Message)); } } private void 引用赋值测试() { float 值 = 数据组1.值1; 数据组1.值1 = 2f; } public void 替换场景中的音乐类别(string 音乐类别) { } } public class 开始时事件 : MonoBehaviour { public UnityEvent ddddd; private void Start() { UnityEvent obj = ddddd; if (obj != null) { obj.Invoke(); } } } public class 音乐存储 : MonoBehaviour { public SongInstance[] ddddd; } public class 摄像机靠近黑洞越来越黑 : MonoBehaviour { [Header("摄像机设置")] public Camera 主摄像机; [Header("距离设置")] public float 最大影响距离 = 10f; public float 最小距离 = 2f; [Header("颜色设置")] public Color 变黑颜色 = Color.black; private GameObject 黑洞物体; private Texture2D 黑色纹理; private GUIStyle 黑色样式; private void Start() { //IL_000e: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown 最大影响距离 *= ((Component)this).transform.lossyScale.x; 最小距离 *= ((Component)this).transform.lossyScale.x; if ((Object)(object)主摄像机 == (Object)null) { 主摄像机 = Camera.main; } 黑洞物体 = ((Component)this).gameObject; 黑色纹理 = new Texture2D(1, 1); 黑色纹理.SetPixel(0, 0, 变黑颜色); 黑色纹理.Apply(); 黑色样式 = new GUIStyle(); 黑色样式.normal.background = 黑色纹理; } private void Update() { } private void OnGUI() { //IL_0032: 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) //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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)主摄像机 == (Object)null) && !((Object)(object)黑洞物体 == (Object)null)) { float distance = Vector3.Distance(((Component)主摄像机).transform.position, 黑洞物体.transform.position); float num = 计算透明度(distance); if (num > 0f) { Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, num); GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), (Texture)(object)黑色纹理); GUI.color = color; } } } private float 计算透明度(float distance) { if (distance >= 最大影响距离) { return 0f; } if (distance <= 最小距离) { return 1f; } float num = (最大影响距离 - distance) / (最大影响距离 - 最小距离); return Mathf.Clamp01(num); } private void OnDestroy() { if ((Object)(object)黑色纹理 != (Object)null) { Object.Destroy((Object)(object)黑色纹理); } } } public class 摄像机靠近黑洞时间缩放 : MonoBehaviour { [Header("摄像机设置")] public Camera 主摄像机; [Header("距离设置")] public float 最大影响距离 = 10f; public float 最小距离 = 2f; [Header("时间缩放设置")] public float 最慢时间缩放 = 0.1f; public float 最快时间缩放 = 1f; public AnimationCurve 时间曲线 = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); [Header("平滑设置")] public float 平滑速度 = 5f; private float 当前目标时间缩放 = 1f; private void Start() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)主摄像机 == (Object)null) { 主摄像机 = Camera.main; } 最大影响距离 *= ((Component)this).transform.lossyScale.x; 最小距离 *= ((Component)this).transform.lossyScale.x; } private void Update() { //IL_0021: 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) if (!((Object)(object)主摄像机 == (Object)null)) { float num = Vector3.Distance(((Component)主摄像机).transform.position, ((Component)this).transform.position); if (!(num > 最大影响距离)) { float num2 = 计算时间因子(num); float num3 = 时间曲线.Evaluate(num2); 当前目标时间缩放 = Mathf.Lerp(最慢时间缩放, 最快时间缩放, num3); Time.timeScale = Mathf.Lerp(Time.timeScale, 当前目标时间缩放, Time.unscaledDeltaTime * 平滑速度); Time.timeScale = Mathf.Clamp(Time.timeScale, 最慢时间缩放, 最快时间缩放); } } } private float 计算时间因子(float 当前距离) { if (当前距离 <= 最小距离) { return 0f; } if (当前距离 >= 最大影响距离) { return 1f; } float num = (当前距离 - 最小距离) / (最大影响距离 - 最小距离); return 1f - num; } private void OnDestroy() { Time.timeScale = 1f; } private void OnDrawGizmosSelected() { //IL_0010: 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_0043: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled) { Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, 最小距离); Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, 最大影响距离); } } } public class 音乐替换工具单例 { private static 音乐替换工具单例 _实例; private static readonly object _锁对象 = new object(); private MusicHandler _音乐管理器; private GameStateManager _游戏模式管理器; private string _原始音乐类别; private MapAsset _当前地图引用; private bool _已注册事件 = false; public static 音乐替换工具单例 实例 { get { if (_实例 == null) { lock (_锁对象) { if (_实例 == null) { _实例 = new 音乐替换工具单例(); } } } return _实例; } } private 音乐替换工具单例() { 注册场景事件(); } private void 注册场景事件() { if (!_已注册事件) { SceneManager.sceneLoaded += OnSceneLoaded; SceneManager.sceneUnloaded += OnSceneUnloaded; _已注册事件 = true; Debug.Log((object)"音乐替换工具单例: 已注册场景事件"); } } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { try { _当前地图引用 = TABSSceneManager.CurrentLoadedMap; if ((Object)(object)_当前地图引用 != (Object)null) { _原始音乐类别 = _当前地图引用.SongCategoryName; Debug.Log((object)("场景加载: " + ((Scene)(ref scene)).name + ", 地图: " + _当前地图引用.MapName + ", 原始音乐: " + _原始音乐类别)); } } catch (Exception ex) { Debug.LogError((object)("OnSceneLoaded 异常: " + ex.Message)); } } private void OnSceneUnloaded(Scene unloadedScene) { try { if ((Object)(object)_当前地图引用 != (Object)null && !string.IsNullOrEmpty(_原始音乐类别)) { _当前地图引用.SongCategoryName = _原始音乐类别; Debug.Log((object)("场景卸载: " + ((Scene)(ref unloadedScene)).name + ", 音乐已恢复: " + _原始音乐类别)); } _当前地图引用 = null; _原始音乐类别 = null; } catch (Exception ex) { Debug.LogError((object)("OnSceneUnloaded 异常: " + ex.Message)); } } private bool 获取音乐管理器() { if ((Object)(object)_音乐管理器 == (Object)null) { _音乐管理器 = ServiceLocator.GetService(); if ((Object)(object)_音乐管理器 == (Object)null) { Debug.LogWarning((object)"音乐替换工具单例: 未找到 MusicHandler"); return false; } } return true; } private bool 获取游戏模式管理器() { if (_游戏模式管理器 == null) { _游戏模式管理器 = ServiceLocator.GetService(); } return _游戏模式管理器 != null; } private bool 验证地图工具(MapAsset 地图工具) { if ((Object)(object)地图工具 == (Object)null) { 地图工具 = TABSSceneManager.CurrentLoadedMap; if ((Object)(object)地图工具 == (Object)null) { Debug.LogError((object)"音乐替换工具单例: 地图工具为空"); return false; } } return true; } private void 自动播放音乐(MapAsset 地图工具) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 if (获取游戏模式管理器()) { if ((int)_游戏模式管理器.GameState == 1) { _音乐管理器.PlaySongBattle(地图工具); } else if ((int)_游戏模式管理器.GameState == 0) { _音乐管理器.PlaySongPlacement(地图工具); } } } private bool 替换音乐(MapAsset 地图工具, string 新音乐类别, bool 强制播放战斗 = false, bool 强制播放部署 = false) { if (!验证地图工具(地图工具)) { return false; } if (!获取音乐管理器()) { return false; } _当前地图引用 = 地图工具; if (string.IsNullOrEmpty(_原始音乐类别)) { _原始音乐类别 = 地图工具.SongCategoryName; } string songCategoryName = 地图工具.SongCategoryName; 地图工具.SongCategoryName = 新音乐类别; if (强制播放战斗) { _音乐管理器.PlaySongBattle(地图工具); } else if (强制播放部署) { _音乐管理器.PlaySongPlacement(地图工具); } else { 自动播放音乐(地图工具); } Debug.Log((object)("音乐已替换: " + songCategoryName + " -> " + 新音乐类别)); return true; } public bool 替换战斗音乐(MapAsset 地图工具, string 自定义战斗音乐类别) { return 替换音乐(地图工具, 自定义战斗音乐类别); } public bool 替换部署音乐(MapAsset 地图工具, string 自定义部署音乐类别) { return 替换音乐(地图工具, 自定义部署音乐类别); } public void 替换全部音乐(MapAsset 地图工具, string 自定义战斗音乐类别, string 自定义部署音乐类别) { Debug.LogWarning((object)"注意:战斗和部署音乐共用同一个 SongCategoryName,同时替换只会保留最后一个设置"); 替换战斗音乐(地图工具, 自定义战斗音乐类别); 替换部署音乐(地图工具, 自定义部署音乐类别); } private bool 恢复音乐(MapAsset 地图工具, bool 播放战斗) { if (!验证地图工具(地图工具)) { return false; } if (!获取音乐管理器()) { return false; } if (string.IsNullOrEmpty(_原始音乐类别)) { Debug.LogWarning((object)"没有保存的原始音乐类别"); return false; } 地图工具.SongCategoryName = _原始音乐类别; if (播放战斗) { _音乐管理器.PlaySongBattle(地图工具); } else { _音乐管理器.PlaySongPlacement(地图工具); } Debug.Log((object)("已恢复音乐: " + _原始音乐类别)); return true; } public bool 恢复战斗音乐(MapAsset 地图工具) { return 恢复音乐(地图工具, 播放战斗: true); } public bool 恢复部署音乐(MapAsset 地图工具) { return 恢复音乐(地图工具, 播放战斗: false); } public void 恢复所有音乐(MapAsset 地图工具) { 恢复战斗音乐(地图工具); } public bool 播放指定音乐(string 音乐类别名称) { if (!获取音乐管理器()) { return false; } _音乐管理器.PlaySong(音乐类别名称); Debug.Log((object)("播放音乐: " + 音乐类别名称)); return true; } public string 获取当前播放音乐() { if (!获取音乐管理器()) { return null; } object obj = typeof(MusicHandler).GetField("m_currentSong", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(_音乐管理器); if (obj != null) { string text = obj.GetType().GetField("songRef")?.GetValue(obj)?.ToString(); if (!string.IsNullOrEmpty(text)) { Debug.Log((object)("当前播放音乐: " + text)); return text; } } Debug.LogWarning((object)"无法获取当前播放的音乐"); return null; } public void 重置保存的原始音乐() { _原始音乐类别 = null; } public void 清理事件() { if (_已注册事件) { SceneManager.sceneLoaded -= OnSceneLoaded; SceneManager.sceneUnloaded -= OnSceneUnloaded; _已注册事件 = false; Debug.Log((object)"已清理场景事件"); } } public void 设置当前地图(MapAsset 地图工具) { _当前地图引用 = 地图工具; if ((Object)(object)地图工具 != (Object)null) { _原始音乐类别 = 地图工具.SongCategoryName; Debug.Log((object)("手动设置当前地图: " + 地图工具.MapName)); } } } public class 音乐替换播放器 : MonoBehaviour { [Header("当前地图引用")] public MapAsset 地图工具; [Header("自定义音乐类别名称")] public string 自定义战斗音乐类别 = "Custom/Battle"; public string 自定义部署音乐类别 = "Custom/Placement"; [Header("是否启用替换")] public bool 启用战斗音乐替换 = true; public bool 启用部署音乐替换 = true; [Header("自动替换设置")] public bool 启动时自动替换 = false; private void Start() { if (启动时自动替换) { 自动替换音乐(); } } [ContextMenu("自动替换音乐")] public void 自动替换音乐() { if (启用战斗音乐替换) { 替换战斗音乐(); } if (启用部署音乐替换) { 替换部署音乐(); } } [ContextMenu("替换当前地图的战斗音乐")] public void 替换战斗音乐() { if (验证地图工具()) { 音乐替换工具单例.实例.替换战斗音乐(地图工具, 自定义战斗音乐类别); } } [ContextMenu("替换当前地图的部署音乐")] public void 替换部署音乐() { if (验证地图工具()) { 音乐替换工具单例.实例.替换部署音乐(地图工具, 自定义部署音乐类别); } } [ContextMenu("同时替换战斗和部署音乐")] public void 替换全部音乐() { 音乐替换工具单例.实例.替换全部音乐(地图工具, 自定义战斗音乐类别, 自定义部署音乐类别); } [ContextMenu("恢复原始战斗音乐")] public void 恢复战斗音乐() { if (验证地图工具()) { 音乐替换工具单例.实例.恢复战斗音乐(地图工具); } } [ContextMenu("恢复原始部署音乐")] public void 恢复部署音乐() { if (验证地图工具()) { 音乐替换工具单例.实例.恢复部署音乐(地图工具); } } [ContextMenu("恢复原始音乐")] public void 恢复原始音乐() { 音乐替换工具单例.实例.恢复所有音乐(地图工具); } [ContextMenu("播放指定战斗音乐")] public void 播放指定战斗音乐(string 音乐类别名称) { 音乐替换工具单例.实例.播放指定音乐(音乐类别名称); } [ContextMenu("播放指定部署音乐")] public void 播放指定部署音乐(string 音乐类别名称) { 音乐替换工具单例.实例.播放指定音乐(音乐类别名称); } public void 设置战斗音乐类别(string 音乐类别) { 自定义战斗音乐类别 = 音乐类别; } public void 设置部署音乐类别(string 音乐类别) { 自定义部署音乐类别 = 音乐类别; } [ContextMenu("显示当前地图信息")] public void 显示当前地图信息() { if (验证地图工具()) { Debug.Log((object)("=== 当前地图信息 ===\n地图名称: " + 地图工具.MapName + "\n音乐类别: " + 地图工具.SongCategoryName)); } } [ContextMenu("获取当前播放音乐")] public void 获取当前播放音乐() { 音乐替换工具单例.实例.获取当前播放音乐(); } [ContextMenu("重置保存的原始音乐")] public void 重置保存的原始音乐() { 音乐替换工具单例.实例.重置保存的原始音乐(); } private bool 验证地图工具() { if ((Object)(object)地图工具 == (Object)null) { 地图工具 = TABSSceneManager.CurrentLoadedMap; if ((Object)(object)地图工具 == (Object)null) { Debug.LogError((object)"音乐替换播放器: 地图工具为空"); return false; } } return true; } [ContextMenu("自动获取当前地图")] public void 自动获取当前地图() { 地图工具 = TABSSceneManager.CurrentLoadedMap; if ((Object)(object)地图工具 != (Object)null) { 显示当前地图信息(); } else { Debug.LogWarning((object)"当前没有加载的地图"); } } } public class 黑洞吸引类 : MonoBehaviour { [Header("基础设置")] public bool 启动 = false; public 最近单位获取高度定义 单位获取工具; public float 杀死单位距离 = 5f; [Header("吸引力设置")] public float 最大引力 = 50f; public float 最小引力 = 5f; public float 切线力 = 900f; public float 最大影响距离 = 30f; public float 引力衰减曲线 = 2f; [Header("缩放设置")] public bool 启用缩放效果 = true; public AnimationCurve 缩放曲线 = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); public float 缩放平滑时间 = 0.1f; public float 缩放最大影响距离 = 10f; private List _rigidbodies = new List(); private List 全部单位 = new List(); private Dictionary> 单位刚体原始缩放 = new Dictionary>(); private Dictionary> 单位刚体缩放速度 = new Dictionary>(); private float 上次更新时间 = 0f; private float 上次检测时间 = 0f; private float 检测间隔 = 1f; private void Start() { //IL_000e: 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_0048: Unknown result type (might be due to invalid IL or missing references) 杀死单位距离 *= ((Component)this).transform.lossyScale.x; 最大影响距离 *= ((Component)this).transform.lossyScale.x; 缩放最大影响距离 *= ((Component)this).transform.lossyScale.x; } private void Update() { if (启动) { if (Time.time - 上次检测时间 >= 检测间隔) { 检测一次(); 上次检测时间 = Time.time; } 对所有单位施加引力(); 距离判断杀死单位(); 更新所有单位缩放(); } } public void 设置启动(bool j = false) { 启动 = j; if (!启动) { 恢复所有单位缩放(); } } private void 对所有单位施加引力() { //IL_000e: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) 清理无效刚体(); Vector3 position = ((Component)this).transform.position; foreach (Rigidbody rigidbody in _rigidbodies) { if ((Object)(object)rigidbody == (Object)null) { continue; } Vector3 val = position - rigidbody.position; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude > 最大影响距离)) { float num = Mathf.Clamp01(1f - magnitude / 最大影响距离); float num2 = Mathf.Lerp(最小引力, 最大引力, Mathf.Pow(num, 引力衰减曲线)); Vector3 val2 = ((Vector3)(ref val)).normalized * num2; if (magnitude < 2f) { val2 *= 2f; } rigidbody.AddForce(val2 * Time.deltaTime, (ForceMode)5); Vector3 val3 = Vector3.Cross(val, Vector3.up); Vector3 normalized = ((Vector3)(ref val3)).normalized; rigidbody.AddForce(normalized * 切线力 * Time.deltaTime, (ForceMode)5); } } } private void 距离判断杀死单位() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (全部单位.Count == 0) { return; } for (int num = 全部单位.Count - 1; num >= 0; num--) { if ((Object)(object)全部单位[num] == (Object)null) { 移除单位缩放记录(全部单位[num]); 全部单位.RemoveAt(num); } else { float num2 = Vector3.Distance(((Component)this).transform.position, 全部单位[num].data.mainRig.position); if (num2 <= 杀死单位距离) { 强制死亡(全部单位[num]); 移除单位缩放记录(全部单位[num]); 全部单位.RemoveAt(num); } } } } private void 更新所有单位缩放() { //IL_0057: 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) if (!启用缩放效果) { return; } foreach (Unit item in 全部单位) { if ((Object)(object)item == (Object)null || (Object)(object)((Component)item).gameObject == (Object)null) { continue; } float num = Vector3.Distance(((Component)this).transform.position, item.data.mainRig.position); if (num <= 缩放最大影响距离) { float num2 = Mathf.Clamp01(num / 缩放最大影响距离); float 目标缩放比例 = 缩放曲线.Evaluate(1f - num2); if (num <= 杀死单位距离) { 目标缩放比例 = 0f; } 设置单位缩放(item, 目标缩放比例); } else if (单位刚体原始缩放.ContainsKey(item)) { 恢复单位缩放(item); } } } private void 设置单位缩放(Unit unit, float 目标缩放比例) { //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_00b4: 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_00c7: 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_010f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)unit == (Object)null || (Object)(object)((Component)unit).gameObject == (Object)null) { return; } if (!单位刚体原始缩放.ContainsKey(unit)) { 记录单位原始缩放(unit); } RigidbodyHolder allRigs = unit.data.allRigs; Rigidbody[] array = ((allRigs != null) ? allRigs.AllRigs : null); if (array == null || array.Length == 0) { return; } if (缩放平滑时间 > 0f) { foreach (Rigidbody val in array) { if (!((Object)(object)val == (Object)null)) { Vector3 val2 = 单位刚体原始缩放[unit][val]; float num = ((Component)val).transform.localScale.x / val2.x; float orCreate缩放速度 = GetOrCreate缩放速度(unit, val); float num2 = Mathf.SmoothDamp(num, 目标缩放比例, ref orCreate缩放速度, 缩放平滑时间); 单位刚体缩放速度[unit][val] = orCreate缩放速度; ((Component)val).transform.localScale = val2 * num2; } } return; } foreach (Rigidbody val3 in array) { if (!((Object)(object)val3 == (Object)null)) { Vector3 val4 = 单位刚体原始缩放[unit][val3]; ((Component)val3).transform.localScale = val4 * 目标缩放比例; } } } private void 记录单位原始缩放(Unit unit) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)unit == (Object)null) { return; } RigidbodyHolder allRigs = unit.data.allRigs; if (((allRigs != null) ? allRigs.AllRigs : null) == null) { return; } Dictionary dictionary = new Dictionary(); Dictionary dictionary2 = new Dictionary(); Rigidbody[] allRigs2 = unit.data.allRigs.AllRigs; foreach (Rigidbody val in allRigs2) { if ((Object)(object)val != (Object)null) { dictionary[val] = ((Component)val).transform.localScale; dictionary2[val] = 0f; } } 单位刚体原始缩放[unit] = dictionary; 单位刚体缩放速度[unit] = dictionary2; } private float GetOrCreate缩放速度(Unit unit, Rigidbody rb) { if (!单位刚体缩放速度.ContainsKey(unit)) { 单位刚体缩放速度[unit] = new Dictionary(); } if (!单位刚体缩放速度[unit].ContainsKey(rb)) { 单位刚体缩放速度[unit][rb] = 0f; } return 单位刚体缩放速度[unit][rb]; } private void 恢复单位缩放(Unit unit) { //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_015f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)unit == (Object)null || (Object)(object)((Component)unit).gameObject == (Object)null || !单位刚体原始缩放.ContainsKey(unit)) { return; } RigidbodyHolder allRigs = unit.data.allRigs; Rigidbody[] array = ((allRigs != null) ? allRigs.AllRigs : null); if (array == null || array.Length == 0) { return; } if (缩放平滑时间 > 0f) { foreach (Rigidbody val in array) { if (!((Object)(object)val == (Object)null) && 单位刚体原始缩放[unit].ContainsKey(val)) { Vector3 val2 = 单位刚体原始缩放[unit][val]; float num = ((Component)val).transform.localScale.x / val2.x; float orCreate缩放速度 = GetOrCreate缩放速度(unit, val); float num2 = Mathf.SmoothDamp(num, 1f, ref orCreate缩放速度, 缩放平滑时间); 单位刚体缩放速度[unit][val] = orCreate缩放速度; ((Component)val).transform.localScale = val2 * num2; if (Mathf.Abs(num2 - 1f) < 0.01f) { ((Component)val).transform.localScale = val2; } } } return; } foreach (Rigidbody val3 in array) { if (!((Object)(object)val3 == (Object)null) && 单位刚体原始缩放[unit].ContainsKey(val3)) { ((Component)val3).transform.localScale = 单位刚体原始缩放[unit][val3]; } } } private void 恢复所有单位缩放() { foreach (Unit item in 全部单位) { if ((Object)(object)item != (Object)null && (Object)(object)((Component)item).gameObject != (Object)null) { 恢复单位缩放(item); } } 单位刚体原始缩放.Clear(); 单位刚体缩放速度.Clear(); } private void 移除单位缩放记录(Unit unit) { if (单位刚体原始缩放.ContainsKey(unit)) { 单位刚体原始缩放.Remove(unit); } if (单位刚体缩放速度.ContainsKey(unit)) { 单位刚体缩放速度.Remove(unit); } } private void 检测一次() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)单位获取工具 == (Object)null) { return; } List targets = 单位获取工具.GetTargets(((Component)this).transform.position, 最大影响距离); if (targets == null || targets.Count == 0) { return; } foreach (Unit item in targets) { if (全部单位.Contains(item)) { continue; } if (!单位刚体原始缩放.ContainsKey(item)) { 记录单位原始缩放(item); } if ((Object)(object)item.data.allRigs != (Object)null && item.data.allRigs.AllRigs != null) { List list = item.data.allRigs.AllRigs.ToList(); foreach (Rigidbody item2 in list) { if ((Object)(object)item2 != (Object)null && !_rigidbodies.Contains(item2)) { _rigidbodies.Add(item2); } } } 全部单位.Add(item); } } private void 强制死亡(Unit 单位) { if ((Object)(object)单位 == (Object)null) { return; } GameModeService service = ServiceLocator.GetService(); if (service.CurrentGameMode == null) { Debug.LogError((object)"Could not find CurrentGameMode!"); } else { service.CurrentGameMode.OnUnitDied(单位); } if ((Object)(object)单位.data.allRigs != (Object)null && 单位.data.allRigs.AllRigs != null) { Rigidbody[] allRigs = 单位.data.allRigs.AllRigs; foreach (Rigidbody item in allRigs) { if (_rigidbodies.Contains(item)) { _rigidbodies.Remove(item); } } } Object.Destroy((Object)(object)((Component)单位).gameObject); } private void 清理无效刚体() { for (int num = _rigidbodies.Count - 1; num >= 0; num--) { if ((Object)(object)_rigidbodies[num] == (Object)null) { _rigidbodies.RemoveAt(num); } } for (int num2 = 全部单位.Count - 1; num2 >= 0; num2--) { if ((Object)(object)全部单位[num2] == (Object)null) { 移除单位缩放记录(全部单位[num2]); 全部单位.RemoveAt(num2); } } } public void 强制检测() { 检测一次(); } public void 清除刚体列表() { _rigidbodies.Clear(); 恢复所有单位缩放(); 全部单位.Clear(); } public void 停止并清除() { 启动 = false; 清除刚体列表(); } public int 获取影响物体数量() { 清理无效刚体(); return _rigidbodies.Count; } public int 获取单位数量() { 清理无效刚体(); return 全部单位.Count; } private void OnDestroy() { 恢复所有单位缩放(); 清除刚体列表(); } private void OnDrawGizmosSelected() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (启动) { Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, 杀死单位距离); Gizmos.color = Color.cyan; Gizmos.DrawWireSphere(((Component)this).transform.position, 最大影响距离); Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, 缩放最大影响距离); Gizmos.color = new Color(0f, 1f, 1f, 0.3f); for (float num = 0.2f; num <= 1f; num += 0.2f) { Gizmos.DrawWireSphere(((Component)this).transform.position, 最大影响距离 * num); } } } } public class 黑洞无敌补丁 : MonoBehaviour { private bool 已触发死亡事件 = false; public UnityEvent 触发事件 = new UnityEvent(); public void 触发死亡事件() { if (!已触发死亡事件) { UnityEvent obj = 触发事件; if (obj != null) { obj.Invoke(); } 已触发死亡事件 = true; } } } public class 黑洞无敌补丁添加器 : MonoBehaviour { public UnityEvent 死亡阻止事件; private 黑洞无敌补丁 m_InvincibleComponent; private void Start() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown Debug.Log((object)"[黑洞无敌补丁添加器] Start 被调用了!"); HealthHandler componentInParent = ((Component)this).GetComponentInParent(); Debug.Log((object)("[添加器] 找到的 HealthHandler: " + (((componentInParent != null) ? ((Object)componentInParent).name : null) ?? "null"))); if ((Object)(object)componentInParent != (Object)null) { m_InvincibleComponent = ((Component)componentInParent).GetComponent<黑洞无敌补丁>(); if ((Object)(object)m_InvincibleComponent == (Object)null) { m_InvincibleComponent = ((Component)((Component)componentInParent).transform).gameObject.AddComponent<黑洞无敌补丁>(); } if ((Object)(object)m_InvincibleComponent != (Object)null) { Debug.Log((object)"开始订阅事件"); m_InvincibleComponent.触发事件.AddListener(new UnityAction(当黑洞无敌补丁触发时)); Debug.Log((object)"完成订阅!"); } } } private void 当黑洞无敌补丁触发时() { Debug.Log((object)"黑洞无敌补丁已触发!"); UnityEvent obj = 死亡阻止事件; if (obj != null) { obj.Invoke(); } } private void OnDestroy() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown if ((Object)(object)m_InvincibleComponent != (Object)null) { m_InvincibleComponent.触发事件.RemoveListener(new UnityAction(当黑洞无敌补丁触发时)); Object.Destroy((Object)(object)m_InvincibleComponent); } } } } namespace rwdseerfd.unity脚本存储文件夹.黑洞吸引.天空盒更换类 { internal class 开始时替换天空盒 : MonoBehaviour { [Header("天空盒材质")] public Material 目标天空盒材质; [Header("相机设置")] public Camera 主摄像机; [Header("后处理修复选项")] public bool 禁用雾效 = true; public bool 调整渲染顺序 = true; private void Start() { 主摄像机 = Camera.main; if ((Object)(object)主摄像机 == (Object)null) { Debug.LogError((object)"未找到主摄像机!"); return; } if ((Object)(object)目标天空盒材质 != (Object)null) { RenderSettings.skybox = 目标天空盒材质; Debug.Log((object)"天空盒已替换"); } 修复后处理遮挡(); } private void 修复后处理遮挡() { PostProcessVolume val = Object.FindObjectOfType(); if ((Object)(object)val == (Object)null || (Object)(object)val.profile == (Object)null) { Debug.Log((object)"未找到后处理体积"); return; } Debug.Log((object)"开始修复后处理遮挡问题..."); if (禁用雾效 && !禁用Fog特效(val)) { Debug.Log((object)"无法禁用 Fog 特效,尝试其他方法"); } if (调整渲染顺序) { 调整相机渲染顺序(); } } private bool 禁用Fog特效(PostProcessVolume 体积) { try { PostProcessProfile profile = 体积.profile; List settings = profile.settings; bool result = false; foreach (PostProcessEffectSettings item in settings) { if ((Object)(object)item != (Object)null && ((object)item).GetType().Name == "Fog") { result = true; ((ParameterOverride)(object)item.enabled).value = false; Debug.Log((object)"已禁用后处理中的 Fog 特效"); FieldInfo field = ((object)item).GetType().GetField("excludeSkybox"); if (field != null) { field.SetValue(item, true); Debug.Log((object)"已设置 Fog.excludeSkybox = true"); } break; } } return result; } catch (Exception ex) { Debug.Log((object)("禁用 Fog 失败: " + ex.Message)); return false; } } private void 调整相机渲染顺序() { 主摄像机.clearFlags = (CameraClearFlags)1; if (主摄像机.depth < 0f) { 主摄像机.depth = 0f; Debug.Log((object)"已调整相机深度"); } } private void Update() { } } } namespace rwdseerfd.unity脚本存储文件夹.骨骼缝合新 { public class AvatarBoneDebugger : MonoBehaviour { private void Start() { PrintBoneStructure(); FindBoneRoot(); } [ContextMenu("打印骨骼结构")] public void PrintBoneStructure() { Debug.Log((object)("=== 打印 " + ((Object)((Component)this).gameObject).name + " 的骨骼结构 ===")); PrintTransformHierarchy(((Component)this).transform, 0); } private void PrintTransformHierarchy(Transform t, int depth) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown string text = new string(' ', depth * 2); Debug.Log((object)(text + "- " + ((Object)t).name)); foreach (Transform item in t) { Transform t2 = item; PrintTransformHierarchy(t2, depth + 1); } } [ContextMenu("查找骨骼根节点")] public void FindBoneRoot() { string[] array = new string[5] { "Armature", "Rigidbodies", "Root", "Bones", "Hip" }; string[] array2 = array; foreach (string text in array2) { Transform val = ((Component)this).transform.Find(text); if ((Object)(object)val != (Object)null) { Debug.Log((object)("找到骨骼根节点: " + text + ", 路径: " + GetPath(val))); } else { Debug.Log((object)("未找到: " + text)); } } FindBonesRecursive(((Component)this).transform); } private void FindBonesRecursive(Transform t) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown string[] array = new string[8] { "Hip", "Spine", "Leg", "Arm", "Head", "Neck", "Foot", "Hand" }; string[] array2 = array; foreach (string value in array2) { if (((Object)t).name.Contains(value)) { Debug.Log((object)("发现可能的骨骼: " + ((Object)t).name + ", 路径: " + GetPath(t))); break; } } foreach (Transform item in t) { Transform t2 = item; FindBonesRecursive(t2); } } private string GetPath(Transform t) { if ((Object)(object)t.parent == (Object)null) { return ((Object)t).name; } return GetPath(t.parent) + "/" + ((Object)t).name; } } } namespace rwdseerfd.unity脚本存储文件夹.雷电龙类 { internal class 刚体抽搐效果fff : MonoBehaviour { private float 抽搐计时器 = 0f; private bool 启动; private Unit 此单位; private Rigidbody[] 全部刚体; [Header("抽搐参数")] [SerializeField] private float 最小力度 = 5f; [SerializeField] private float 最大力度 = 20f; [SerializeField] private float 抽搐频率 = 0.05f; private float 频率计时器 = 0f; [Header("力的模式")] [SerializeField] private bool 随机方向 = true; [SerializeField] private bool 向上抽搐 = false; [SerializeField] private float 向上力度倍数 = 1.5f; private void Start() { 此单位 = ((Component)((Component)this).transform.root).GetComponent(); Unit obj = 此单位; object obj2; if (obj == null) { obj2 = null; } else { DataHandler data = obj.data; if (data == null) { obj2 = null; } else { RigidbodyHolder allRigs = data.allRigs; obj2 = ((allRigs != null) ? allRigs.AllRigs : null); } } if (obj2 != null) { 全部刚体 = 此单位.data.allRigs.AllRigs; } else { Debug.LogError((object)"无法获取刚体数组!"); } } private void Update() { if (!启动) { return; } if (抽搐计时器 <= 0f) { 启动 = false; 频率计时器 = 0f; return; } 抽搐计时器 -= Time.deltaTime; 频率计时器 -= Time.deltaTime; if (频率计时器 <= 0f && 启动) { 施加抽搐力(); 频率计时器 = 抽搐频率; } } private void 施加抽搐力() { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) if (全部刚体 == null || 全部刚体.Length == 0) { return; } Rigidbody[] array = 全部刚体; Vector3 val2 = default(Vector3); foreach (Rigidbody val in array) { if (!((Object)(object)val == (Object)null)) { if (向上抽搐) { float num = Random.Range(-1f, 1f); float num2 = Random.Range(-1f, 1f); float num3 = Random.Range(最小力度, 最大力度) * 向上力度倍数; ((Vector3)(ref val2))..ctor(num, num3, num2); } else if (随机方向) { ((Vector3)(ref val2))..ctor(Random.Range(0f - 最大力度, 最大力度), Random.Range(0f - 最大力度, 最大力度), Random.Range(0f - 最大力度, 最大力度)); val2 = ((Vector3)(ref val2)).normalized * Random.Range(最小力度, 最大力度); } else { ((Vector3)(ref val2))..ctor(Random.Range(0f - 最大力度, 最大力度), Random.Range(0f - 最小力度, 最小力度), Random.Range(0f - 最大力度, 最大力度)); } val.AddForce(val2, (ForceMode)5); } } } private void 添加震动效果() { } public void 启动抽搐(float time) { 抽搐计时器 = time; 启动 = true; 频率计时器 = 0f; 施加抽搐力(); } public void 启动抽搐(float time, float minForce, float maxForce) { 最小力度 = minForce; 最大力度 = maxForce; 启动抽搐(time); } public void 停止抽搐() { 启动 = false; 抽搐计时器 = 0f; 频率计时器 = 0f; } public bool 是否在抽搐() { return 启动; } } public class 单位加血 : MonoBehaviour { public Unit 此单位; public DataHandler 单位数据; private void Start() { if ((Object)(object)此单位 == (Object)null) { 此单位 = ((Component)((Component)this).transform.root).GetComponent(); } if ((Object)(object)此单位 != (Object)null) { 单位数据 = 此单位.data; } } public void 收到AO(float damage = 900f) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)单位数据 != (Object)null && 单位数据.health < 单位数据.maxHealth) { ((Damagable)单位数据.healthHandler).TakeDamage(0f - damage, ((Component)this).transform.position, (Unit)null, (DamageType)0); } } } public class 圆形实例化物体 : MonoBehaviour { public float 最小半径; public float 最大半径; public Transform 指定圆心; public Vector3 获取圆形随机位置() { //IL_0023: 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) //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_0030: Unknown result type (might be due to invalid IL or missing references) return 获取圆形随机位置(((Object)(object)指定圆心 != (Object)null) ? 指定圆心.position : ((Component)this).transform.position); } public Vector3 获取圆形随机位置(Vector3 圆心位置) { //IL_0048: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0067: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range(0f, (float)Math.PI * 2f); float num2 = Mathf.Sqrt(Random.Range(最小半径 * 最小半径, 最大半径 * 最大半径)); float num3 = Mathf.Cos(num) * num2; float num4 = Mathf.Sin(num) * num2; return new Vector3(圆心位置.x + num3, 圆心位置.y, 圆心位置.z + num4); } public Vector3 获取圆形随机地面位置(float 检测高度 = 10f, int 地面层级 = 512) { //IL_0023: 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) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) return 获取圆形随机地面位置(((Object)(object)指定圆心 != (Object)null) ? 指定圆心.position : ((Component)this).transform.position, 检测高度, 地面层级); } public Vector3 获取圆形随机地面位置(Vector3 圆心位置, float 检测高度 = 10f, int 地面层级 = 512) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) Vector3 测试位置 = 获取圆形随机位置(圆心位置); return 获取地面位置(测试位置, 检测高度, 地面层级); } public Vector3 获取地面位置(Vector3 测试位置, float 检测高度 = 10f, int 地面层级 = 512) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(测试位置.x, 测试位置.y + 检测高度, 测试位置.z); float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, 地面层级)) { return ((RaycastHit)(ref val2)).point; } return new Vector3(测试位置.x, 测试位置.y - 检测高度 * 0.5f, 测试位置.z); } public void 实例化物体(GameObject obj, bool 贴合地面 = true, float 检测高度 = 10f) { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_002f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)obj == (Object)null)) { Vector3 val = ((!贴合地面) ? 获取圆形随机位置() : 获取圆形随机地面位置(检测高度)); GameObject val2 = Object.Instantiate(obj, val, Quaternion.identity); TeamHolder.AddTeamHolder(val2, ((Component)this).gameObject); } } private void OnDrawGizmosSelected() { //IL_0034: 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_0039: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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) if (((Behaviour)this).enabled) { Vector3 val = (((Object)(object)指定圆心 != (Object)null) ? 指定圆心.position : ((Component)this).transform.position); Gizmos.color = new Color(1f, 0f, 0f, 0.3f); Gizmos.DrawWireSphere(val, 最小半径); Gizmos.color = new Color(0f, 1f, 0f, 0.5f); Gizmos.DrawWireSphere(val, 最大半径); Gizmos.color = new Color(0f, 1f, 0f, 0.1f); Gizmos.DrawSphere(val, 最大半径); } } } public class 圆形实例化物体使用工具 : MonoBehaviour { [CompilerGenerated] private sealed class <延迟批量实例化>d__23 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 圆形实例化物体使用工具 <>4__this; private int 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <延迟批量实例化>d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0; break; case 1: <>1__state = -1; 5__1++; break; } if (5__1 < <>4__this.实例化数量) { <>4__this.实例化单个物体(); <>2__current = (object)new WaitForSeconds(<>4__this.实例化间隔); <>1__state = 1; return true; } <>4__this.正在批量实例化 = false; UnityEvent 批量实例化完成事件 = <>4__this.批量实例化完成事件; if (批量实例化完成事件 != null) { 批量实例化完成事件.Invoke(); } Debug.Log((object)$"批量实例化完成,共实例化 {<>4__this.实例化数量} 个物体"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("圆形区域配置")] public 圆形实例化物体 圆形区域; [Header("物体配置")] public GameObject[] 可实例化物体列表; public bool 随机选择物体 = true; [Header("实例化配置")] public bool 贴合地面 = true; public float 地面检测高度 = 10f; public int 实例化数量 = 1; public float 实例化间隔 = 0f; [Header("事件回调")] public UnityEvent 物体实例化前事件; public UnityEvent 物体实例化后事件; public UnityEvent 批量实例化完成事件; private Queue 待实例化队列 = new Queue(); private bool 正在批量实例化 = false; private void Start() { if ((Object)(object)圆形区域 == (Object)null) { 圆形区域 = ((Component)this).GetComponent<圆形实例化物体>(); } if ((Object)(object)圆形区域 == (Object)null) { Debug.LogError((object)"圆形实例化物体使用工具: 未找到圆形实例化物体组件!"); } } public void 实例化单个物体() { if (验证组件()) { GameObject val = 获取实例化物体(); if (!((Object)(object)val == (Object)null)) { 物体实例化前事件?.Invoke(val); 圆形区域.实例化物体(val, 贴合地面, 地面检测高度); 物体实例化后事件?.Invoke(val); } } } public void 实例化指定物体(GameObject 物体) { if (验证组件()) { if ((Object)(object)物体 == (Object)null) { Debug.LogWarning((object)"要实例化的物体为空!"); return; } 物体实例化前事件?.Invoke(物体); 圆形区域.实例化物体(物体, 贴合地面, 地面检测高度); 物体实例化后事件?.Invoke(物体); } } public void 批量实例化物体() { if (!验证组件()) { return; } if (实例化间隔 <= 0f) { for (int i = 0; i < 实例化数量; i++) { 实例化单个物体(); } UnityEvent obj = 批量实例化完成事件; if (obj != null) { obj.Invoke(); } } else if (!正在批量实例化) { 正在批量实例化 = true; ((MonoBehaviour)this).StartCoroutine(延迟批量实例化()); } } public void 输出随机地面位置() { //IL_0021: 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_002c: Unknown result type (might be due to invalid IL or missing references) if (验证组件()) { Vector3 val = 圆形区域.获取圆形随机地面位置(地面检测高度); Debug.Log((object)$"随机地面位置: {val}"); } } public void 输出随机位置() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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) if (验证组件()) { Vector3 val = 圆形区域.获取圆形随机位置(); Debug.Log((object)$"随机位置: {val}"); } } public void 切换贴合地面模式() { 贴合地面 = !贴合地面; Debug.Log((object)("贴合地面模式: " + (贴合地面 ? "开启" : "关闭"))); } public void 设置实例化数量(int 数量) { 实例化数量 = Mathf.Max(1, 数量); Debug.Log((object)$"实例化数量设置为: {实例化数量}"); } public void 设置最小半径(float 半径) { if ((Object)(object)圆形区域 != (Object)null) { 圆形区域.最小半径 = Mathf.Max(0f, 半径); Debug.Log((object)$"最小半径设置为: {圆形区域.最小半径}"); } } public void 设置最大半径(float 半径) { if ((Object)(object)圆形区域 != (Object)null) { 圆形区域.最大半径 = Mathf.Max(0f, 半径); Debug.Log((object)$"最大半径设置为: {圆形区域.最大半径}"); } } public void 随机调整半径范围() { if (!((Object)(object)圆形区域 == (Object)null)) { float num = Random.Range(0f, 圆形区域.最大半径); float 最大半径 = Random.Range(num, num + 10f); 圆形区域.最小半径 = num; 圆形区域.最大半径 = 最大半径; Debug.Log((object)$"半径已随机调整 - 最小: {圆形区域.最小半径}, 最大: {圆形区域.最大半径}"); } } [IteratorStateMachine(typeof(<延迟批量实例化>d__23))] private IEnumerator 延迟批量实例化() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <延迟批量实例化>d__23(0) { <>4__this = this }; } private GameObject 获取实例化物体() { if (可实例化物体列表 == null || 可实例化物体列表.Length == 0) { Debug.LogWarning((object)"可实例化物体列表为空!"); return null; } if (随机选择物体) { int num = Random.Range(0, 可实例化物体列表.Length); return 可实例化物体列表[num]; } return 可实例化物体列表[0]; } private bool 验证组件() { if ((Object)(object)圆形区域 == (Object)null) { Debug.LogError((object)"圆形实例化物体组件未设置!"); return false; } return true; } public void 动画事件_实例化物体(string 物体名称) { GameObject val = Resources.Load(物体名称); if ((Object)(object)val != (Object)null) { 实例化指定物体(val); } } public void 动画事件_开始批量实例化() { 批量实例化物体(); } private void OnDrawGizmosSelected() { if (!((Object)(object)圆形区域 != (Object)null) && (Object)(object)圆形区域 == (Object)null && (Object)(object)((Component)this).GetComponent<圆形实例化物体>() != (Object)null) { 圆形区域 = ((Component)this).GetComponent<圆形实例化物体>(); } } } internal class 地面检测实例化物体 : MonoBehaviour { public Vector3 获取地面位置(Vector3 测试位置, float 检测高度 = 10f, int 地面层级 = 512) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(测试位置.x, 测试位置.y + 检测高度, 测试位置.z); float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, 地面层级)) { return ((RaycastHit)(ref val2)).point; } return new Vector3(测试位置.x, 测试位置.y - 检测高度 * 0.5f, 测试位置.z); } public void 实例化物体(GameObject obj) { //IL_0009: 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_001d: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(obj, 获取地面位置(((Component)this).transform.position), Quaternion.identity); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); } } public class 姿势管理器 : MonoBehaviour { public 姿势容器[] 全部身体部位; public bool 启用 = true; public void 设置启动(bool h = true) { 启用 = h; } private void Update() { if (!启用) { return; } 姿势容器[] array = 全部身体部位; foreach (姿势容器 姿势容器2 in array) { if ((Object)(object)姿势容器2 != (Object)null && (Object)(object)姿势容器2.跟随物体 != (Object)null) { 姿势容器2.执行跟随(); } } } } public class 姿势容器 : MonoBehaviour { [Header("跟随目标")] public Transform 跟随物体; public Transform 跟随上一个物体; [Header("跟随参数")] [Range(0f, 70f)] public float 位置跟随速率 = 5f; [Range(0f, 360f)] public float 旋转跟随速率 = 180f; [Range(0f, 5f)] public float 最大跟随距离 = 0.2f; private Vector3 相对于上一个物体的局部位置; private void Start() { //IL_000e: 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) 相对于上一个物体的局部位置 = 跟随上一个物体.InverseTransformPoint(((Component)this).transform.position); } public void 执行跟随() { //IL_0008: 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) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_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_0031: 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_007a: 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_0098: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_006d: 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) Vector3 val = 跟随上一个物体.TransformPoint(相对于上一个物体的局部位置); Vector3 val2 = Vector3.Lerp(((Component)this).transform.position, val, 位置跟随速率 * Time.deltaTime); float num = Vector3.Distance(val2, val); if (num > 最大跟随距离) { Vector3 position = 跟随物体.position; Vector3 val3 = val2 - val; val2 = position + ((Vector3)(ref val3)).normalized * 最大跟随距离; } ((Component)this).transform.position = val2; ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, 跟随物体.rotation, 旋转跟随速率 * Time.deltaTime); } } internal class 实例化抛射物水平 : MonoBehaviour { public Unit Unit; public void 实例化抛射物(GameObject sp) { //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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) //IL_0064: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Unit != (Object)null && Object.op_Implicit((Object)(object)Unit.data.targetData)) { Vector3 position = Unit.data.targetData.mainRig.position; Vector3 val = position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized.y = 0f; if (normalized != Vector3.zero) { ((Vector3)(ref normalized)).Normalize(); } GameObject val2 = Object.Instantiate(sp, ((Component)this).transform.position, Quaternion.LookRotation(normalized)); TeamHolder.AddTeamHolder(val2, ((Component)this).gameObject); } } } internal class 实例化物体普通模式 : MonoBehaviour { public void 实例化物体(GameObject sp) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)sp == (Object)null)) { GameObject val = Object.Instantiate(sp, ((Component)this).transform.position, Quaternion.identity); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); } } } public class RandomYRotation : MonoBehaviour { private void Start() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) float y = Random.Range(0f, 360f); Vector3 eulerAngles = ((Component)this).transform.eulerAngles; eulerAngles.y = y; ((Component)this).transform.eulerAngles = eulerAngles; } } public class 披风脚本sdfsdfe : MonoBehaviour { [Serializable] public class 记录相对位置类 { public Vector3 相对于上一个骨骼的局部位置; public Quaternion 相对于上一个骨骼的局部旋转; public float 与上一个骨骼的距离; public 记录相对位置类(Vector3 局部偏移, Quaternion 局部旋转, float 距离) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) 相对于上一个骨骼的局部位置 = 局部偏移; 相对于上一个骨骼的局部旋转 = 局部旋转; 与上一个骨骼的距离 = 距离; } } public Transform 根部披风; public List 披风骨骼组; [Header("间隔距离设置")] public float 移动速度 = 9f; public float 旋转速度 = 9f; [Header("拉伸限制")] public float 最大拉伸距离 = 0.5f; public bool 启用拉伸限制 = true; [Header("轴向映射")] public Vector3 物体指向目标的轴 = Vector3.up; public Vector3 物体的上方向轴 = Vector3.forward; [Header("世界参考")] public Vector3 世界向上方向 = Vector3.up; public bool 物体局部指定为准 = true; public Transform 指定为替换世界空间物体; public Vector3 局部世界物体指向 = Vector3.up; public bool 以上一个物体的局部轴为例 = false; public Vector3 上一个物体局部世界物体指向 = Vector3.up; public bool 启用 = true; private float 第一根骨骼与根骨骼的距离; private Vector3 第一根骨骼相对于根的局部位置; private Quaternion 第一根骨骼相对于根的局部旋转; public List<记录相对位置类> 骨骼组 = new List<记录相对位置类>(); private void Start() { 初始化骨骼关系(); } private void 初始化骨骼关系() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_005d: 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_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) 骨骼组.Clear(); for (int i = 0; i < 披风骨骼组.Count; i++) { if (i == 0) { 第一根骨骼相对于根的局部位置 = 根部披风.InverseTransformPoint(披风骨骼组[i].position); 第一根骨骼相对于根的局部旋转 = Quaternion.Inverse(根部披风.rotation) * 披风骨骼组[i].rotation; 第一根骨骼与根骨骼的距离 = Vector3.Distance(披风骨骼组[i].position, 根部披风.position); } else { Vector3 局部偏移 = 披风骨骼组[i - 1].InverseTransformPoint(披风骨骼组[i].position); Quaternion 局部旋转 = Quaternion.Inverse(披风骨骼组[i - 1].rotation) * 披风骨骼组[i].rotation; 骨骼组.Add(new 记录相对位置类(局部偏移, 局部旋转, Vector3.Distance(披风骨骼组[i].position, 披风骨骼组[i - 1].position))); } } } public void 设置启用(bool g = true) { 启用 = g; } private void Update() { //IL_0048: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0066: 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_006d: 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) if (启用) { 处理骨骼(); if (物体局部指定为准 && !以上一个物体的局部轴为例 && (Object)(object)指定为替换世界空间物体 != (Object)null) { Vector3 val = 指定为替换世界空间物体.TransformPoint(局部世界物体指向) - 指定为替换世界空间物体.position; Vector3 normalized = ((Vector3)(ref val)).normalized; 世界向上方向 = normalized; } } } private void 处理骨骼() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0070: 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_0078: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00c1: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 披风骨骼组.Count; i++) { Vector3 val; if (i == 0) { 披风骨骼组[i].position = 计算最大拉伸距离(根部披风.TransformPoint(第一根骨骼相对于根的局部位置), 披风骨骼组[i].position); val = 根部披风.position - 披风骨骼组[i].position; Vector3 normalized = ((Vector3)(ref val)).normalized; 披风骨骼组[i].rotation = Quaternion.Lerp(披风骨骼组[i].rotation, 计算旋转(normalized, 世界向上方向, 物体指向目标的轴, 物体的上方向轴, 根部披风), Time.deltaTime * 旋转速度); } else { 披风骨骼组[i].position = 计算最大拉伸距离(披风骨骼组[i - 1].TransformPoint(骨骼组[i - 1].相对于上一个骨骼的局部位置), 披风骨骼组[i].position); val = 披风骨骼组[i - 1].position - 披风骨骼组[i].position; Vector3 normalized2 = ((Vector3)(ref val)).normalized; 披风骨骼组[i].rotation = Quaternion.Lerp(披风骨骼组[i].rotation, 计算旋转(normalized2, 世界向上方向, 物体指向目标的轴, 物体的上方向轴, 披风骨骼组[i - 1]), Time.deltaTime * 旋转速度); } } } private Vector3 计算最大拉伸距离(Vector3 目标位置, Vector3 当前位置) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //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_0015: 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) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) //IL_0046: 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_0054: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Lerp(当前位置, 目标位置, Time.deltaTime * 移动速度); Vector3 val2 = val - 目标位置; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude > 最大拉伸距离) { return 目标位置 + val2 / magnitude * 最大拉伸距离; } return val; } private Quaternion 计算旋转(Vector3 目标方向, Vector3 世界向上, Vector3 物体指向轴, Vector3 物体向上轴, Transform 指定世界之上) { //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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_003d: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: 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_00d4: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00e5: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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) //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_0162: Unknown result type (might be due to invalid IL or missing references) Vector3 val; Vector3 val2; if (以上一个物体的局部轴为例 && (Object)(object)指定世界之上 != (Object)null) { val = 指定世界之上.TransformPoint(上一个物体局部世界物体指向) - 指定世界之上.position; val2 = ((Vector3)(ref val)).normalized; float num = Mathf.Abs(Vector3.Dot(val2, ((Vector3)(ref 目标方向)).normalized)); if (num > 0.9999f) { val2 = 指定世界之上.right; } } else { val2 = ((Vector3)(ref 世界向上)).normalized; } 目标方向 = ((Vector3)(ref 目标方向)).normalized; 物体指向轴 = ((Vector3)(ref 物体指向轴)).normalized; 物体向上轴 = ((Vector3)(ref 物体向上轴)).normalized; float num2 = Mathf.Abs(Vector3.Dot(目标方向, val2)); Vector3 val4; if (num2 > 0.9999f) { Vector3 val3 = ((Mathf.Abs(Vector3.Dot(目标方向, Vector3.right)) < 0.9999f) ? Vector3.right : Vector3.forward); val = Vector3.Cross(val3, 目标方向); Vector3 normalized = ((Vector3)(ref val)).normalized; val = Vector3.Cross(目标方向, normalized); val4 = ((Vector3)(ref val)).normalized; } else { val = Vector3.Cross(val2, 目标方向); Vector3 normalized2 = ((Vector3)(ref val)).normalized; val = Vector3.Cross(目标方向, normalized2); val4 = ((Vector3)(ref val)).normalized; if (Vector3.Dot(val4, val2) < 0f) { val4 = -val4; } } Quaternion val5 = Quaternion.LookRotation(目标方向, val4); Quaternion val6 = Quaternion.LookRotation(物体指向轴, 物体向上轴); return val5 * Quaternion.Inverse(val6); } } public class 指定动画事件 : MonoBehaviour { [Header("动画事件组")] [Tooltip("索引0对应事件0,索引1对应事件1,以此类推")] public UnityEvent[] 事件组; [Header("调试选项")] [Tooltip("在控制台打印触发信息")] public bool 显示调试信息 = true; public void 激活指定事件(int i) { if (事件组 == null) { Debug.LogError((object)("【动画事件错误】" + ((Object)((Component)this).gameObject).name + ":事件组数组为空!"), (Object)(object)this); return; } if (i < 0 || i >= 事件组.Length) { Debug.LogError((object)$"【动画事件错误】{((Object)((Component)this).gameObject).name}:索引 {i} 超出范围(0-{事件组.Length - 1})!", (Object)(object)this); return; } UnityEvent val = 事件组[i]; if (val == null) { Debug.LogWarning((object)$"【动画事件警告】{((Object)((Component)this).gameObject).name}:索引 {i} 的事件未设置!", (Object)(object)this); return; } val.Invoke(); if (显示调试信息) { Debug.Log((object)$"【动画事件触发】{((Object)((Component)this).gameObject).name}:已触发索引 {i} 的事件,监听器数量:{((UnityEventBase)val).GetPersistentEventCount()}", (Object)(object)this); } } public void 激活指定事件带参数(int i, string 额外信息) { if (显示调试信息) { Debug.Log((object)$"【动画事件触发】{((Object)((Component)this).gameObject).name}:触发索引 {i},额外信息:{额外信息}"); } 激活指定事件(i); } public void 批量触发事件(int startIndex, int endIndex) { for (int i = startIndex; i <= endIndex; i++) { 激活指定事件(i); } } private void Reset() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown 事件组 = (UnityEvent[])(object)new UnityEvent[3]; for (int i = 0; i < 事件组.Length; i++) { 事件组[i] = new UnityEvent(); } Debug.Log((object)$"【动画事件工具】已为 {((Object)((Component)this).gameObject).name} 创建默认的 {事件组.Length} 个事件槽"); } private void OnValidate() { if (事件组 == null || !显示调试信息) { return; } for (int i = 0; i < 事件组.Length; i++) { if (事件组[i] == null || ((UnityEventBase)事件组[i]).GetPersistentEventCount() > 0) { } } } } public class 方向移动碰撞检测 : MonoBehaviour { public UnityEvent 碰撞事件; public LayerMask 受影响层; public float 移动速度 = 5f; private bool 碰撞成功 = false; private bool 成功获取队伍标识 = true; private Team 队伍标识; private void Start() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) TeamHolder component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { 队伍标识 = component.team; } else { 成功获取队伍标识 = false; } } private void Update() { //IL_0013: 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_0028: Unknown result type (might be due to invalid IL or missing references) if (!碰撞成功) { ((Component)this).transform.Translate(Vector3.forward * 移动速度 * Time.deltaTime); } } private void OnTriggerEnter(Collider other) { //IL_0084: 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_00cc: Unknown result type (might be due to invalid IL or missing references) if (碰撞成功) { return; } Debug.Log((object)$"碰到物体:{((Object)other).name}, Layer:{((Component)other).gameObject.layer}"); if (((Component)other).gameObject.layer == 9) { Debug.Log((object)"碰到地面层9"); UnityEvent obj = 碰撞事件; if (obj != null) { obj.Invoke(); } 碰撞成功 = true; } else { if (((1 << ((Component)other).gameObject.layer) & LayerMask.op_Implicit(受影响层)) == 0 || !成功获取队伍标识) { return; } Unit component = ((Component)((Component)other).transform.root).GetComponent(); if ((Object)(object)component != (Object)null && component.data.team != 队伍标识 && !component.data.Dead) { UnityEvent obj2 = 碰撞事件; if (obj2 != null) { obj2.Invoke(); } 碰撞成功 = true; } } } } public class 抛射物开局快速后减速 : MonoBehaviour { [CompilerGenerated] private sealed class <减速携程>d__5 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 抛射物开局快速后减速 <>4__this; private float <当前时间>5__1; private float <起始速度>5__2; private float 5__3; private float <曲线值>5__4; private float <新速度>5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <减速携程>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <当前时间>5__1 = 0f; <起始速度>5__2 = <>4__this.指定类.移动速度; break; case 1: <>1__state = -1; break; } if (<当前时间>5__1 < <>4__this.减速总时间) { if ((Object)(object)<>4__this.指定类 == (Object)null) { return false; } 5__3 = <当前时间>5__1 / <>4__this.减速总时间; <曲线值>5__4 = <>4__this.速度曲线.Evaluate(5__3); <新速度>5__5 = Mathf.Lerp(<起始速度>5__2, <>4__this.速度倍率, <曲线值>5__4); <>4__this.指定类.移动速度 = <新速度>5__5; <当前时间>5__1 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)<>4__this.指定类 != (Object)null) { <>4__this.指定类.移动速度 = <起始速度>5__2; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public AnimationCurve 速度曲线; public float 速度倍率 = 9f; public float 减速总时间 = 1f; public 方向移动碰撞检测 指定类; private void Start() { if ((Object)(object)指定类 == (Object)null) { Debug.LogError((object)("[抛射物开局快速后减速] " + ((Object)((Component)this).gameObject).name + ": 指定类未赋值!")); return; } if (速度曲线 == null) { Debug.LogError((object)("[抛射物开局快速后减速] " + ((Object)((Component)this).gameObject).name + ": 速度曲线未赋值!")); return; } if (减速总时间 <= 0f) { Debug.LogWarning((object)("[抛射物开局快速后减速] " + ((Object)((Component)this).gameObject).name + ": 减速总时间必须大于0,已自动设置为0.1f")); 减速总时间 = 0.1f; } ((MonoBehaviour)this).StartCoroutine(减速携程()); } [IteratorStateMachine(typeof(<减速携程>d__5))] private IEnumerator 减速携程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <减速携程>d__5(0) { <>4__this = this }; } } public class 旋转管理器增强版 : BatchedMonobehaviour { [Header("旋转参数")] public float rotationForce = 10f; [Header("向前轴向设置")] [Tooltip("躯干使用的向前轴向(相对于物体局部坐标)")] public Vector3 躯干向前轴 = new Vector3(0f, 0f, 1f); [Tooltip("臀部使用的向前轴向(相对于物体局部坐标)")] public Vector3 臀部向前轴 = new Vector3(0f, 0f, 1f); [Header("向上轴修正")] [Tooltip("是否启用向上轴姿态修正")] public bool enableUpAxisCorrection = true; [Tooltip("躯干使用的向上轴向(相对于物体局部坐标)")] public Vector3 躯干向上轴 = new Vector3(0f, 1f, 0f); [Tooltip("臀部使用的向上轴向(相对于物体局部坐标)")] public Vector3 臀部向上轴 = new Vector3(0f, 1f, 0f); [Tooltip("向上修正力度")] [Range(0f, 50f)] public float upCorrectionForce = 10f; [Tooltip("最大处理向上角度")] [Range(0f, 180f)] public float maxUpAngle = 45f; [Tooltip("向上修正最小触发角度")] [Range(0f, 30f)] public float upAngleThreshold = 5f; [Tooltip("是否使用自定义世界向上方向")] public bool useCustomWorldUp = false; [Tooltip("自定义世界向上方向(仅在useCustomWorldUp=true时生效)")] public Vector3 customWorldUp = Vector3.up; [Header("阻尼设置")] [Tooltip("是否启用角速度阻尼")] public bool enableUpDamping = true; [Tooltip("阻尼系数(越大衰减越快)")] [Range(0f, 1f)] public float upDampingCoefficient = 0.1f; [Header("调试选项")] [Tooltip("在控制台显示向上偏离角度")] public bool showDebugUpAngles = false; [Header("方向限制")] [Tooltip("是否忽略Y轴")] public bool ignoreY = false; [Tooltip("是否锁定目标方向Y轴为0")] public bool lockYToZero = false; [Tooltip("是否朝向移动方向")] public bool rotateTowardsMovement = false; [Header("角度限制")] [Tooltip("最大处理角度(超过此角度也只按此角度计算)")] [Range(0f, 180f)] public float maxAngle = 15f; [Tooltip("最小角度阈值(小于此角度不施加扭矩)")] [Range(0f, 10f)] public float minAngleThreshold = 0.5f; [HideInInspector] public float rotationMultiplier = 1f; private Rigidbody torso; private Rigidbody hip; private DataHandler data; protected override void Start() { ((BatchedMonobehaviour)this).Start(); data = ((Component)this).GetComponent(); torso = ((Component)((Component)this).GetComponentInChildren()).GetComponent(); hip = ((Component)((Component)this).GetComponentInChildren()).GetComponent(); } public override void BatchedFixedUpdate() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0082: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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_014c: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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_01e5: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) if (data.Dead || !data.isGrounded || !((Behaviour)this).enabled) { return; } Vector3 forwardDirection = GetForwardDirection(((Component)hip).transform, 臀部向前轴); Vector3 forwardDirection2 = GetForwardDirection(((Component)torso).transform, 躯干向前轴); Vector3 forward = data.characterForwardObject.forward; if (ignoreY) { forwardDirection.y = 0f; forwardDirection2.y = 0f; forward.y = 0f; } if (lockYToZero) { forward.y = 0f; } if (rotateTowardsMovement) { forward = data.groundedMovementDirectionObject.forward; } ((Vector3)(ref forwardDirection)).Normalize(); ((Vector3)(ref forwardDirection2)).Normalize(); ((Vector3)(ref forward)).Normalize(); float num = (0f - rotationMultiplier) * data.muscleControl * rotationForce * data.torsoAngleMultiplier; float num2 = Mathf.Clamp(Vector3.Angle(forward, forwardDirection), 0f, maxAngle); float num3 = Mathf.Clamp(Vector3.Angle(forward, forwardDirection2), 0f, maxAngle); float num4 = num2 * num; float num5 = num3 * num; Vector3 val; if (num2 > minAngleThreshold) { val = Vector3.Cross(forward, forwardDirection); Vector3 normalized = ((Vector3)(ref val)).normalized; if (normalized != Vector3.zero) { hip.AddTorque(FixedTimeStepService.TorqueCoefficient * num4 * normalized, (ForceMode)5); } } if (num3 > minAngleThreshold) { val = Vector3.Cross(forward, forwardDirection2); Vector3 normalized2 = ((Vector3)(ref val)).normalized; if (normalized2 != Vector3.zero) { torso.AddTorque(FixedTimeStepService.TorqueCoefficient * num5 * normalized2, (ForceMode)5); } } if (enableUpAxisCorrection) { ApplyUpAxisCorrection(); } } private void ApplyUpAxisCorrection() { //IL_000e: 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_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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_004c: 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_0054: 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_00ae: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) Vector3 upDirection = GetUpDirection(((Component)hip).transform, 臀部向上轴); Vector3 upDirection2 = GetUpDirection(((Component)torso).transform, 躯干向上轴); Vector3 val = (useCustomWorldUp ? ((Vector3)(ref customWorldUp)).normalized : Vector3.up); float num = Vector3.Angle(upDirection, val); float num2 = Vector3.Angle(upDirection2, val); float num3 = upCorrectionForce * data.muscleControl; float num4 = Mathf.Clamp(num, 0f, maxUpAngle) * num3; float num5 = Mathf.Clamp(num2, 0f, maxUpAngle) * num3; Vector3 val2; if (num > upAngleThreshold) { val2 = Vector3.Cross(upDirection, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; if (normalized != Vector3.zero) { hip.AddTorque(FixedTimeStepService.TorqueCoefficient * num4 * normalized, (ForceMode)5); if (enableUpDamping) { ApplyAngularDamping(hip, upDampingCoefficient); } } } if (num2 > upAngleThreshold) { val2 = Vector3.Cross(upDirection2, val); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; if (normalized2 != Vector3.zero) { torso.AddTorque(FixedTimeStepService.TorqueCoefficient * num5 * normalized2, (ForceMode)5); if (enableUpDamping) { ApplyAngularDamping(torso, upDampingCoefficient); } } } if (showDebugUpAngles && num > upAngleThreshold) { Debug.Log((object)$"髋部向上偏离: {num:F1}°, 修正扭矩: {num4:F2}"); } } private void ApplyAngularDamping(Rigidbody rb, float damping) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) rb.AddTorque(-rb.angularVelocity * damping, (ForceMode)5); } private Vector3 GetForwardDirection(Transform transform, Vector3 forwardAxis) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) return transform.TransformDirection(((Vector3)(ref forwardAxis)).normalized); } private Vector3 GetUpDirection(Transform transform, Vector3 upAxis) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) return transform.TransformDirection(((Vector3)(ref upAxis)).normalized); } private void OnDrawGizmosSelected() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_010e: 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_0120: 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_0194: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hip != (Object)null && (Object)(object)((Component)hip).transform != (Object)null) { Gizmos.color = Color.blue; Vector3 forwardDirection = GetForwardDirection(((Component)hip).transform, 臀部向前轴); Gizmos.DrawRay(((Component)hip).transform.position, forwardDirection * 0.5f); if (enableUpAxisCorrection) { Gizmos.color = Color.red; Vector3 upDirection = GetUpDirection(((Component)hip).transform, 臀部向上轴); Gizmos.DrawRay(((Component)hip).transform.position, upDirection * 0.5f); } } if ((Object)(object)torso != (Object)null && (Object)(object)((Component)torso).transform != (Object)null) { Gizmos.color = Color.green; Vector3 forwardDirection2 = GetForwardDirection(((Component)torso).transform, 躯干向前轴); Gizmos.DrawRay(((Component)torso).transform.position, forwardDirection2 * 0.5f); if (enableUpAxisCorrection) { Gizmos.color = Color.yellow; Vector3 upDirection2 = GetUpDirection(((Component)torso).transform, 躯干向上轴); Gizmos.DrawRay(((Component)torso).transform.position, upDirection2 * 0.5f); } } if (enableUpAxisCorrection) { Gizmos.color = Color.white; Vector3 val = (useCustomWorldUp ? ((Vector3)(ref customWorldUp)).normalized : Vector3.up); Gizmos.DrawRay(((Component)this).transform.position, val * 1f); } } } public class 目标单位距离事件 : MonoBehaviour { public Unit 此单位; public UnityEvent 距离事件; public UnityEvent 反向事件; public float 距离临界值; private void Start() { if ((Object)(object)此单位 == (Object)null) { 此单位 = ((Component)((Component)this).transform.root).GetComponent(); } } public void 检测触发事件() { //IL_0063: 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) if ((Object)(object)此单位 == (Object)null) { Debug.LogWarning((object)"此单位未找到"); return; } DataHandler targetData = 此单位.data.targetData; if ((Object)(object)targetData == (Object)null || (Object)(object)targetData.mainRig == (Object)null) { Debug.LogWarning((object)"目标数据或mainRig为空"); return; } float num = Vector3.Distance(((Component)this).transform.position, targetData.mainRig.position); if (num <= 距离临界值) { UnityEvent obj = 距离事件; if (obj != null) { obj.Invoke(); } } else { UnityEvent obj2 = 反向事件; if (obj2 != null) { obj2.Invoke(); } } } } public class 碰撞检测吸引目标 : MonoBehaviour { public enum 施加方式 { 对敌方, 全部, 对自己和对于, 仅自己 } public enum 检测方式 { 物体, 单位 } [Header("检测参数")] [Tooltip("检测半径")] public float 检测半径 = 6f; [Tooltip("检测层")] public LayerMask 检测层; [Header("吸引参数")] [Tooltip("每次吸引持续时间")] public float 每次吸引时间 = 1f; [Tooltip("力度乘数")] public float 力度乘数 = 10f; [Header("效果设置")] public 施加方式 效果施加对应 = 施加方式.对敌方; public 检测方式 检测类型 = 检测方式.单位; private bool 启用 = false; private readonly List 全部刚体 = new List(); private float 吸引计时器 = 0f; private Team 队伍信息; private Unit 自身Unit; private Collider[] 缓存碰撞结果; private const int 最大碰撞数量 = 50; private void Start() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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) //IL_0046: Unknown result type (might be due to invalid IL or missing references) 缓存碰撞结果 = (Collider[])(object)new Collider[50]; switch (检测类型) { case 检测方式.单位: { Unit componentInParent2 = ((Component)this).GetComponentInParent(); if ((Object)(object)componentInParent2 != (Object)null) { 队伍信息 = componentInParent2.data.team; 自身Unit = componentInParent2; } else { Debug.LogError((object)("[碰撞检测吸引目标] 未找到父级Unit组件: " + ((Object)((Component)this).gameObject).name)); ((Behaviour)this).enabled = false; } break; } case 检测方式.物体: { TeamHolder componentInParent = ((Component)this).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { 队伍信息 = componentInParent.team; break; } Debug.LogError((object)("[碰撞检测吸引目标] 未找到父级TeamHolder组件: " + ((Object)((Component)this).gameObject).name)); ((Behaviour)this).enabled = false; break; } } } private void Update() { if (启用 && 全部刚体.Count != 0) { 吸引计时器 += Time.deltaTime; if (吸引计时器 >= 每次吸引时间) { 停止吸引(); } else { 执行吸引(); } } } private void 执行吸引() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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) for (int num = 全部刚体.Count - 1; num >= 0; num--) { Rigidbody val = 全部刚体[num]; if ((Object)(object)val == (Object)null) { 全部刚体.RemoveAt(num); } else { Vector3 val2 = ((Component)val).transform.position - ((Component)this).transform.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude > 检测半径 * 检测半径) { 全部刚体.RemoveAt(num); } else { float num2 = ((sqrMagnitude > 0.01f) ? (力度乘数 / (sqrMagnitude + 0.5f)) : 力度乘数); Vector3 val3 = ((Vector3)(ref val2)).normalized * (Time.deltaTime * num2); val.AddForce(val3, (ForceMode)5); } } } if (全部刚体.Count == 0) { 停止吸引(); } } public void 开始检测() { //IL_001a: 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) if (启用) { 停止吸引(); } int num = Physics.OverlapSphereNonAlloc(((Component)this).transform.position, 检测半径, 缓存碰撞结果, LayerMask.op_Implicit(检测层)); if (num == 0) { return; } bool flag = false; for (int i = 0; i < num; i++) { Collider val = 缓存碰撞结果[i]; if (!((Object)(object)val == (Object)null)) { Unit component = ((Component)((Component)val).transform.root).GetComponent(); if (!((Object)(object)component == (Object)null) && !component.data.Dead && 判断是否有效目标(component)) { 全部刚体.Add(component.data.mainRig); flag = true; } } } if (flag) { 启用 = true; 吸引计时器 = 0f; } } private bool 判断是否有效目标(Unit targetUnit) { //IL_0028: 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_0045: 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) return 效果施加对应 switch { 施加方式.对敌方 => targetUnit.data.team != 队伍信息, 施加方式.全部 => true, 施加方式.对自己和对于 => targetUnit.data.team == 队伍信息, 施加方式.仅自己 => (Object)(object)自身Unit != (Object)null && (Object)(object)targetUnit == (Object)(object)自身Unit, _ => false, }; } private void 停止吸引() { 启用 = false; 全部刚体.Clear(); 吸引计时器 = 0f; } public void 手动停止吸引() { 停止吸引(); } public int 获取吸引目标数量() { return 全部刚体.Count; } public void 设置吸引参数(float 新半径, float 新力度) { 检测半径 = Mathf.Max(0f, 新半径); 力度乘数 = Mathf.Max(0f, 新力度); } } public class 简易指定事件触发器 : MonoBehaviour { public bool 启用 = true; public UnityEvent[] 指定事件组; public int 事件触发索引 = 0; public void 触发当前索引事件() { if (!启用) { return; } if (指定事件组 == null || 指定事件组.Length == 0) { Debug.LogWarning((object)"事件组为空,无法触发事件", (Object)(object)this); return; } if (事件触发索引 < 0 || 事件触发索引 >= 指定事件组.Length) { Debug.LogError((object)$"事件触发索引 {事件触发索引} 超出范围 (0-{指定事件组.Length - 1})", (Object)(object)this); return; } UnityEvent obj = 指定事件组[事件触发索引]; if (obj != null) { obj.Invoke(); } } public void 触发指定索引事件(int 索引 = 0) { if (!启用) { return; } if (指定事件组 == null || 指定事件组.Length == 0) { Debug.LogWarning((object)"事件组为空,无法触发事件", (Object)(object)this); return; } if (索引 < 0 || 索引 >= 指定事件组.Length) { Debug.LogError((object)$"索引 {索引} 超出范围 (0-{指定事件组.Length - 1})", (Object)(object)this); return; } UnityEvent obj = 指定事件组[索引]; if (obj != null) { obj.Invoke(); } } public void 修改当前索引(int q = 0) { if (启用) { if (指定事件组 != null && (q < 0 || q >= 指定事件组.Length)) { Debug.LogError((object)$"试图将索引修改为 {q},但有效范围是 0-{指定事件组.Length - 1}", (Object)(object)this); } else { 事件触发索引 = q; } } } public void 设置启用(bool q = true) { 启用 = q; } public bool 尝试触发事件(int 索引) { if (!启用) { return false; } if (指定事件组 == null || 索引 < 0 || 索引 >= 指定事件组.Length) { return false; } UnityEvent obj = 指定事件组[索引]; if (obj != null) { obj.Invoke(); } return true; } public int 获取事件数量() { UnityEvent[] array = 指定事件组; return (array != null) ? array.Length : 0; } public bool 索引是否有效(int 索引) { return 指定事件组 != null && 索引 >= 0 && 索引 < 指定事件组.Length; } } public class 抛物线子弹 : MonoBehaviour { public Vector3 目标位置; public float 飞行时间 = 2f; public float 抛物线高度 = 5f; public UnityEvent 到达目标事件; public ParticleSystem[] 拖尾粒子效果; private Vector3 起点位置; private float 当前时间 = 0f; private bool 是否运动中 = true; private List 已添加的监听器 = new List(); [HideInInspector] public Transform 物体参考系; [HideInInspector] public bool 已设置物体参考系 = false; private void Start() { //IL_0008: 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) 起点位置 = ((Component)this).transform.position; } private void Update() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!是否运动中) { return; } 当前时间 += Time.deltaTime; float num = 当前时间 / 飞行时间; if (num >= 1f) { ((Component)this).transform.position = 目标位置; UnityEvent obj = 到达目标事件; if (obj != null) { obj.Invoke(); } 是否运动中 = false; } else { ((Component)this).transform.position = 计算抛物线位置(num); } } private Vector3 计算抛物线位置(float t) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Lerp(起点位置, 目标位置, t); float num = 4f * 抛物线高度 * t * (1f - t); return new Vector3(val.x, val.y + num, val.z); } public void 在目标处实例化(GameObject gameddd) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown if (!((Object)(object)gameddd == (Object)null)) { GameObject val = Object.Instantiate(gameddd, 目标位置, Quaternion.identity); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); 辅助事件触发器 component = val.GetComponent<辅助事件触发器>(); if ((Object)(object)component != (Object)null && component.启用) { UnityAction val2 = new UnityAction(component.触发事件); 到达目标事件.AddListener(val2); 已添加的监听器.Add(val2); } } } private void OnDestroy() { foreach (UnityAction item in 已添加的监听器) { 到达目标事件.RemoveListener(item); } 已添加的监听器.Clear(); if ((Object)(object)物体参考系 != (Object)null) { Object.Destroy((Object)(object)((Component)物体参考系).gameObject); } } public void 清除参考系() { if (已设置物体参考系 && (Object)(object)物体参考系 != (Object)null) { 物体参考系.SetParent((Transform)null); } } } public class 辅助事件触发器 : MonoBehaviour { public bool 启用; public UnityEvent 辅助事件; public void 设置启用(bool s = true) { 启用 = s; } public void 触发事件() { UnityEvent obj = 辅助事件; if (obj != null) { obj.Invoke(); } } } public class 随机召唤抛射物子弹 : MonoBehaviour { public GameObject 实例化物体; public float 最大范围 = 5f; public float 最小范围 = 1f; public bool 设置参考系 = true; public Vector3 获取地面位置(Vector3 测试位置, float 检测高度 = 10f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //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_001d: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //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_0047: Unknown result type (might be due to invalid IL or missing references) Vector3 val = 测试位置 + Vector3.up * 检测高度; float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, 512)) { return ((RaycastHit)(ref val2)).point; } return 测试位置; } private Vector3 获取圆形随机点() { //IL_0041: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range(0f, 360f) * ((float)Math.PI / 180f); float num2 = Random.Range(最小范围, 最大范围); float num3 = Mathf.Cos(num) * num2; float num4 = Mathf.Sin(num) * num2; return ((Component)this).transform.position + new Vector3(num3, 0f, num4); } private Vector3 获取圆形随机点_均匀分布() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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) float num = Mathf.Sqrt(Random.Range(最小范围 * 最小范围, 最大范围 * 最大范围)); float num2 = Random.Range(0f, 360f) * ((float)Math.PI / 180f); float num3 = Mathf.Cos(num2) * num; float num4 = Mathf.Sin(num2) * num; return ((Component)this).transform.position + new Vector3(num3, 0f, num4); } public void 实例化抛射物随机朝向() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_007e: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)实例化物体 != (Object)null)) { return; } Vector3 val = 获取圆形随机点(); Vector3 val2 = val - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; GameObject val3 = Object.Instantiate(实例化物体, ((Component)this).transform.position, Quaternion.LookRotation(normalized)); TeamHolder.AddTeamHolder(val3, ((Component)this).gameObject); 抛物线子弹 component = val3.GetComponent<抛物线子弹>(); if (!((Object)(object)component != (Object)null)) { return; } component.目标位置 = 获取地面位置(val); if (!设置参考系) { return; } GameObject val4 = new GameObject("粒子参考系"); val4.transform.SetParent(((Component)this).transform); component.物体参考系 = val4.transform; component.已设置物体参考系 = true; ParticleSystem[] componentsInChildren = val3.GetComponentsInChildren(); if (componentsInChildren != null && componentsInChildren.Length != 0) { for (int i = 0; i < componentsInChildren.Length; i++) { MainModule main = componentsInChildren[i].main; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)2; ((MainModule)(ref main)).customSimulationSpace = val4.transform; } } } } public class 追踪抛射物简易 : MonoBehaviour { public MoveTransform 移动组件; public float 速度; public DataHandler 追踪单位; public bool 自动获取 = true; public int 连锁数量 = 5; public float 触发伤害距离 = 0.5f; public float 伤害 = 900f; public float 检测范围 = 9f; public UnityEvent 到达目标事件; public UnityEvent 连锁完毕事件; public 最近单位获取高度定义 单位获取工具; public bool 启用 = true; private List 已记录单位; private int 当前连锁次数 = 0; private bool 是否已命中 = false; private void Start() { 已记录单位 = new List(); if (自动获取 && (Object)(object)追踪单位 == (Object)null) { 重新获取单位(); } } private void Update() { //IL_00ed: 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_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_0106: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) if (!启用 || (Object)(object)移动组件 == (Object)null || !((Behaviour)移动组件).enabled) { return; } if ((Object)(object)追踪单位 == (Object)null) { if (自动获取) { 重新获取单位(); } if ((Object)(object)追踪单位 == (Object)null) { return; } } if (已记录单位.Contains(追踪单位)) { 重新获取单位(); if ((Object)(object)追踪单位 == (Object)null || 已记录单位.Contains(追踪单位)) { UnityEvent obj = 连锁完毕事件; if (obj != null) { obj.Invoke(); } 停止追踪(); return; } } Vector3 val = 追踪单位.mainRig.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; 移动组件.velocity = normalized * 速度; float num = Vector3.Distance(((Component)this).transform.position, 追踪单位.mainRig.position); if (num <= 触发伤害距离 && !是否已命中) { 命中目标(); } } private void 命中目标() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) 是否已命中 = true; ((Damagable)追踪单位.healthHandler).TakeDamage(伤害, ((Component)this).transform.position, (Unit)null, (DamageType)0); if (!已记录单位.Contains(追踪单位)) { 已记录单位.Add(追踪单位); } UnityEvent obj = 到达目标事件; if (obj != null) { obj.Invoke(); } 当前连锁次数++; if (当前连锁次数 < 连锁数量) { DataHandler val = 获取下一个目标(); if ((Object)(object)val != (Object)null) { 追踪单位 = val; 是否已命中 = false; return; } UnityEvent obj2 = 连锁完毕事件; if (obj2 != null) { obj2.Invoke(); } 停止追踪(); } else { UnityEvent obj3 = 连锁完毕事件; if (obj3 != null) { obj3.Invoke(); } 停止追踪(); } } private void 重新获取单位() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)单位获取工具 != (Object)null)) { return; } List targets = 单位获取工具.GetTargets(((Component)this).transform.position, 检测范围); if (targets.Count <= 0) { return; } foreach (Unit item in targets) { if (!已记录单位.Contains(item.data)) { 追踪单位 = item.data; return; } } 追踪单位 = null; } private DataHandler 获取下一个目标() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)单位获取工具 != (Object)null) { List targets = 单位获取工具.GetTargets(追踪单位.mainRig.position, 检测范围); if (targets.Count > 0) { foreach (Unit item in targets) { if (!已记录单位.Contains(item.data) && (Object)(object)item.data != (Object)(object)追踪单位) { return item.data; } } } } return null; } private void 停止追踪() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) 启用 = false; if ((Object)(object)移动组件 != (Object)null) { ((Behaviour)移动组件).enabled = false; 移动组件.velocity = Vector3.zero; } ((Behaviour)this).enabled = false; } public void 设置目标(DataHandler 目标) { if ((Object)(object)目标 != (Object)null && !已记录单位.Contains(目标)) { 追踪单位 = 目标; } } public void 重置连锁() { 当前连锁次数 = 0; 是否已命中 = false; 已记录单位.Clear(); 启用 = true; if ((Object)(object)移动组件 != (Object)null) { ((Behaviour)移动组件).enabled = true; } } public void 重新启动追踪() { 启用 = true; if ((Object)(object)移动组件 != (Object)null && !((Behaviour)移动组件).enabled) { ((Behaviour)移动组件).enabled = true; } if ((Object)(object)追踪单位 == (Object)null && 自动获取) { 重新获取单位(); } } } internal class 实例化追踪物体 : MonoBehaviour { public Unit 此单曲我单位; private void Start() { 此单曲我单位 = ((Component)((Component)this).transform.root).GetComponent(); } public void 实例化物体(GameObject sp) { //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) if (!((Object)(object)sp == (Object)null) && !((Object)(object)此单曲我单位 == (Object)null)) { GameObject val = Object.Instantiate(sp, ((Component)this).transform.position, Quaternion.identity); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); 追踪抛射物简易 component = val.GetComponent<追踪抛射物简易>(); if ((Object)(object)component != (Object)null) { component.追踪单位 = 此单曲我单位.data.targetData; } } } } public class PlaySoundEffectAutoCleanup : MonoBehaviour, IValidatable, IPoolable { [CompilerGenerated] private sealed class d__29 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AudioPlayer player; public float fadeTime; public PlaySoundEffectAutoCleanup <>4__this; private float 5__1; private float 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (player == null || (Object)(object)player.source == (Object)null) { return false; } 5__1 = player.source.volume; 5__2 = 0f; break; case 1: <>1__state = -1; break; } if (5__2 < fadeTime) { 5__2 += Time.unscaledDeltaTime; 5__3 = 5__2 / fadeTime; player.source.volume = Mathf.Lerp(5__1, 0f, 5__3); <>2__current = null; <>1__state = 1; return true; } player.source.Stop(); player.isUsed = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [SerializeField] private string soundRef; [SerializeField] private AudioPathData soundPathData; public bool PlayOnAwake = true; private AudioPlayer currentAudioPlayer; private SoundPlayer soundPlayer; private bool init; private bool isPlaying; public bool IsManagedByPool { get; set; } public Action ReleaseSelf { get; set; } public string SoundRef { get { return soundRef; } set { soundRef = value; AudioPathData.ValidateAndAssignPathData(soundRef, ref soundPathData, (Object)(object)((Component)this).gameObject); } } public bool IsPlaying => isPlaying && currentAudioPlayer != null && currentAudioPlayer.isUsed; public bool Validate() { return AudioPathData.ValidateAndAssignPathData(soundRef, ref soundPathData, (Object)(object)((Component)this).gameObject); } private void Start() { if (!IsManagedByPool) { InitializeOnSpawn(); } } private void OnDestroy() { StopAndCleanupAudio(); } private void OnDisable() { if (!IsManagedByPool) { StopAndCleanupAudio(); } } public void Go() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (isPlaying) { StopAndCleanupAudio(); } Init(); if (!string.IsNullOrEmpty(soundRef) && soundPathData != null) { currentAudioPlayer = soundPlayer.PlaySoundEffectNonAlloc(soundPathData, 1f, ((Component)this).transform.position, (MaterialType)0, (Transform)null, 1f); if (currentAudioPlayer != null) { isPlaying = true; RegisterCleanupCallback(); } } else if (!string.IsNullOrEmpty(soundRef)) { currentAudioPlayer = soundPlayer.PlaySoundEffect(soundRef, 1f, ((Component)this).transform.position, (MaterialType)0, (Transform)null, 1f); if (currentAudioPlayer != null) { isPlaying = true; RegisterCleanupCallback(); } } } public void GoFollowTarget() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) StopAndCleanupAudio(); Init(); if (!string.IsNullOrEmpty(soundRef) && soundPathData != null) { currentAudioPlayer = soundPlayer.PlaySoundEffectNonAlloc(soundPathData, 1f, ((Component)this).transform.position, (MaterialType)0, ((Component)this).transform, 1f); if (currentAudioPlayer != null) { isPlaying = true; RegisterCleanupCallback(); } } else if (!string.IsNullOrEmpty(soundRef)) { currentAudioPlayer = soundPlayer.PlaySoundEffect(soundRef, 1f, ((Component)this).transform.position, (MaterialType)0, ((Component)this).transform, 1f); if (currentAudioPlayer != null) { isPlaying = true; RegisterCleanupCallback(); } } } public void Stop() { StopAndCleanupAudio(); } public void StopWithFade(float fadeTime = 0.5f) { if (currentAudioPlayer != null && currentAudioPlayer.isUsed && (Object)(object)soundPlayer != (Object)null) { ((MonoBehaviour)soundPlayer).StartCoroutine(FadeOutAndStop(currentAudioPlayer, fadeTime)); } isPlaying = false; currentAudioPlayer = null; } private void StopAndCleanupAudio() { if (currentAudioPlayer != null && currentAudioPlayer.isUsed) { if ((Object)(object)currentAudioPlayer.source != (Object)null) { currentAudioPlayer.source.Stop(); } currentAudioPlayer.isUsed = false; currentAudioPlayer = null; } isPlaying = false; } [IteratorStateMachine(typeof(d__29))] private IEnumerator FadeOutAndStop(AudioPlayer player, float fadeTime) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { <>4__this = this, player = player, fadeTime = fadeTime }; } private void RegisterCleanupCallback() { if (currentAudioPlayer == null) { } } public void Initialize() { InitializeOnSpawn(); } public void Reset() { StopAndCleanupAudio(); soundRef = string.Empty; soundPathData = null; init = false; isPlaying = false; currentAudioPlayer = null; } public void Release() { StopAndCleanupAudio(); ReleaseSelf?.Invoke(); } private void InitializeOnSpawn() { Init(); if (PlayOnAwake) { Go(); } } private void Init() { if (!init) { soundPlayer = ServiceLocator.GetService(); init = true; } } private void Update() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (isPlaying && currentAudioPlayer != null && currentAudioPlayer.isUsed) { if ((Object)(object)currentAudioPlayer.transformToFollow == (Object)null && (Object)(object)currentAudioPlayer.source != (Object)null && currentAudioPlayer.source.spatialBlend > 0.1f) { ((Component)currentAudioPlayer.source).transform.position = ((Component)this).transform.position; } if (currentAudioPlayer.currentTimePlayed >= currentAudioPlayer.clipLength) { isPlaying = false; currentAudioPlayer = null; } } else if (isPlaying) { isPlaying = false; currentAudioPlayer = null; } } } internal class 音频时间变换 { } } namespace rwdseerfd.unity脚本存储文件夹.雷电龙类.躯干力度 { internal class 手臂爬行添加向外力 : MonoBehaviour { public Rigidbody 左手刚体; public Rigidbody 右手刚体; public Transform 躯干变换; public int 走路动画值; public int 空闲动画值; public int 转弯动画值; public float 最大力度 = 10f; public float 最小距离 = 0.3f; public float 最大距离 = 1f; public AnimationCurve 力度曲线; public bool 自动距离 = true; public float 自动距离补偿 = 1.1f; public bool 指定向外方向 = true; public Vector3 左手向外方向; public Vector3 右手向外方向; public float 转弯倍率 = 1.1f; private AnimationHandler 单位动画状态; private Vector3 上次左手位置; private Vector3 上次右手位置; private float 初始最大距离; private void Start() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) 单位动画状态 = ((Component)this).GetComponentInParent(); if (力度曲线 == null || 力度曲线.keys.Length == 0) { 力度曲线 = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 1f), new Keyframe(1f, 0f) }); } if (Object.op_Implicit((Object)(object)左手刚体)) { 上次左手位置 = 左手刚体.position; } if (Object.op_Implicit((Object)(object)右手刚体)) { 上次右手位置 = 右手刚体.position; } if (自动距离 && Object.op_Implicit((Object)(object)右手刚体) && Object.op_Implicit((Object)(object)躯干变换)) { 初始最大距离 = Vector3.Distance(右手刚体.position, 躯干变换.position) * 自动距离补偿; 最大距离 = 初始最大距离; } } private void FixedUpdate() { //IL_00ab: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0188: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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) //IL_017b: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: 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_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: 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) if (!Object.op_Implicit((Object)(object)单位动画状态) || (单位动画状态.currentState != 走路动画值 && 单位动画状态.currentState != 转弯动画值)) { return; } if (Object.op_Implicit((Object)(object)左手刚体) && Object.op_Implicit((Object)(object)躯干变换)) { Vector3 val2; if (指定向外方向) { Vector3 val = 躯干变换.TransformDirection(((Vector3)(ref 左手向外方向)).normalized); val2 = ((Vector3)(ref val)).normalized; } else { val2 = 计算向外方向(左手刚体.position, 躯干变换.position); } float num = 计算力度(左手刚体.position, 躯干变换.position); Vector3 val3 = val2 * num; 左手刚体.AddForce(val3, (ForceMode)0); Debug.DrawRay(左手刚体.position, ((Vector3)(ref val3)).normalized * num * 0.1f, Color.red); } if (Object.op_Implicit((Object)(object)右手刚体) && Object.op_Implicit((Object)(object)躯干变换)) { Vector3 val5; if (指定向外方向) { Vector3 val4 = 躯干变换.TransformDirection(((Vector3)(ref 右手向外方向)).normalized); val5 = ((Vector3)(ref val4)).normalized; } else { val5 = 计算向外方向(右手刚体.position, 躯干变换.position); } float num2 = 计算力度(右手刚体.position, 躯干变换.position); Vector3 val6 = val5 * num2; 右手刚体.AddForce(val6, (ForceMode)0); Debug.DrawRay(右手刚体.position, ((Vector3)(ref val6)).normalized * num2 * 0.1f, Color.green); } } private Vector3 计算向外方向(Vector3 手臂位置, Vector3 躯干位置) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_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_003a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = 手臂位置 - 躯干位置; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { return Vector3.right; } return ((Vector3)(ref val)).normalized; } private float 计算力度(Vector3 手臂位置, Vector3 躯干位置) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_0010: 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) Vector3 val = 手臂位置; val.y = 躯干位置.y; float num = Vector3.Distance(val, 躯干位置); if (num <= 最小距离) { return 最大力度; } if (num >= 最大距离) { return 0f; } float num2 = (num - 最小距离) / (最大距离 - 最小距离); float num3 = 1f - num2; num3 = 力度曲线.Evaluate(num3); return 最大力度 * num3; } public void 更新最大距离() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (自动距离 && Object.op_Implicit((Object)(object)右手刚体) && Object.op_Implicit((Object)(object)躯干变换)) { 最大距离 = Vector3.Distance(右手刚体.position, 躯干变换.position) * 自动距离补偿; } } public void 重置最大距离() { if (自动距离) { 最大距离 = 初始最大距离; } } public void 添加瞬时向外力(float 脉冲强度倍数 = 1.5f) { //IL_00ab: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00d5: 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_00eb: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_01a2: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)单位动画状态) || (单位动画状态.currentState != 走路动画值 && 单位动画状态.currentState != 转弯动画值)) { return; } if (Object.op_Implicit((Object)(object)左手刚体) && Object.op_Implicit((Object)(object)躯干变换)) { Vector3 val2; if (指定向外方向) { Vector3 val = 躯干变换.TransformDirection(((Vector3)(ref 左手向外方向)).normalized); val2 = ((Vector3)(ref val)).normalized; } else { val2 = 计算向外方向(左手刚体.position, 躯干变换.position); } float num = 计算力度(左手刚体.position, 躯干变换.position); 左手刚体.AddForce(val2 * num * 脉冲强度倍数, (ForceMode)1); } if (Object.op_Implicit((Object)(object)右手刚体) && Object.op_Implicit((Object)(object)躯干变换)) { Vector3 val4; if (指定向外方向) { Vector3 val3 = 躯干变换.TransformDirection(((Vector3)(ref 右手向外方向)).normalized); val4 = ((Vector3)(ref val3)).normalized; } else { val4 = 计算向外方向(右手刚体.position, 躯干变换.position); } float num2 = 计算力度(右手刚体.position, 躯干变换.position); 右手刚体.AddForce(val4 * num2 * 脉冲强度倍数, (ForceMode)1); } } private void OnDrawGizmosSelected() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)躯干变换)) { return; } Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(躯干变换.position, 最小距离); Gizmos.color = Color.red; Gizmos.DrawWireSphere(躯干变换.position, 最大距离); if (指定向外方向 && Object.op_Implicit((Object)(object)躯干变换)) { if (Object.op_Implicit((Object)(object)左手刚体)) { Gizmos.color = Color.cyan; Vector3 val = 躯干变换.TransformDirection(((Vector3)(ref 左手向外方向)).normalized); Gizmos.DrawRay(躯干变换.position, val * 最大距离); } if (Object.op_Implicit((Object)(object)右手刚体)) { Gizmos.color = Color.magenta; Vector3 val2 = 躯干变换.TransformDirection(((Vector3)(ref 右手向外方向)).normalized); Gizmos.DrawRay(躯干变换.position, val2 * 最大距离); } } } } public class 添加躯干力 : BatchedMonobehaviour { public Unit 这个单位; public DataHandler 单位数据; public Rigidbody 目标刚体; public float 力度乘数; public AnimationCurve 距离力度曲线; public Vector3 力度偏移; public float 最大生效距离 = 2f; public float 缩放补偿 = 0.9f; public bool 启用 = true; public bool 自动位置 = true; public float 自动距离补偿 = 1.3f; private Vector3 上次地面位置; private bool 记录变换 = true; private float 离地计时器 = 0f; private bool 已离地 = false; protected override void Start() { //IL_00cb: Unknown result type (might be due to invalid IL or missing references) ((BatchedMonobehaviour)this).Start(); if ((Object)(object)这个单位 == (Object)null) { 这个单位 = ((Component)((Component)this).transform.root).GetComponent(); } if ((Object)(object)单位数据 == (Object)null && (Object)(object)这个单位 != (Object)null && (Object)(object)这个单位.data != (Object)null) { 单位数据 = 这个单位.data; } if ((Object)(object)目标刚体 == (Object)null) { 目标刚体 = ((Component)this).GetComponent(); if ((Object)(object)目标刚体 == (Object)null) { 目标刚体 = ((Component)this).GetComponentInParent(); } } 最大生效距离 *= ((Component)this).transform.root.localScale.x * 缩放补偿; } public override void BatchedUpdate() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00bf: 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_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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_0183: Unknown result type (might be due to invalid IL or missing references) if (!启用 || !((Object)(object)单位数据 != (Object)null) || 单位数据.Dead) { return; } if (单位数据.isGrounded) { if (已离地) { 已离地 = false; } 离地计时器 = 0f; } else { 离地计时器 += Time.deltaTime; if (离地计时器 >= 1.1f) { 已离地 = true; } } if (!已离地) { Vector3 val = (上次地面位置 = 单位数据.groundPosition); Vector3 val2 = ((Component)目标刚体).transform.TransformPoint(力度偏移); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(目标刚体.position.x, val.y, 目标刚体.position.z); if (自动位置 && 记录变换) { 最大生效距离 = Vector3.Distance(val3, val2) * 自动距离补偿; 记录变换 = false; } float num = Vector3.Distance(val3, val2); if (num <= 最大生效距离) { float num2 = 距离力度曲线.Evaluate(num / 最大生效距离); float 力值 = 力度乘数 * num2; 向上添加力(力值, val2); } } } private void 向上添加力(float 力值, Vector3 力点) { //IL_0007: 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) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) 目标刚体.AddForceAtPosition(Vector3.up * 力值 * Time.deltaTime, 力点, (ForceMode)5); } private Vector3 获取地面位置(Vector3 测试位置, float 检测高度 = 10f, int 地面层级 = 512) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(测试位置.x, 测试位置.y + 检测高度, 测试位置.z); float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, 地面层级)) { return ((RaycastHit)(ref val2)).point; } return new Vector3(测试位置.x, 测试位置.y - 检测高度 * 0.5f, 测试位置.z); } private void OnDrawGizmosSelected() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0042: 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_0059: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00dc: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)目标刚体 != (Object)null && 启用) { Vector3 val = ((Component)目标刚体).transform.TransformPoint(力度偏移); Gizmos.color = Color.red; Gizmos.DrawWireSphere(val, 0.1f); Gizmos.color = Color.green; Vector3 val2 = val + Vector3.down * 最大生效距离; Gizmos.DrawLine(val, val2); Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(val2, 0.05f); if ((Object)(object)单位数据 != (Object)null && 单位数据.isGrounded) { Gizmos.color = new Color(0f, 1f, 0f, 0.2f); Vector3 groundPosition = 单位数据.groundPosition; Gizmos.DrawWireSphere(groundPosition, 最大生效距离); } } } } } namespace rwdseerfd.unity脚本存储文件夹.脚本1 { public class 单位掉血掉到1 : MonoBehaviour { public Unit 单位; private void Start() { 单位 = ((Component)this).GetComponentInParent(); } public void 造成伤害(float damage = 30f) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (单位.data.health > damage) { ((Damagable)单位.data.healthHandler).TakeDamage(damage * 0.5f, ((Component)this).transform.position, (Unit)null, (DamageType)0); } else if (!(单位.data.health <= 2f)) { 单位.data.health = 1f; } } } public class 向下施加力 : MonoBehaviour { public Rigidbody 武器刚体; public Transform 力点; private void Start() { if ((Object)(object)武器刚体 == (Object)null) { 武器刚体 = ((Component)this).GetComponent(); } } public void 向下施加一次力(float 力度) { //IL_0026: 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_004f: 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) if (Object.op_Implicit((Object)(object)武器刚体)) { Debug.Log((object)$"施加力: 力度={力度}, 力点位置={力点.position}"); float num = 力度 * 0.3f; 武器刚体.AddForceAtPosition(Vector3.down * num, 力点.position, (ForceMode)5); } } } public class 武器松手工具 : MonoBehaviour { public Rigidbody 武器刚体; private Unit 此单位; public Holdable 武器持有数据; private HoldingHandler 单位持有管理器; public bool 忽略不可解除武装 = false; private void Start() { if ((Object)(object)武器刚体 == (Object)null) { 武器刚体 = ((Component)this).GetComponent(); } if ((Object)(object)武器持有数据 == (Object)null) { 武器持有数据 = ((Component)this).GetComponent(); } 此单位 = ((Component)this).GetComponentInParent(); if ((Object)(object)此单位 != (Object)null) { 单位持有管理器 = 此单位.holdingHandler; } } public void 松开右手() { if (验证有效性() && (Object)(object)单位持有管理器.rightObject == (Object)(object)武器持有数据) { if (!忽略不可解除武装 && 武器持有数据.ignoreDissarm) { Debug.Log((object)"该武器不可解除武装,无法松开"); return; } 单位持有管理器.LetGoOfWeapon(((Component)武器持有数据).gameObject); Debug.Log((object)"右手武器已松开"); } } public void 松开左手() { if (验证有效性() && (Object)(object)单位持有管理器.leftObject == (Object)(object)武器持有数据) { if (!忽略不可解除武装 && 武器持有数据.ignoreDissarm) { Debug.Log((object)"该武器不可解除武装,无法松开"); return; } 单位持有管理器.LetGoOfWeapon(((Component)武器持有数据).gameObject); Debug.Log((object)"左手武器已松开"); } } public void 松开当前武器() { if (!验证有效性()) { return; } bool flag = (Object)(object)单位持有管理器.rightObject == (Object)(object)武器持有数据; bool flag2 = (Object)(object)单位持有管理器.leftObject == (Object)(object)武器持有数据; if (flag || flag2) { if (!忽略不可解除武装 && 武器持有数据.ignoreDissarm) { Debug.Log((object)"该武器不可解除武装,无法松开"); return; } 单位持有管理器.LetGoOfWeapon(((Component)武器持有数据).gameObject); Debug.Log((object)("武器已从 " + (flag ? "右手" : "") + " " + (flag2 ? "左手" : "") + " 松开")); } else { Debug.Log((object)"当前武器未被任何手持有"); } } public void 强制松开() { bool flag = 忽略不可解除武装; 忽略不可解除武装 = true; 松开当前武器(); 忽略不可解除武装 = flag; } public bool 是否被右手持有() { return (Object)(object)单位持有管理器 != (Object)null && (Object)(object)单位持有管理器.rightObject == (Object)(object)武器持有数据; } public bool 是否被左手持有() { return (Object)(object)单位持有管理器 != (Object)null && (Object)(object)单位持有管理器.leftObject == (Object)(object)武器持有数据; } public bool 是否被持有() { return 是否被右手持有() || 是否被左手持有(); } public void 右手抓取武器() { if (验证有效性()) { 单位持有管理器.GrabObject(武器持有数据, true, true, (Action)null); } } public void 左手抓取武器() { if (验证有效性()) { 单位持有管理器.GrabObject(武器持有数据, true, false, (Action)null); } } private bool 验证有效性() { if ((Object)(object)单位持有管理器 == (Object)null) { Debug.LogError((object)"无法找到HoldingHandler组件"); return false; } if ((Object)(object)武器持有数据 == (Object)null) { Debug.LogError((object)"无法找到Holdable组件"); return false; } return true; } } public class 添加向心力 : MonoBehaviour { public enum 旋转方向 { 顺时针, 逆时针 } [Serializable] private class WeaponForcePair { public Rigidbody 武器刚体; public Transform 施力点; public WeaponForcePair(Rigidbody rb, Transform fp) { 武器刚体 = rb; 施力点 = fp; } } public Unit 单位数据; private Transform 围绕点; public WeaponHandler 武器数据; private List 武器力点配对组 = new List(); public float 力度大小 = 1200f; public float 半径 = 5f; public float 最大速度 = 10f; public 旋转方向 旋转方向选择 = 旋转方向.逆时针; [Header("离心力设置")] public bool 启用离心力 = true; public float 离心力系数 = 3f; public AnimationCurve 离心力曲线 = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); private bool 开始施加力 = false; private int 方向系数 = -1; private void Start() { 单位数据 = ((Component)this).GetComponentInParent(); 武器数据 = 单位数据.data.weaponHandler; if (Object.op_Implicit((Object)(object)武器数据)) { 武器力点配对组.Clear(); if (Object.op_Implicit((Object)(object)武器数据.rightWeapon) && Object.op_Implicit((Object)(object)武器数据.rightWeapon.rigidbody)) { ForcePoint componentInChildren = ((Component)((Component)武器数据.rightWeapon).transform).GetComponentInChildren(); Transform val = ((componentInChildren != null) ? ((Component)componentInChildren).transform : null); if (Object.op_Implicit((Object)(object)val)) { 武器力点配对组.Add(new WeaponForcePair(武器数据.rightWeapon.rigidbody, val)); } else { 武器力点配对组.Add(new WeaponForcePair(武器数据.rightWeapon.rigidbody, ((Component)武器数据.rightWeapon).transform)); } } if (Object.op_Implicit((Object)(object)武器数据.leftWeapon) && Object.op_Implicit((Object)(object)武器数据.leftWeapon.rigidbody)) { ForcePoint componentInChildren2 = ((Component)((Component)武器数据.leftWeapon).transform).GetComponentInChildren(); Transform val2 = ((componentInChildren2 != null) ? ((Component)componentInChildren2).transform : null); if (Object.op_Implicit((Object)(object)val2)) { 武器力点配对组.Add(new WeaponForcePair(武器数据.leftWeapon.rigidbody, val2)); } else { 武器力点配对组.Add(new WeaponForcePair(武器数据.leftWeapon.rigidbody, ((Component)武器数据.leftWeapon).transform)); } } } 围绕点 = ((Component)单位数据.data.mainRig).transform; 更新方向系数(); } private void 更新方向系数() { 方向系数 = ((旋转方向选择 == 旋转方向.顺时针) ? 1 : (-1)); } public void 设置开启(bool d = true) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) 开始施加力 = d; if (d) { return; } foreach (WeaponForcePair item in 武器力点配对组) { if (Object.op_Implicit((Object)(object)item.武器刚体)) { item.武器刚体.velocity = Vector3.zero; } } } public void 设置为顺时针() { 旋转方向选择 = 旋转方向.顺时针; 更新方向系数(); } public void 设置为逆时针() { 旋转方向选择 = 旋转方向.逆时针; 更新方向系数(); } public void 切换旋转方向() { 旋转方向选择 = ((旋转方向选择 == 旋转方向.顺时针) ? 旋转方向.逆时针 : 旋转方向.顺时针); 更新方向系数(); } private void FixedUpdate() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: 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_01ac: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0227: 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_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //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_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) if (!开始施加力 || 武器力点配对组.Count == 0) { return; } if (方向系数 != ((旋转方向选择 == 旋转方向.顺时针) ? 1 : (-1))) { 更新方向系数(); } foreach (WeaponForcePair item in 武器力点配对组) { if (!Object.op_Implicit((Object)(object)item.武器刚体) || !Object.op_Implicit((Object)(object)item.施力点)) { continue; } Vector3 val = item.施力点.position - 围绕点.position; val.y = 0f; if (((Vector3)(ref val)).magnitude < 0.1f) { val = 围绕点.forward; } float magnitude = ((Vector3)(ref val)).magnitude; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 up = Vector3.up; Vector3 val2 = Vector3.Cross(up, normalized); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; normalized2 *= (float)方向系数; float num = Vector3.Dot(item.武器刚体.velocity, normalized2); float num2 = Mathf.Sqrt(力度大小 * magnitude / item.武器刚体.mass); num2 = Mathf.Clamp(num2, 0f, 最大速度); float num3 = num2 - num; Vector3 val3 = normalized2 * num3 * item.武器刚体.mass * 10f; Vector3 val4 = -normalized; float num4 = item.武器刚体.mass * num2 * num2 / magnitude; Vector3 val5 = val4 * num4; Vector3 val6 = Vector3.zero; if (启用离心力) { float num5 = num4 * 离心力系数; float num6 = Mathf.Clamp01(magnitude / 半径); float num7 = 离心力曲线.Evaluate(num6); num5 *= num7; val6 = normalized * num5; float num8 = Mathf.Abs(num) / num2; val6 *= Mathf.Lerp(0.5f, 1.5f, num8); } Vector3 val7 = (val3 + val5 + val6) * Time.deltaTime; item.武器刚体.AddForceAtPosition(val7, item.施力点.position, (ForceMode)5); if (Mathf.Abs(magnitude - 半径) > 0.1f) { float num9 = 100f; if (启用离心力 && magnitude < 半径) { num9 *= 0.3f; } Vector3 val8 = val4 * (magnitude - 半径) * num9 * Time.deltaTime; item.武器刚体.AddForceAtPosition(val8, item.施力点.position, (ForceMode)5); } Debug.DrawLine(围绕点.position, item.施力点.position, Color.green); Debug.DrawLine(item.施力点.position, item.武器刚体.position, Color.yellow); Color val9 = ((方向系数 > 0) ? Color.red : Color.blue); Debug.DrawRay(item.施力点.position, normalized2 * 2f, val9); if (启用离心力 && ((Vector3)(ref val6)).magnitude > 0.1f) { Debug.DrawRay(item.施力点.position, normalized * 2f, Color.white); } Debug.DrawRay(item.施力点.position, Vector3.up * 0.5f, Color.magenta); } } private void OnDrawGizmosSelected() { //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)围绕点)) { Gizmos.color = ((旋转方向选择 == 旋转方向.顺时针) ? Color.red : Color.blue); Gizmos.DrawWireSphere(围绕点.position, 半径); if (启用离心力) { Gizmos.color = new Color(1f, 1f, 1f, 0.3f); Gizmos.DrawWireSphere(围绕点.position, 半径 * 1.2f); } Vector3 val = 围绕点.position + Vector3.forward * 半径; Vector3 val2 = ((旋转方向选择 != 0) ? (围绕点.position - Vector3.right * 半径) : (围绕点.position + Vector3.right * 半径)); Gizmos.DrawLine(val, val2); } if (武器力点配对组 == null) { return; } Gizmos.color = Color.magenta; foreach (WeaponForcePair item in 武器力点配对组) { if (Object.op_Implicit((Object)(object)item.施力点)) { Gizmos.DrawSphere(item.施力点.position, 0.1f); if (启用离心力) { Gizmos.color = Color.white; Vector3 val3 = item.施力点.position - 围绕点.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; Gizmos.DrawRay(item.施力点.position, normalized * 1f); } } } } private void OnValidate() { 更新方向系数(); } } public class 效果添加器121 : MonoBehaviour { public enum 检测方式 { 物体, 单位 } public UnitEffectBase 效果设置; public float 检测半径 = 6f; public LayerMask 检测层; private Team 队伍信息; public 检测方式 sss = 检测方式.单位; private void Start() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (sss == 检测方式.单位) { 队伍信息 = ((Component)this).GetComponentInParent().data.team; } if (sss == 检测方式.物体) { 队伍信息 = ((Component)this).GetComponentInParent().team; } } public void 开始检测() { //IL_0012: 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_0086: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"开始检测OO"); Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 检测半径, LayerMask.op_Implicit(检测层)); if (array.Length == 0) { return; } Debug.Log((object)"开始检测OqqqqO"); for (int i = 0; i < array.Length; i++) { Unit componentInParent = ((Component)array[i]).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null) && !componentInParent.data.Dead && componentInParent.data.team != 队伍信息) { UnitEffectBase val = UnitEffectBase.AddEffectToTarget(((Component)((Component)array[i]).transform).gameObject, 效果设置); if ((Object)(object)val == (Object)null) { val = Object.Instantiate(效果设置, ((Component)array[i]).transform); ((Component)val).transform.SetPositionAndRotation(((Component)array[i]).transform.root.position, Quaternion.identity); TeamHolder.AddTeamHolder(((Component)val).gameObject, ((Component)this).gameObject); val.DoEffect(); } else { val.Ping(); } } } } private void OnDrawGizmos() { //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) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = new Color(0f, 1f, 0f, 0.3f); Gizmos.DrawSphere(((Component)this).transform.position, 检测半径); Gizmos.color = Color.green; Gizmos.DrawWireSphere(((Component)this).transform.position, 检测半径); } } internal class 禁用技能方法 { } } namespace rwdseerfd.unity脚本存储文件夹.穆萨罗.旋风斩 { public class 图腾缩放动画 : MonoBehaviour { [CompilerGenerated] private sealed class <缩放动画协程>d__9 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 图腾缩放动画 <>4__this; private float <已用时间>5__1; private float <进度>5__2; private float <曲线值>5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <缩放动画协程>d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0097: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.正在播放 = true; <已用时间>5__1 = 0f; break; case 1: <>1__state = -1; break; } if (<已用时间>5__1 < <>4__this.动画时长) { <已用时间>5__1 += Time.deltaTime; <进度>5__2 = <已用时间>5__1 / <>4__this.动画时长; <曲线值>5__3 = <>4__this.缩放曲线.Evaluate(<进度>5__2); <>4__this.缩放对象.localScale = <>4__this.原始缩放 * <曲线值>5__3; <>2__current = null; <>1__state = 1; return true; } <>4__this.正在播放 = false; <>4__this.当前动画协程 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("缩放参数")] public Transform 缩放对象; public AnimationCurve 缩放曲线 = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); public float 动画时长 = 1f; [Header("当前状态")] [SerializeField] private bool 正在播放 = false; private Coroutine 当前动画协程 = null; private Vector3 原始缩放; private void Start() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)缩放对象 == (Object)null) { 缩放对象 = ((Component)this).transform; } 原始缩放 = 缩放对象.localScale; } public void 播放缩放动画() { if ((Object)(object)缩放对象 == (Object)null) { Debug.LogError((object)"图腾缩放动画: 缩放对象未设置!"); return; } if (正在播放 && 当前动画协程 != null) { 恢复缩放原始值(); ((MonoBehaviour)this).StopCoroutine(当前动画协程); 当前动画协程 = null; } 当前动画协程 = ((MonoBehaviour)this).StartCoroutine(缩放动画协程()); } public void 恢复缩放原始值() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) 缩放对象.localScale = 原始缩放; } [IteratorStateMachine(typeof(<缩放动画协程>d__9))] private IEnumerator 缩放动画协程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <缩放动画协程>d__9(0) { <>4__this = this }; } } public class 指定时间加攻速效果 : UnitEffectBase { [Header("增益设置")] [Tooltip("要增加的基础攻击速度值")] public float attackSpeedBonus = 0.5f; [Tooltip("增益持续时间(秒)")] public float duration = 5f; [Header("效果事件")] public UnityEvent onBuffActivated; public UnityEvent onBuffExpired; [Header("调试信息")] public bool showDebugLogs = false; [SerializeField] private float remainingTime = 0f; [SerializeField] private bool isActive = false; [SerializeField] private float originalAttackSpeed = 1f; private Unit unit; private bool isInitialized = false; private void Initialize() { if (isInitialized) { return; } unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); if ((Object)(object)unit != (Object)null) { originalAttackSpeed = unit.attackSpeedMultiplier; isInitialized = true; if (showDebugLogs) { Debug.Log((object)$"[TimedAttackSpeedBuff] 初始化完成 | 单位: {((Object)unit).name} | 原始攻速: {originalAttackSpeed}"); } } else { Debug.LogWarning((object)"[TimedAttackSpeedBuff] 警告: 未找到Unit组件!"); } } public override void DoEffect() { ActivateBuff(); } public override void Ping() { ActivateBuff(); } public void ActivateBuff() { Initialize(); if (!((Object)(object)unit == (Object)null)) { if (isActive) { ResetBuff(); } unit.AddAttackSpeed(attackSpeedBonus); remainingTime = duration; isActive = true; UnityEvent obj = onBuffActivated; if (obj != null) { obj.Invoke(); } if (showDebugLogs) { Debug.Log((object)("[TimedAttackSpeedBuff] 增益激活 | " + $"持续时间: {duration}s | " + $"增益值: {attackSpeedBonus} | " + $"当前攻速: {unit.attackSpeedMultiplier}")); } } } private void ResetBuff() { if ((Object)(object)unit != (Object)null) { unit.AddAttackSpeed(0f - attackSpeedBonus); if (showDebugLogs) { Debug.Log((object)("[TimedAttackSpeedBuff] 增益重置 | " + $"恢复攻速: {originalAttackSpeed}")); } } isActive = false; remainingTime = 0f; } public void ForceEndBuff() { if (isActive) { ResetBuff(); UnityEvent obj = onBuffExpired; if (obj != null) { obj.Invoke(); } } } private void Update() { if (!isActive || (Object)(object)unit == (Object)null) { return; } remainingTime -= Time.deltaTime; if (remainingTime <= 0f) { ResetBuff(); UnityEvent obj = onBuffExpired; if (obj != null) { obj.Invoke(); } if (showDebugLogs) { Debug.Log((object)"[TimedAttackSpeedBuff] 增益时间结束,已重置"); } } } private void OnDisable() { if (isActive) { ResetBuff(); } } private void OnDestroy() { if (isActive) { ResetBuff(); } } public string GetStatusInfo() { if (!isActive) { return "未激活"; } return $"攻击速度增益: +{attackSpeedBonus:F1}\n" + $"剩余时间: {remainingTime:F1}秒"; } public bool IsBuffActive() { return isActive; } public float GetRemainingTime() { return remainingTime; } public float GetCurrentBonus() { return isActive ? attackSpeedBonus : 0f; } } public class 增伤效果sss : MonoBehaviour { [CompilerGenerated] private sealed class <增伤协程>d__19 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float 持续时间参数; public 增伤效果sss <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <增伤协程>d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.isDamageBoostActive = true; Debug.Log((object)$"开始增伤,倍率: {<>4__this.伤害倍率},持续时间: {持续时间参数}秒"); <>4__this.设置武器伤害倍率(<>4__this.伤害倍率); <>2__current = (object)new WaitForSeconds(持续时间参数); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.恢复武器原始伤害(); <>4__this.isDamageBoostActive = false; Debug.Log((object)"增伤效果结束"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Unit unit; private Coroutine currentCoroutine; private bool isDamageBoostActive = false; [Header("增伤配置")] [SerializeField] private float 伤害倍率 = 3f; [SerializeField] private float 持续时间 = 5f; [SerializeField] private bool 在开始时执行 = false; public bool 可打断 = false; private WeaponHandler 武器数据; private float 原始伤害值左手 = 1f; private float 原始伤害值右手 = 1f; private Weapon 左手武器; private Weapon 右手武器; private CollisionWeapon[] 所以碰撞武器; private Dictionary 碰撞类武器原始伤害值 = new Dictionary(); private void Start() { 初始化组件(); if (在开始时执行) { 开始增伤(持续时间); } } private void 初始化组件() { try { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); if ((Object)(object)unit == (Object)null) { Debug.LogError((object)("在 " + ((Object)((Component)this).gameObject).name + " 上未找到 Unit 组件!")); return; } 武器数据 = ((Component)unit).GetComponentInChildren(); if ((Object)(object)武器数据 == (Object)null) { Debug.LogError((object)("在 " + ((Object)((Component)unit).gameObject).name + " 上未找到 WeaponHandler 组件!")); } 缓存原始伤害值(); 所以碰撞武器 = ((Component)unit).GetComponentsInChildren(); CollisionWeapon[] array = 所以碰撞武器; Debug.Log((object)$"找到{((array != null) ? array.Length : 0)}个碰撞武器"); 缓存碰撞类武器伤害值(); } catch (Exception ex) { Debug.LogError((object)("初始化增伤效果时出错: " + ex.Message)); } } private void 缓存原始伤害值() { if ((Object)(object)武器数据 == (Object)null) { Debug.LogWarning((object)"未获取武器数据!!"); return; } if ((Object)(object)武器数据.rightWeapon != (Object)null) { 原始伤害值右手 = 武器数据.rightWeapon.levelMultiplier; Debug.Log((object)"已获取右手武器初始伤害乘数"); 右手武器 = 武器数据.rightWeapon; } if ((Object)(object)武器数据.leftWeapon != (Object)null) { 原始伤害值左手 = 武器数据.leftWeapon.levelMultiplier; Debug.Log((object)"已获取左手武器初始伤害乘数"); 左手武器 = 武器数据.leftWeapon; } if ((Object)(object)武器数据.leftWeapon == (Object)null && (Object)(object)武器数据.rightWeapon == (Object)null) { Debug.LogWarning((object)"未获取武器,请确保持有武器"); } } private void 缓存碰撞类武器伤害值() { 碰撞类武器原始伤害值.Clear(); if (所以碰撞武器 == null || 所以碰撞武器.Length == 0) { return; } for (int i = 0; i < 所以碰撞武器.Length; i++) { if ((Object)(object)所以碰撞武器[i] != (Object)null) { 碰撞类武器原始伤害值[所以碰撞武器[i]] = 所以碰撞武器[i].damage; } } } public void 开始增伤(float 持续时间参数) { if ((Object)(object)武器数据 == (Object)null) { Debug.LogError((object)"武器数据未初始化,无法开始增伤!"); return; } if (isDamageBoostActive) { if (!可打断) { Debug.Log((object)"增伤效果已激活且不可打断"); return; } Debug.Log((object)"增伤效果已激活,正在重新启动..."); 停止增伤(); } if (currentCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(currentCoroutine); currentCoroutine = null; } currentCoroutine = ((MonoBehaviour)this).StartCoroutine(增伤协程(持续时间参数)); } [IteratorStateMachine(typeof(<增伤协程>d__19))] private IEnumerator 增伤协程(float 持续时间参数) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <增伤协程>d__19(0) { <>4__this = this, 持续时间参数 = 持续时间参数 }; } private void 设置武器伤害倍率(float 倍率) { if ((Object)(object)武器数据 == (Object)null) { Debug.LogError((object)"武器数据为空,无法设置伤害倍率!"); return; } bool flag = false; if ((Object)(object)武器数据.leftWeapon != (Object)null) { if ((Object)(object)左手武器 != (Object)null) { 左手武器.levelMultiplier = 倍率; flag = true; } else { Debug.LogWarning((object)"左手武器引用丢失,尝试重新获取"); 左手武器 = 武器数据.leftWeapon; if ((Object)(object)左手武器 != (Object)null) { 左手武器.levelMultiplier = 倍率; flag = true; } } } if ((Object)(object)武器数据.rightWeapon != (Object)null) { if ((Object)(object)右手武器 != (Object)null) { 右手武器.levelMultiplier = 倍率; flag = true; } else { Debug.LogWarning((object)"右手武器引用丢失,尝试重新获取"); 右手武器 = 武器数据.rightWeapon; if ((Object)(object)右手武器 != (Object)null) { 右手武器.levelMultiplier = 倍率; flag = true; } } } if (所以碰撞武器 == null || 所以碰撞武器.Length == 0) { Unit obj = unit; 所以碰撞武器 = ((obj != null) ? ((Component)obj).GetComponentsInChildren() : null); if (所以碰撞武器 == null || 所以碰撞武器.Length == 0) { Debug.LogWarning((object)"没有找到碰撞武器数据"); return; } } int num = 0; for (int i = 0; i < 所以碰撞武器.Length; i++) { if ((Object)(object)所以碰撞武器[i] != (Object)null) { if (!碰撞类武器原始伤害值.ContainsKey(所以碰撞武器[i])) { 碰撞类武器原始伤害值[所以碰撞武器[i]] = 所以碰撞武器[i].damage; } 所以碰撞武器[i].damage = 碰撞类武器原始伤害值[所以碰撞武器[i]] * 倍率; num++; } } if (num > 0 || flag) { Debug.Log((object)$"成功设置增伤效果,倍率: {倍率},影响的碰撞武器数量: {num}"); } else { Debug.LogWarning((object)"没有成功设置任何武器的增伤效果"); } } private void 恢复武器原始伤害() { if ((Object)(object)武器数据 == (Object)null) { Debug.LogWarning((object)"武器数据为空,无法恢复原始伤害"); return; } if ((Object)(object)武器数据.leftWeapon != (Object)null && (Object)(object)左手武器 != (Object)null) { 左手武器.levelMultiplier = 原始伤害值左手; } if ((Object)(object)武器数据.rightWeapon != (Object)null && (Object)(object)右手武器 != (Object)null) { 右手武器.levelMultiplier = 原始伤害值右手; } if (所以碰撞武器 == null || 所以碰撞武器.Length == 0) { return; } int num = 0; for (int i = 0; i < 所以碰撞武器.Length; i++) { if ((Object)(object)所以碰撞武器[i] != (Object)null && 碰撞类武器原始伤害值.ContainsKey(所以碰撞武器[i])) { 所以碰撞武器[i].damage = 碰撞类武器原始伤害值[所以碰撞武器[i]]; num++; } } if (num > 0) { Debug.Log((object)$"成功恢复原始伤害,恢复的碰撞武器数量: {num}"); } } public void 停止增伤() { if (currentCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(currentCoroutine); currentCoroutine = null; } 恢复武器原始伤害(); isDamageBoostActive = false; Debug.Log((object)"增伤效果已强制停止"); } public void 立即开始增伤() { 开始增伤(持续时间); } public void 设置增伤参数(float 新倍率, float 新持续时间) { 伤害倍率 = 新倍率; 持续时间 = 新持续时间; } public bool 是否正在增伤() { return isDamageBoostActive; } private void OnDestroy() { 停止增伤(); } private void OnDisable() { 停止增伤(); } public void 刷新组件引用() { 初始化组件(); } } public class 碰撞检测并添加效果 : MonoBehaviour { public enum 施加方式 { 对敌方, 全部, 对自己和对于, 仅自己 } public enum 检测方式 { 物体, 单位 } public UnitEffectBase 效果设置; public float 检测半径 = 6f; public LayerMask 检测层; public 施加方式 效果施加对应 = 施加方式.对敌方; private Team 队伍信息; public 检测方式 sss = 检测方式.单位; private void Start() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (sss == 检测方式.单位) { 队伍信息 = ((Component)this).GetComponentInParent().data.team; } if (sss == 检测方式.物体) { 队伍信息 = ((Component)this).GetComponentInParent().team; } } public void 开始检测() { //IL_0007: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 检测半径, LayerMask.op_Implicit(检测层)); if (array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { Unit componentInParent = ((Component)array[i]).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || componentInParent.data.Dead) { continue; } bool flag = false; switch (效果施加对应) { case 施加方式.对敌方: flag = componentInParent.data.team != 队伍信息; break; case 施加方式.全部: flag = true; break; case 施加方式.对自己和对于: flag = componentInParent.data.team == 队伍信息; break; case 施加方式.仅自己: { Unit componentInParent2 = ((Component)this).GetComponentInParent(); flag = (Object)(object)componentInParent == (Object)(object)componentInParent2; break; } } if (flag) { UnitEffectBase val = UnitEffectBase.AddEffectToTarget(((Component)((Component)array[i]).transform).gameObject, 效果设置); if ((Object)(object)val == (Object)null) { val = Object.Instantiate(效果设置, ((Component)array[i]).transform); ((Component)val).transform.SetPositionAndRotation(((Component)array[i]).transform.position, Quaternion.identity); TeamHolder.AddTeamHolder(((Component)val).gameObject, ((Component)this).gameObject); val.DoEffect(); } else { val.Ping(); } } } } private void OnDrawGizmos() { //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) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = new Color(0f, 1f, 0f, 0.3f); Gizmos.DrawSphere(((Component)this).transform.position, 检测半径); Gizmos.color = Color.green; Gizmos.DrawWireSphere(((Component)this).transform.position, 检测半径); } } public class 射线检测地面生成 : MonoBehaviour { public Vector3 获取地面位置(float 检测高度 = 10f) { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_0019: 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_0027: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Vector3 val = position + Vector3.up * 检测高度; float num = 检测高度 * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, num, 512)) { return ((RaycastHit)(ref val2)).point; } return ((Component)this).transform.position; } public void 生成预制体(GameObject 预制体) { //IL_0018: 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) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)预制体 != (Object)null) { Quaternion val = Quaternion.Euler(0f, ((Component)this).transform.eulerAngles.y, 0f); TeamHolder.AddTeamHolder(Object.Instantiate(预制体, 获取地面位置(), val), ((Component)this).gameObject); } } } public class 单位设置工具 : MonoBehaviour { [SerializeField] private Vector3 相对偏移 = new Vector3(0f, 30f, 0f); private List 所有单位物体列表 = new List(); private Transform 主躯干; private Unit 此单位; private List 所有启用的网格渲染器 = new List(); private List 所有启用的蒙皮渲染器 = new List(); private List 所有单位刚体 = new List(); private bool 是否已初始化 = false; private void Start() { 初始化数据(); } private void 初始化数据() { 此单位 = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)此单位 == (Object)null) { Debug.LogError((object)"未找到Unit组件!"); return; } DataHandler data = 此单位.data; if ((Object)(object)data == (Object)null) { Debug.LogError((object)"DataHandler为空!"); return; } for (int i = 0; i < ((Component)data).transform.childCount; i++) { Transform child = ((Component)data).transform.GetChild(i); 所有单位物体列表.Add(child); } WeaponHandler component = ((Component)data).GetComponent(); if ((Object)(object)component != (Object)null) { if ((Object)(object)component.rightWeapon != (Object)null) { 所有单位物体列表.Add(((Component)component.rightWeapon).transform); } if ((Object)(object)component.leftWeapon != (Object)null) { 所有单位物体列表.Add(((Component)component.leftWeapon).transform); } } if ((Object)(object)data.mainRig != (Object)null) { 主躯干 = ((Component)data.mainRig).transform; } else { Debug.LogWarning((object)"主躯干未设置!"); } 所有单位刚体 = new List(((Component)((Component)this).transform.root).GetComponentsInChildren()); 获取已启用的网格渲染器(); 是否已初始化 = true; } public void 移动单位物体置主物体相对偏移() { //IL_0045: 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_004f: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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) if (!是否已初始化 || (Object)(object)主躯干 == (Object)null) { Debug.LogWarning((object)"未初始化或主躯干为空,无法移动"); } else if (所有单位物体列表.Count != 0) { Vector3 val = 主躯干.TransformPoint(相对偏移); Vector3 偏移量 = val - 主躯干.position; 移动所有物体到偏移量(偏移量); } } public void 移动单位物体置主物体指定偏移(Vector3 目标位置) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!是否已初始化 || (Object)(object)主躯干 == (Object)null) { Debug.LogWarning((object)"未初始化或主躯干为空,无法移动"); } else if (所有单位物体列表.Count != 0) { Vector3 偏移量 = 目标位置 - 主躯干.position; 移动所有物体到偏移量(偏移量); } } public void 设置所有刚体的动力学(bool 是否为运动学 = false) { if (所有单位刚体 == null || 所有单位刚体.Count == 0) { return; } for (int i = 0; i < 所有单位刚体.Count; i++) { if ((Object)(object)所有单位刚体[i] != (Object)null) { 所有单位刚体[i].isKinematic = 是否为运动学; } } } public void 设置所有网格渲染器(bool 是否启用 = false) { if (所有启用的网格渲染器 == null || 所有启用的网格渲染器.Count == 0 || 所有启用的蒙皮渲染器 == null || 所有启用的蒙皮渲染器.Count == 0) { return; } for (int i = 0; i < 所有启用的网格渲染器.Count; i++) { if ((Object)(object)所有启用的网格渲染器[i] != (Object)null) { ((Renderer)所有启用的网格渲染器[i]).enabled = 是否启用; } } for (int j = 0; j < 所有启用的蒙皮渲染器.Count; j++) { if ((Object)(object)所有启用的蒙皮渲染器[j] != (Object)null) { ((Renderer)所有启用的蒙皮渲染器[j]).enabled = 是否启用; } } } private void 获取已启用的网格渲染器() { MeshRenderer[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren(); 所有启用的网格渲染器.Clear(); for (int i = 0; i < componentsInChildren.Length; i++) { if ((Object)(object)componentsInChildren[i] != (Object)null && ((Renderer)componentsInChildren[i]).enabled) { 所有启用的网格渲染器.Add(componentsInChildren[i]); } } SkinnedMeshRenderer[] componentsInChildren2 = ((Component)((Component)this).transform.root).GetComponentsInChildren(); 所有启用的蒙皮渲染器.Clear(); for (int j = 0; j < componentsInChildren2.Length; j++) { if ((Object)(object)componentsInChildren2[j] != (Object)null && ((Renderer)componentsInChildren2[j]).enabled) { 所有启用的蒙皮渲染器.Add(componentsInChildren2[j]); } } } private void 移动所有物体到偏移量(Vector3 偏移量) { //IL_0048: 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_004e: Unknown result type (might be due to invalid IL or missing references) if (所有单位物体列表 == null || 所有单位物体列表.Count == 0) { return; } for (int i = 0; i < 所有单位物体列表.Count; i++) { if ((Object)(object)所有单位物体列表[i] != (Object)null) { Transform obj = 所有单位物体列表[i]; obj.position += 偏移量; } } } public void 重置所有物体位置() { 移动单位物体置主物体相对偏移(); } } public class 动画播放器 : MonoBehaviour { [Header("动画组件")] [SerializeField] private Animator animator; [Header("动画名称")] [SerializeField] private string currentAnimationName; private string lastPlayedAnimation = ""; private void Awake() { if ((Object)(object)animator == (Object)null) { animator = ((Component)this).GetComponent(); } } public void PlayAnimation(string animationName) { if (string.IsNullOrEmpty(animationName)) { Debug.LogWarning((object)"动画播放器: 动画名称为空!"); return; } if ((Object)(object)animator != (Object)null) { PlayWithAnimator(animationName, 0f); } else { Debug.LogError((object)"动画播放器: 没有可用的动画组件!"); } currentAnimationName = animationName; } private void PlayWithAnimator(string animationName, float normalizedTime) { if (lastPlayedAnimation == animationName || normalizedTime == 0f) { animator.Play(animationName, 0, normalizedTime); } else if (normalizedTime >= 0f) { animator.Play(animationName, 0, normalizedTime); } else { animator.Play(animationName); } lastPlayedAnimation = animationName; } } internal class 穆萨罗旋风斩 : MonoBehaviour { public GameObject 召唤龙卷风; private Transform 旋风变换; public bool 启动 = false; private void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (启动 && Object.op_Implicit((Object)(object)旋风变换)) { 旋风变换.position = ((Component)this).transform.position; } } public void 召唤旋风() { //IL_000e: 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) 旋风变换 = Object.Instantiate(召唤龙卷风, ((Component)this).transform.position, Quaternion.identity).transform; 旋风变换.SetParent(((Component)this).transform.root); } public void 设置启动(bool g = true) { 启动 = g; } } internal class 穆萨罗旋风斩移动冲刺 : MonoBehaviour { public float 冲刺力度 = 1200f; public float 旋转速度 = 500f; public bool 启动 = false; private List 全部刚体; private Rigidbody 主要刚体; private Unit 此单位; private Vector3 冲刺方向; private RotationHandler 旋转管理器; private void Start() { 旋转管理器 = ((Component)((Component)this).transform.root).GetComponentInChildren(); 此单位 = ((Component)((Component)this).transform.root).GetComponent(); 全部刚体 = 此单位.data.allRigs.AllRigs.ToList(); 主要刚体 = 此单位.data.mainRig; 全部刚体.RemoveAll((Rigidbody rb) => (Object)(object)rb == (Object)(object)主要刚体); } private void Update() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_00b9: 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) if (!启动 || !Object.op_Implicit((Object)(object)此单位.data.targetData)) { return; } Vector3 position = 此单位.data.targetData.mainRig.position; Vector3 val = position - ((Component)this).transform.position; 冲刺方向 = ((Vector3)(ref val)).normalized; for (int i = 0; i < 全部刚体.Count; i++) { Rigidbody val2 = 全部刚体[i]; if (!((Object)(object)val2 == (Object)null) && 冲刺方向 != Vector3.zero) { val2.AddForce(冲刺方向 * 冲刺力度 * Time.deltaTime, (ForceMode)5); } } if (冲刺方向 != Vector3.zero) { 主要刚体.AddForce(冲刺方向 * 冲刺力度 * Time.deltaTime, (ForceMode)5); 主要刚体.AddTorque(Vector3.up * 旋转速度 * Time.deltaTime, (ForceMode)5); } } public void 开始旋转前进() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0033: 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) Vector3 position = 此单位.data.targetData.mainRig.position; Vector3 position2 = ((Component)this).transform.position; Vector3 val = position - position2; 冲刺方向 = ((Vector3)(ref val)).normalized; } public void 设置启动(bool g = true) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) 启动 = g; if (!启动) { 冲刺方向 = Vector3.zero; if (Object.op_Implicit((Object)(object)旋转管理器)) { 旋转管理器.rotationMultiplier = 1f; } 清除刚体动能(); } else if (Object.op_Implicit((Object)(object)旋转管理器)) { 旋转管理器.rotationMultiplier = 0f; } } public void 清除刚体动能() { //IL_0021: 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_0067: 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) for (int i = 0; i < 全部刚体.Count; i++) { Rigidbody val = 全部刚体[i]; if (!((Object)(object)val == (Object)null)) { val.velocity = Vector3.zero; val.angularVelocity = Vector3.zero; } } if (Object.op_Implicit((Object)(object)主要刚体)) { 主要刚体.velocity = Vector3.zero; 主要刚体.angularVelocity = Vector3.zero; } } } internal class 龙卷风吸引 : MonoBehaviour { [Header("龙卷风参数")] public bool 启动 = false; public LayerMask 受影响层 = LayerMask.op_Implicit(-1); public float 吸引强度 = 10f; public float 切线强度 = 15f; public float 最大距离 = 10f; public bool 使用距离衰减 = true; public AnimationCurve 力度曲线 = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); private Collider _triggerCollider; private List _rigidbodies = new List(); private Unit 当前单位; private Team 当前队伍; private void Awake() { _triggerCollider = ((Component)this).GetComponent(); if ((Object)(object)_triggerCollider == (Object)null) { Debug.LogError((object)"龙卷风吸引:需要 Collider 组件并勾选 Is Trigger"); ((Behaviour)this).enabled = false; } else if (!_triggerCollider.isTrigger) { Debug.LogWarning((object)"龙卷风吸引:Collider 未设置为触发器,已自动设为触发器"); _triggerCollider.isTrigger = true; } } private void Start() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) 当前单位 = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)当前单位 == (Object)null) { TeamHolder componentInParent = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent)) { 当前队伍 = ((Component)this).GetComponentInParent().team; } else { 当前队伍 = (Team)0; } } else { 当前队伍 = 当前单位.data.team; } } private void Update() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_00df: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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) if (!启动) { return; } for (int num = _rigidbodies.Count - 1; num >= 0; num--) { Rigidbody val = _rigidbodies[num]; if ((Object)(object)val == (Object)null) { _rigidbodies.RemoveAt(num); } else { Vector3 val2 = ((Component)this).transform.position - val.position; float magnitude = ((Vector3)(ref val2)).magnitude; if (!(magnitude > 最大距离)) { float num2 = 1f; if (使用距离衰减 && 最大距离 > 0f) { float num3 = Mathf.Clamp01(magnitude / 最大距离); num2 = 力度曲线.Evaluate(num3); } Vector3 val3 = ((Vector3)(ref val2)).normalized * (吸引强度 * num2); Vector3 val4 = Vector3.Cross(Vector3.up, ((Vector3)(ref val2)).normalized); Vector3 val5 = val4 * (切线强度 * num2); Vector3 val6 = val3 + val5; val.AddForce(val6 * Time.deltaTime, (ForceMode)5); } } } } private void OnTriggerEnter(Collider other) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (!启动 || ((1 << ((Component)other).gameObject.layer) & LayerMask.op_Implicit(受影响层)) == 0) { return; } Unit component = ((Component)((Component)other).transform.root).GetComponent(); if ((Object)(object)component != (Object)null && component.data.team != 当前队伍 && !component.data.Dead) { Rigidbody mainRig = component.data.mainRig; if ((Object)(object)mainRig != (Object)null && !_rigidbodies.Contains(mainRig)) { _rigidbodies.Add(mainRig); } } } private void OnTriggerExit(Collider other) { //IL_0021: 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) Unit component = ((Component)((Component)other).transform.root).GetComponent(); if ((Object)(object)component != (Object)null && component.data.team != 当前队伍 && !component.data.Dead) { Rigidbody mainRig = component.data.mainRig; if ((Object)(object)mainRig != (Object)null && _rigidbodies.Contains(mainRig)) { _rigidbodies.Remove(mainRig); } } } public void 设置启动(bool g = true) { 启动 = g; 启动时检测内部(); if (!启动) { 清除刚体列表(); } } private void 启动时检测内部() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 最大距离 + 2f, LayerMask.op_Implicit(受影响层)); if (array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { Unit component = ((Component)((Component)array[i]).transform.root).GetComponent(); if ((Object)(object)component != (Object)null && component.data.team != 当前队伍 && !component.data.Dead) { Rigidbody mainRig = component.data.mainRig; if ((Object)(object)mainRig != (Object)null && !_rigidbodies.Contains(mainRig)) { _rigidbodies.Add(mainRig); } } } } public void 清除刚体列表() { _rigidbodies.Clear(); } public void 停止并清除() { 启动 = false; 清除刚体列表(); } public int 获取影响物体数量() { 清理无效刚体(); return _rigidbodies.Count; } private void 清理无效刚体() { for (int num = _rigidbodies.Count - 1; num >= 0; num--) { if ((Object)(object)_rigidbodies[num] == (Object)null) { _rigidbodies.RemoveAt(num); } } } private void OnDrawGizmosSelected() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_triggerCollider == (Object)null) { _triggerCollider = ((Component)this).GetComponent(); } Gizmos.color = Color.cyan; Collider triggerCollider = _triggerCollider; SphereCollider val = (SphereCollider)(object)((triggerCollider is SphereCollider) ? triggerCollider : null); if (val != null) { Gizmos.DrawWireSphere(((Component)this).transform.position, val.radius); } else { Collider triggerCollider2 = _triggerCollider; BoxCollider val2 = (BoxCollider)(object)((triggerCollider2 is BoxCollider) ? triggerCollider2 : null); if (val2 != null) { Gizmos.DrawWireCube(((Component)this).transform.position, val2.size); } else { Gizmos.DrawWireSphere(((Component)this).transform.position, 最大距离); } } Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, 最大距离); } private void OnDisable() { if (启动) { } } private void OnDestroy() { 清除刚体列表(); } } internal class 联动图腾释放组件 : MonoBehaviour { [CompilerGenerated] private sealed class <暂停恢复>d__10 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float 阻止时间; public 联动图腾释放组件 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <暂停恢复>d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(阻止时间); <>1__state = 1; return true; case 1: <>1__state = -1; Debug.Log((object)"阻止完成!"); <>4__this.是否暂停 = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <释放携程>d__11 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public 联动图腾释放组件 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <释放携程>d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (<>4__this.已等待时间 < <>4__this.等待时间) { if (!<>4__this.是否暂停) { <>4__this.已等待时间 += Time.deltaTime; } <>2__current = null; <>1__state = 1; return true; } UnityEvent 释放事件 = <>4__this.释放事件; if (释放事件 != null) { 释放事件.Invoke(); } <>4__this.正在携程 = null; <>4__this.正在释放 = false; <>4__this.已等待时间 = 0f; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public UnityEvent 释放事件; public float 等待时间 = 2f; private bool 正在释放 = false; private Coroutine 正在携程; private float 初始等待时间; private float 已等待时间 = 0f; private bool 是否暂停 = false; private void Start() { 初始等待时间 = 等待时间; } public void 释放图腾(float 时间 = 2f) { 等待时间 = 时间; 初始等待时间 = 时间; 已等待时间 = 0f; if (正在携程 != null) { ((MonoBehaviour)this).StopCoroutine(正在携程); } 正在携程 = ((MonoBehaviour)this).StartCoroutine(释放携程()); 正在释放 = true; } public void 阻止释放(float 阻止时间 = 5f) { if (!是否暂停) { Debug.Log((object)"开始阻止释放!"); 是否暂停 = true; ((MonoBehaviour)this).StartCoroutine(暂停恢复(阻止时间)); } } [IteratorStateMachine(typeof(<暂停恢复>d__10))] private IEnumerator 暂停恢复(float 阻止时间) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <暂停恢复>d__10(0) { <>4__this = this, 阻止时间 = 阻止时间 }; } [IteratorStateMachine(typeof(<释放携程>d__11))] private IEnumerator 释放携程() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <释放携程>d__11(0) { <>4__this = this }; } } internal class 远程格挡强化 : ProjectileSurfaceEffect { public enum 旋转模式 { 基于运动方向, 固定顺时针, 固定逆时针, 随机方向, 交替方向 } private class 抛射物信息存储类 { public Transform 敌方抛射物变换; public MoveTransform 敌方抛射物移动变换; public bool 分配方向; public bool 顺时针方向; public float 进入角度; public float 上次爆发时间; public float 初始速度大小; public 抛射物信息存储类(Transform 变换, MoveTransform 移动) { 敌方抛射物变换 = 变换; 敌方抛射物移动变换 = 移动; 分配方向 = false; 顺时针方向 = true; 进入角度 = 0f; 上次爆发时间 = -999f; 初始速度大小 = ((Vector3)(ref 移动.velocity)).magnitude; } public bool 是否有效() { return (Object)(object)敌方抛射物变换 != (Object)null && (Object)(object)敌方抛射物移动变换 != (Object)null && ((Component)敌方抛射物移动变换).gameObject.activeInHierarchy; } } public bool 启用 = true; public float 圆形反弹半径 = 4f; public float 逃逸半径 = 6f; public float 旋转速率 = 5f; public float 最大影响速度 = 20f; public bool 过滤友方 = true; public 旋转模式 当前旋转模式 = 旋转模式.固定顺时针; public float 随机方向概率 = 0.5f; [Header("离心力设置")] public bool 启用离心力 = true; public float 离心力强度 = 3f; public float 最小距离离心力 = 1f; public AnimationCurve 离心力曲线 = null; [Header("甩飞爆发设置")] public bool 启用爆发甩飞 = true; public float 爆发半径 = 1.5f; public float 爆发强度 = 15f; public float 爆发冷却时间 = 0.5f; private Unit 这个单位; private Team 此物体队伍信息; private List<抛射物信息存储类> 抛射物存储类 = new List<抛射物信息存储类>(); private bool 上次方向是顺时针 = true; public void 设置启用(bool e = true) { 启用 = e; } private void Start() { //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_0038: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (离心力曲线 == null) { 离心力曲线 = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 1f), new Keyframe(1f, 0.2f), new Keyframe(圆形反弹半径, 0f) }); } 这个单位 = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)这个单位 != (Object)null) { 此物体队伍信息 = 这个单位.data.team; return; } TeamHolder componentInParent = ((Component)this).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { 此物体队伍信息 = componentInParent.team; } } private void Update() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: 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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) if (!启用) { return; } for (int num = 抛射物存储类.Count - 1; num >= 0; num--) { if (!抛射物存储类[num].是否有效()) { 抛射物存储类.RemoveAt(num); } else { float num2 = Vector3.Distance(((Component)this).transform.position, 抛射物存储类[num].敌方抛射物变换.position); if (num2 > 逃逸半径) { 抛射物存储类.RemoveAt(num); } else { float num3 = 旋转速率 * Time.deltaTime; if (num2 < 圆形反弹半径 && num2 > 0.01f) { num3 *= 圆形反弹半径 / num2; } num3 = Mathf.Min(num3, 最大影响速度); Vector3 val = 获取切线方向(抛射物存储类[num]); Vector3 val2 = Vector3.Lerp(抛射物存储类[num].敌方抛射物移动变换.velocity, val * ((Vector3)(ref 抛射物存储类[num].敌方抛射物移动变换.velocity)).magnitude, num3); Vector3 val3; if (启用离心力 && num2 > 0.01f) { float num4 = 计算离心力系数(num2); val3 = 抛射物存储类[num].敌方抛射物变换.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; float magnitude = ((Vector3)(ref val2)).magnitude; float num5 = magnitude / (抛射物存储类[num].初始速度大小 + 0.1f); num5 = Mathf.Clamp01(num5); float num6 = 离心力强度 * num4 * (1f + num5); Vector3 val4 = normalized * num6 * Time.deltaTime; val2 += val4; } if (启用爆发甩飞 && num2 < 爆发半径) { float time = Time.time; if (time - 抛射物存储类[num].上次爆发时间 > 爆发冷却时间) { val3 = 抛射物存储类[num].敌方抛射物变换.position - ((Component)this).transform.position; Vector3 normalized2 = ((Vector3)(ref val3)).normalized; if (((Vector3)(ref normalized2)).magnitude < 0.01f) { val3 = Random.insideUnitSphere; normalized2 = ((Vector3)(ref val3)).normalized; normalized2.y = 0f; ((Vector3)(ref normalized2)).Normalize(); } Vector3 val5 = normalized2 * 爆发强度; val2 = val5 + ((Vector3)(ref val2)).normalized * (((Vector3)(ref val2)).magnitude * 0.3f); 抛射物存储类[num].上次爆发时间 = time; } } if (((Vector3)(ref val2)).magnitude > 最大影响速度 * 2f) { val2 = ((Vector3)(ref val2)).normalized * 最大影响速度 * 2f; } 抛射物存储类[num].敌方抛射物移动变换.velocity = val2; } } } } private float 计算离心力系数(float 距离) { if (距离 <= 最小距离离心力) { return 1f; } float num = Mathf.InverseLerp(最小距离离心力, 圆形反弹半径, 距离); float num2 = 离心力曲线.Evaluate(num); if (距离 > 圆形反弹半径) { num2 *= Mathf.Lerp(1f, 0f, (距离 - 圆形反弹半径) / (逃逸半径 - 圆形反弹半径)); } return Mathf.Clamp01(num2); } private Vector3 获取切线方向(抛射物信息存储类 抛射物) { //IL_0007: 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) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) Vector3 val = 抛射物.敌方抛射物变换.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; if (当前旋转模式 != 0 && !抛射物.分配方向) { 分配抛射物方向(抛射物); } return (Vector3)(当前旋转模式 switch { 旋转模式.基于运动方向 => 基于运动方向获取切线(抛射物, normalized), 旋转模式.固定顺时针 => Vector3.Cross(Vector3.up, normalized), 旋转模式.固定逆时针 => -Vector3.Cross(Vector3.up, normalized), 旋转模式.随机方向 => 抛射物.顺时针方向 ? Vector3.Cross(Vector3.up, normalized) : (-Vector3.Cross(Vector3.up, normalized)), 旋转模式.交替方向 => 抛射物.顺时针方向 ? Vector3.Cross(Vector3.up, normalized) : (-Vector3.Cross(Vector3.up, normalized)), _ => Vector3.Cross(Vector3.up, normalized), }); } private Vector3 基于运动方向获取切线(抛射物信息存储类 抛射物, Vector3 到中心方向) { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_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_007a: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Vector3 normalized = ((Vector3)(ref 抛射物.敌方抛射物移动变换.velocity)).normalized; if (((Vector3)(ref normalized)).magnitude < 0.1f) { return Vector3.Cross(Vector3.up, 到中心方向); } float num = Mathf.Sign(Vector3.Dot(normalized, Vector3.Cross(Vector3.up, 到中心方向))); if (!抛射物.分配方向) { 抛射物.进入角度 = Vector3.Angle(normalized, -到中心方向); 抛射物.分配方向 = true; } return Vector3.Cross(Vector3.up, 到中心方向) * num; } private void 分配抛射物方向(抛射物信息存储类 抛射物) { switch (当前旋转模式) { case 旋转模式.随机方向: 抛射物.顺时针方向 = Random.value < 随机方向概率; break; case 旋转模式.交替方向: 抛射物.顺时针方向 = 上次方向是顺时针; 上次方向是顺时针 = !上次方向是顺时针; break; case 旋转模式.固定顺时针: 抛射物.顺时针方向 = true; break; case 旋转模式.固定逆时针: 抛射物.顺时针方向 = false; break; } 抛射物.分配方向 = true; } public override bool DoEffect(HitData hit, GameObject projectile) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!启用) { return false; } if (过滤友方) { TeamHolder component = projectile.GetComponent(); if ((Object)(object)component != (Object)null && component.team == 此物体队伍信息) { return false; } } MoveTransform componentInParent = projectile.GetComponentInParent(); foreach (抛射物信息存储类 item in 抛射物存储类) { if ((Object)(object)item.敌方抛射物移动变换 == (Object)(object)componentInParent) { return true; } } if ((Object)(object)componentInParent != (Object)null) { 抛射物存储类.Add(new 抛射物信息存储类(projectile.transform, componentInParent)); return true; } return false; } public void 清空所有抛射物() { 抛射物存储类.Clear(); } private void OnDisable() { 清空所有抛射物(); } private void OnDrawGizmosSelected() { //IL_0001: 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) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00d0: 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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.cyan; Gizmos.DrawWireSphere(((Component)this).transform.position, 圆形反弹半径); Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, 逃逸半径); if (启用爆发甩飞) { Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, 爆发半径); } switch (当前旋转模式) { case 旋转模式.固定顺时针: Gizmos.color = Color.green; break; case 旋转模式.固定逆时针: Gizmos.color = Color.red; break; default: Gizmos.color = Color.white; break; } Vector3 val = Vector3.Cross(Vector3.up, ((Component)this).transform.right); Gizmos.DrawRay(((Component)this).transform.position, val * 圆形反弹半径); if (启用离心力) { Gizmos.color = new Color(1f, 0.5f, 0f, 0.5f); Vector3 val2 = default(Vector3); for (int i = 0; i < 8; i++) { float num = (float)i * 45f * ((float)Math.PI / 180f); ((Vector3)(ref val2))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); Gizmos.DrawRay(((Component)this).transform.position + val2 * 0.5f, val2 * 离心力强度 * 0.3f); } } } } public class 弹反实体弹药 : MonoBehaviour { [Header("龙卷风弹反参数")] public bool 启动 = false; public LayerMask 受影响层 = LayerMask.op_Implicit(32768); [Range(0f, 5000f)] public float 离心力强度 = 10f; [Range(0f, 5000f)] public float 切线力强度 = 15f; [Range(0f, 2000f)] public float 最大距离 = 10f; [Header("力曲线设置")] [Tooltip("距离越近力越强的曲线,X轴为距离比例(0-1),Y轴为力强度比例(0-1)")] public AnimationCurve 力曲线 = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); public bool 启用切线力 = true; public bool 启用离心力 = true; private Collider _triggerCollider; private List _rigidbodies = new List(); private List _rigidbodyTransforms = new List(); private Unit 当前单位; private Team 当前队伍; private Transform _transform; private void Awake() { _transform = ((Component)this).transform; _triggerCollider = ((Component)this).GetComponent(); if ((Object)(object)_triggerCollider == (Object)null) { Debug.LogError((object)"弹反实体弹药:需要 Collider 组件并勾选 Is Trigger"); ((Behaviour)this).enabled = false; } else if (!_triggerCollider.isTrigger) { Debug.LogWarning((object)"弹反实体弹药:Collider 未设置为触发器,已自动设为触发器"); _triggerCollider.isTrigger = true; } } private void Start() { 初始化队伍信息(); } private void Update() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_014e: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) if (!启动) { return; } for (int num = _rigidbodies.Count - 1; num >= 0; num--) { Rigidbody val = _rigidbodies[num]; Transform val2 = _rigidbodyTransforms[num]; if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { 移除刚体(num); } else { Vector3 val3 = val2.position - _transform.position; float magnitude = ((Vector3)(ref val3)).magnitude; if (!(magnitude > 最大距离)) { float num2 = Mathf.Clamp01(magnitude / 最大距离); float num3 = 力曲线.Evaluate(num2); Vector3 val4 = Vector3.zero; if (启用离心力) { Vector3 val5 = ((Vector3)(ref val3)).normalized * 离心力强度 * num3; val4 += val5; } if (启用切线力) { Vector3 val6 = Vector3.Cross(Vector3.up, ((Vector3)(ref val3)).normalized); float num4 = (启用离心力 ? num3 : 1f); Vector3 val7 = val6 * 切线力强度 * num4; val4 += val7; } val.AddForce(val4 * Time.deltaTime, (ForceMode)5); } } } } private void 初始化队伍信息() { //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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) 当前单位 = ((Component)((Component)this).transform.root).GetComponent(); if ((Object)(object)当前单位 == (Object)null) { TeamHolder componentInParent = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent)) { 当前队伍 = componentInParent.team; } else { 当前队伍 = (Team)0; } } else { 当前队伍 = 当前单位.data.team; } } private void OnTriggerEnter(Collider other) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (启动 && ((1 << ((Component)other).gameObject.layer) & LayerMask.op_Implicit(受影响层)) != 0) { 尝试添加刚体(other); } } private void OnTriggerExit(Collider other) { if (启动) { 尝试移除刚体(other); } } private bool 是否有效的目标(Collider other, out Rigidbody 刚体, out AddForce 抛射物组件) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) 刚体 = ((Component)other).GetComponentInParent(); 抛射物组件 = ((Component)other).GetComponentInParent(); if ((Object)(object)抛射物组件 == (Object)null || (Object)(object)刚体 == (Object)null) { return false; } TeamHolder component = ((Component)((Component)other).transform.root).GetComponent(); if ((Object)(object)component == (Object)null || component.team == 当前队伍) { return false; } return true; } private void 尝试添加刚体(Collider other) { if (是否有效的目标(other, out var 刚体, out var _) && !_rigidbodies.Contains(刚体)) { _rigidbodies.Add(刚体); _rigidbodyTransforms.Add(((Component)刚体).transform); } } private void 尝试移除刚体(Collider other) { if (是否有效的目标(other, out var 刚体, out var _)) { int num = _rigidbodies.IndexOf(刚体); if (num != -1) { 移除刚体(num); } } } private void 移除刚体(int index) { _rigidbodies.RemoveAt(index); _rigidbodyTransforms.RemoveAt(index); } public void 设置启动(bool g = true) { 启动 = g; if (启动) { 启动时检测内部(); } else { 清除刚体列表(); } } private void 启动时检测内部() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(_transform.position, 最大距离 + 2f, LayerMask.op_Implicit(受影响层)); if (array.Length != 0) { for (int i = 0; i < array.Length; i++) { 尝试添加刚体(array[i]); } } } public void 清除刚体列表() { _rigidbodies.Clear(); _rigidbodyTransforms.Clear(); } public void 停止并清除() { 启动 = false; 清除刚体列表(); } public int 获取影响物体数量() { 清理无效刚体(); return _rigidbodies.Count; } private void 清理无效刚体() { for (int num = _rigidbodies.Count - 1; num >= 0; num--) { if ((Object)(object)_rigidbodies[num] == (Object)null || (Object)(object)_rigidbodyTransforms[num] == (Object)null) { 移除刚体(num); } } } private void OnDisable() { if (启动) { 清除刚体列表(); } } private void OnDestroy() { 清除刚体列表(); } private void OnDrawGizmosSelected() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, 最大距离); if (!Application.isPlaying || !启动 || _rigidbodies.Count <= 0) { return; } Gizmos.color = Color.red; foreach (Rigidbody rigidbody in _rigidbodies) { if ((Object)(object)rigidbody != (Object)null) { Vector3 val = rigidbody.position - ((Component)this).transform.position; Gizmos.DrawLine(rigidbody.position, rigidbody.position + ((Vector3)(ref val)).normalized * 2f); } } } } internal class 随机事件触发器 : MonoBehaviour { public UnityEvent[] 随机事件; public void 触发事件() { if (随机事件 != null && 随机事件.Length != 0) { UnityEvent val = 随机事件[Random.Range(0, 随机事件.Length)]; if (val != null) { val.Invoke(); } } } } internal class 实例化随机朝向121 : MonoBehaviour { public GameObject 实例化物体; public bool 跟随父级 = true; public List transforms = new List(); public void kaiaiaiaia() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)实例化物体 != (Object)null) { GameObject val = Object.Instantiate(实例化物体, ((Component)this).transform.position, Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f)); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); transforms.Add(val.transform); } } private void Update() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (!跟随父级 || transforms.Count == 0) { return; } for (int i = 0; i < transforms.Count; i++) { if ((Object)(object)transforms[i] != (Object)null) { transforms[i].position = ((Component)this).transform.position; } } } } } namespace rwdseerfd.unity脚本存储文件夹.穆萨罗.圆形着火 { public class 物体穆萨罗圆形召唤 : MonoBehaviour { [CompilerGenerated] private sealed class <召唤携程>d__17 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float 总时间; public 物体穆萨罗圆形召唤 <>4__this; private float <开始时间>5__1; private float <上次召唤时间>5__2; private int <单位随机索引>5__3; private Unit <目标单位>5__4; private float <随机角度>5__5; private float <随机半径>5__6; private Vector3 <圆形偏移>5__7; private Vector3 <圆形随机位置>5__8; private Vector3 <召唤物面向单位>5__9; private GameObject <召唤分身>5__10; private 分身向目标移动 <移动组件>5__11; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <召唤携程>d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <目标单位>5__4 = null; <召唤分身>5__10 = null; <移动组件>5__11 = null; <>1__state = -2; } private bool MoveNext() { //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <开始时间>5__1 = Time.time; <上次召唤时间>5__2 = <开始时间>5__1; break; case 1: <>1__state = -1; break; case 2: <>1__state = -1; break; } if (Time.time - <开始时间>5__1 < 总时间) { if (Time.time - <上次召唤时间>5__2 < <>4__this.间隔时间) { <>2__current = null; <>1__state = 1; return true; } if (!((Object)(object)<>4__this.召唤物 != (Object)null) || <>4__this.获取到的单位.Count <= 0) { goto IL_0359; } <>4__this.获取到的单位.RemoveAll((Unit u) => (Object)(object)u == (Object)null || u.data.Dead); if (<>4__this.获取到的单位.Count != 0) { goto IL_01a0; } if (<>4__this.尝试搜索大范围) { <>4__this.获取到的单位 = <>4__this.单位获取工具类.GetTargets(((Component)<>4__this).transform.position, 999999f); if (<>4__this.获取到的单位.Count != 0) { goto IL_01a0; } UnityEvent 中断召唤事件 = <>4__this.中断召唤事件; if (中断召唤事件 != null) { 中断召唤事件.Invoke(); } } else { UnityEvent 中断召唤事件2 = <>4__this.中断召唤事件; if (中断召唤事件2 != null) { 中断召唤事件2.Invoke(); } } } UnityEvent 结束召唤事件 = <>4__this.结束召唤事件; if (结束召唤事件 != null) { 结束召唤事件.Invoke(); } <>4__this.正在运行的携程 = null; return false; IL_01a0: <单位随机索引>5__3 = Random.Range(0, <>4__this.获取到的单位.Count); <目标单位>5__4 = <>4__this.获取到的单位[<单位随机索引>5__3]; <随机角度>5__5 = (float)Random.Range(0, 360) * ((float)Math.PI / 180f); <随机半径>5__6 = Random.Range(<>4__this.最小半径, <>4__this.最大半径); <圆形偏移>5__7 = new Vector3(Mathf.Cos(<随机角度>5__5), 0f, Mathf.Sin(<随机角度>5__5)) * <随机半径>5__6; <圆形随机位置>5__8 = <目标单位>5__4.data.mainRig.position + <圆形偏移>5__7; Vector3 val = <目标单位>5__4.data.mainRig.position - <圆形随机位置>5__8; <召唤物面向单位>5__9 = ((Vector3)(ref val)).normalized; <召唤分身>5__10 = Object.Instantiate(<>4__this.召唤物, <圆形随机位置>5__8, Quaternion.LookRotation(<召唤物面向单位>5__9)); TeamHolder.AddTeamHolder(<召唤分身>5__10, ((Component)<>4__this).gameObject); <移动组件>5__11 = <召唤分身>5__10.GetComponent<分身向目标移动>(); if ((Object)(object)<移动组件>5__11 != (Object)null) { <移动组件>5__11.分身目标 = <目标单位>5__4; <移动组件>5__11.是单位设置工具 = <>4__this.是单位设置工具; } UnityEvent 每次召唤事件 = <>4__this.每次召唤事件; if (每次召唤事件 != null) { 每次召唤事件.Invoke(); } <上次召唤时间>5__2 = Time.time; <目标单位>5__4 = null; <召唤分身>5__10 = null; <移动组件>5__11 = null; goto IL_0359; IL_0359: <>2__current = null; <>1__state = 2; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public 最近单位获取高度定义 单位获取工具类; public 单位设置工具 是单位设置工具; public float 最小半径 = 10f; public float 最大半径 = 15f; public float 间隔时间 = 0.5f; public GameObject 召唤物; public UnityEvent 开始召唤事件; public UnityEvent 结束召唤事件; public UnityEvent 每次召唤事件; public UnityEvent 中断召唤事件; public bool 尝试搜索大范围 = true; private Unit 这个单位; private Coroutine 正在运行的携程; private List 获取到的单位; private void Start() { if ((Object)(object)单位获取工具类 == (Object)null) { 单位获取工具类 = ((Component)this).GetComponent<最近单位获取高度定义>(); } 这个单位 = ((Component)((Component)this).transform.root).GetComponent(); } public void 启动(float 时间 = 7f) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)单位获取工具类 == (Object)null) { return; } if ((Object)(object)这个单位 != (Object)null && (Object)(object)这个单位.data.targetData != (Object)null) { 获取到的单位 = 单位获取工具类.GetTargets(这个单位.data.targetData.mainRig.position, 30f); } else { 获取到的单位 = 单位获取工具类.GetTargets(((Component)this).transform.position, 30f); } 获取到的单位 = 获取到的单位.Where((Unit u) => (Object)(object)u != (Object)null && !u.data.Dead).ToList(); if (正在运行的携程 == null && 获取到的单位.Count > 0) { UnityEvent obj = 开始召唤事件; if (obj != null) { obj.Invoke(); } 正在运行的携程 = ((MonoBehaviour)this).StartCoroutine(召唤携程(时间)); } } public void 获取范围内单位(float 范围) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) 获取到的单位 = 单位获取工具类.GetTargets(((Component)this).transform.position, 范围); } [IteratorStateMachine(typeof(<召唤携程>d__17))] private IEnumerator 召唤携程(float 总时间) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <召唤携程>d__17(0) { <>4__this = this, 总时间 = 总时间 }; } } public class 分身向目标移动 : MonoBehaviour { public Unit 分身目标; public bool 启用 = true; public float 移动速度 = 3f; public float 停止距离 = 5f; public UnityEvent 靠近事件; private bool 已靠近 = false; public 单位设置工具 是单位设置工具; private void Update() { //IL_0033: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) if (!启用 || !((Object)(object)分身目标 != (Object)null)) { return; } Vector3 position = 分身目标.data.mainRig.position; Vector3 val = position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Transform transform = ((Component)this).transform; transform.position += normalized * Time.deltaTime * 移动速度; ((Component)this).transform.rotation = Quaternion.LookRotation(normalized); float num = Vector3.Distance(position, ((Component)this).transform.position); if (num <= 停止距离 && !已靠近) { 已靠近 = true; UnityEvent obj = 靠近事件; if (obj != null) { obj.Invoke(); } } else { 已靠近 = false; } } public void 设置启动(bool g = true) { 启用 = g; } public void 在目标处实例化(GameObject gameddd) { //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) if (!((Object)(object)gameddd == (Object)null) && !((Object)(object)分身目标 == (Object)null)) { GameObject val = Object.Instantiate(gameddd, 分身目标.data.mainRig.position, Quaternion.identity); TeamHolder.AddTeamHolder(val, ((Component)this).gameObject); Debug.Log((object)"已实例化爆炸"); } } public void 造成百分比伤害(float 伤害) { if ((Object)(object)分身目标 != (Object)null || Object.op_Implicit((Object)(object)分身目标.data)) { if (分身目标.data.health <= 分身目标.data.maxHealth * 伤害) { 分身目标.data.healthHandler.Die((Unit)null); return; } DataHandler data = 分身目标.data; data.health -= 分身目标.data.maxHealth * 伤害; } } public void 设置召唤单位位置() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)是单位设置工具)) { 是单位设置工具.移动单位物体置主物体指定偏移(((Component)this).transform.position + new Vector3(0f, 1f, 0f)); } } } public class 最近单位获取高度定义 : MonoBehaviour { public bool useUnitTeam = false; private Unit unit; private Team team; private TeamHolder teamholder; private TeamSystem m_teamSystem; private List orderedUnits; private void Start() { SetTeamSystem(); } private List GetUnitsAndSort() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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) team = GetTeam(); List teamUnits = m_teamSystem.GetTeamUnits((Team)(((int)team == 0) ? 1 : 0)); teamUnits.Sort((Unit x, Unit y) => Vector3.Distance(((Component)this).transform.position, x.data.mainRig.position).CompareTo(Vector3.Distance(((Component)this).transform.position, y.data.mainRig.position))); return teamUnits; } public List GetTargets(Vector3 pont, float? maxRange = 0f) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) orderedUnits = new List(); orderedUnits.AddRange(GetUnitsAndSort()); if (maxRange != 0f) { for (int i = 0; i < orderedUnits.Count; i++) { if (Vector3.Distance(pont, ((Component)orderedUnits[i].data.mainRig).transform.position) > maxRange) { orderedUnits.RemoveRange(i, orderedUnits.Count - i); break; } } } return orderedUnits; } private Team GetTeam() { //IL_0066: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (useUnitTeam) { unit = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)unit)) { team = unit.Team; } } else { teamholder = ((Component)((Component)this).transform).GetComponent(); if (Object.op_Implicit((Object)(object)teamholder)) { team = teamholder.team; } } return team; } private void SetTeamSystem() { m_teamSystem = World.Active.GetOrCreateManager(); } } } namespace rwdseerfd.unity脚本 { [UpdateBefore(typeof(PreUpdateBarrier))] public class 只会以最近单位为目标 : JobComponentSystem { private struct UnitFilter { public EntityArray Entities; [ReadOnly] public SharedComponentDataArray Teams; public ComponentDataArray Positions; public ComponentDataArray PredictedPositions; public ComponentDataArray Ranges; public ComponentDataArray UnitTags; [ReadOnly] public ComponentDataArray<单位只会以最近单位为目标标签> TargetEnemyTag; [ReadOnly] public SubtractiveComponent IsInPool; public readonly int Length; public readonly int GroupIndex; } private struct TargetFilter { public EntityArray Entities; [ReadOnly] public SharedComponentDataArray Teams; public ComponentDataArray Position; [ReadOnly] public ComponentDataArray PredictedPositions; [ReadOnly] public ComponentDataArray TargetPriorities; [ReadOnly] public ComponentDataArray TargetThicknesses; public ComponentDataArray EnemiesTargetingMes; public ComponentDataArray _UnitTag; public SubtractiveComponent _IsDead; [ReadOnly] public SubtractiveComponent IsInPool; public readonly int Length; public readonly int GroupIndex; } private struct Job : IJob { public EntityArray UnitEntities; public ComponentDataArray UnitPositions; public ComponentDataArray UnitRanges; [ReadOnly] public EntityArray TargetEntities; [ReadOnly] public ComponentDataArray TargetPositions; [ReadOnly] public ComponentDataArray TargetPriorities; [ReadOnly] public ComponentDataArray TargetThicknesses; public NativeArray TargetsBeingTargetedBy; public Concurrent CommandBuffer; [ReadOnly] public ComponentDataFromEntity HasTargetTag; [ReadOnly] public ComponentDataFromEntity IsTargetTag; [ReadOnly] public SubtractiveComponent IsInPool; public void Execute() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_010b: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_016e: 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) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < ((EntityArray)(ref UnitEntities)).Length; i++) { Entity val = ((EntityArray)(ref UnitEntities))[i]; PredictedPosition val2 = UnitPositions[i]; Range val3 = UnitRanges[i]; Entity val4 = Entity.Null; int num = -1; float num2 = float.MinValue; float value = 0f; for (int j = 0; j < ((EntityArray)(ref TargetEntities)).Length; j++) { float num3 = math.length(TargetPositions[j].Value - val2.Value); Entity val5 = ((EntityArray)(ref TargetEntities))[j]; float value2 = TargetsBeingTargetedBy[j].Value; float num4 = 0f - num3 - value2 * val3.AttackRange * 0.05f; if (num4 > num2) { num2 = num4; val4 = val5; num = j; } } if (num > -1) { ((Concurrent)(ref CommandBuffer)).SetComponent(i, val, new AttackThickness { Value = value }); BeingTargetedBy val6 = TargetsBeingTargetedBy[num]; val6.Value += 1f; TargetsBeingTargetedBy[num] = val6; ((Concurrent)(ref CommandBuffer)).SetComponent(i, val, new HasTargetTag { Target = val4 }); ((Concurrent)(ref CommandBuffer)).SetComponent(i, val4, new IsTarget { Targetee = val }); } else { ((Concurrent)(ref CommandBuffer)).SetComponent(i, val, new AttackThickness { Value = 0f }); } } } } [Inject] private UnitFilter m_filter; [Inject] private TargetFilter m_targetFilter; [Inject] private PreUpdateBarrier m_barrier; protected override JobHandle OnUpdate(JobHandle inputDeps) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: 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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020d: 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_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0218: 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_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) ComponentDataFromEntity componentDataFromEntity = ((ComponentSystemBase)this).GetComponentDataFromEntity(true); ComponentDataFromEntity componentDataFromEntity2 = ((ComponentSystemBase)this).GetComponentDataFromEntity(true); EntityCommandBuffer val = ((BarrierSystem)m_barrier).CreateCommandBuffer(); ComponentGroup val2 = ((ComponentSystemBase)this).ComponentGroups[m_targetFilter.GroupIndex]; ComponentGroup val3 = ((ComponentSystemBase)this).ComponentGroups[m_filter.GroupIndex]; val3.SetFilter(new Team { Value = 0 }); val2.SetFilter(new Team { Value = 0 }); EntityArray entityArray = val3.GetEntityArray(); val3.GetComponentDataArray(); ComponentDataArray componentDataArray = val3.GetComponentDataArray(); ComponentDataArray componentDataArray2 = val3.GetComponentDataArray(); EntityArray entityArray2 = val2.GetEntityArray(); ComponentDataArray componentDataArray3 = val2.GetComponentDataArray(); ComponentDataArray componentDataArray4 = val2.GetComponentDataArray(); ComponentDataArray componentDataArray5 = val2.GetComponentDataArray(); val2.GetComponentDataArray(); val3.ResetFilter(); val3.SetFilter(new Team { Value = 1 }); val2.ResetFilter(); val2.SetFilter(new Team { Value = 1 }); EntityArray entityArray3 = val3.GetEntityArray(); val3.GetComponentDataArray(); ComponentDataArray componentDataArray6 = val3.GetComponentDataArray(); ComponentDataArray componentDataArray7 = val3.GetComponentDataArray(); EntityArray entityArray4 = val2.GetEntityArray(); ComponentDataArray componentDataArray8 = val2.GetComponentDataArray(); ComponentDataArray componentDataArray9 = val2.GetComponentDataArray(); ComponentDataArray componentDataArray10 = val2.GetComponentDataArray(); val2.GetComponentDataArray(); NativeArray targetsBeingTargetedBy = default(NativeArray); targetsBeingTargetedBy..ctor(((EntityArray)(ref entityArray2)).Length, (Allocator)3, (NativeArrayOptions)1); NativeArray targetsBeingTargetedBy2 = default(NativeArray); targetsBeingTargetedBy2..ctor(((EntityArray)(ref entityArray4)).Length, (Allocator)3, (NativeArrayOptions)1); Job job = default(Job); job.UnitEntities = entityArray; job.UnitPositions = componentDataArray2; job.UnitRanges = componentDataArray; job.TargetPositions = componentDataArray8; job.TargetEntities = entityArray4; job.TargetPriorities = componentDataArray9; job.TargetsBeingTargetedBy = targetsBeingTargetedBy2; job.TargetThicknesses = componentDataArray10; job.CommandBuffer = ((EntityCommandBuffer)(ref val)).ToConcurrent(); job.HasTargetTag = componentDataFromEntity; job.IsTargetTag = componentDataFromEntity2; Job job2 = job; job = default(Job); job.UnitEntities = entityArray3; job.UnitPositions = componentDataArray7; job.UnitRanges = componentDataArray6; job.TargetEntities = entityArray2; job.TargetPositions = componentDataArray3; job.TargetPriorities = componentDataArray4; job.TargetsBeingTargetedBy = targetsBeingTargetedBy; job.TargetThicknesses = componentDataArray5; job.CommandBuffer = ((EntityCommandBuffer)(ref val)).ToConcurrent(); job.HasTargetTag = componentDataFromEntity; job.IsTargetTag = componentDataFromEntity2; Job job3 = job; JobHandle val4 = IJobExtensions.Schedule(job2, inputDeps); JobHandle result = IJobExtensions.Schedule(job3, val4); ((JobHandle)(ref val4)).Complete(); ((JobHandle)(ref result)).Complete(); for (int i = 0; i < ((EntityArray)(ref entityArray2)).Length; i++) { ((EntityCommandBuffer)(ref val)).SetComponent(((EntityArray)(ref entityArray2))[i], targetsBeingTargetedBy[i]); } for (int j = 0; j < ((EntityArray)(ref entityArray4)).Length; j++) { ((EntityCommandBuffer)(ref val)).SetComponent(((EntityArray)(ref entityArray4))[j], targetsBeingTargetedBy2[j]); } targetsBeingTargetedBy.Dispose(); targetsBeingTargetedBy2.Dispose(); return result; } } [Serializable] [StructLayout(LayoutKind.Sequential, Size = 1)] public struct 单位只会以最近单位为目标标签 : ITargetingComponent, IComponentData { } public class 共享事件 : MonoBehaviour { public UnityEvent 共享事件1号; public UnityEvent 共享事件2号; public UnityEvent 共享事件3号; public UnityEvent 共享事件4号; public UnityEvent[] 共享事件数组; private 共享事件[] 所有共享事件; private void Start() { 所有共享事件 = ((Component)((Component)this).transform.root).GetComponentsInChildren<共享事件>(); } public void 激活所有共享事件组() { for (int i = 0; i < 所有共享事件.Length; i++) { UnityEvent obj = 所有共享事件[i].共享事件1号; if (obj != null) { obj.Invoke(); } UnityEvent obj2 = 所有共享事件[i].共享事件2号; if (obj2 != null) { obj2.Invoke(); } UnityEvent obj3 = 所有共享事件[i].共享事件3号; if (obj3 != null) { obj3.Invoke(); } UnityEvent obj4 = 所有共享事件[i].共享事件4号; if (obj4 != null) { obj4.Invoke(); } } } public void 激活指定共享事件组(int d = 1) { if (d == 1) { for (int i = 0; i < 所有共享事件.Length; i++) { UnityEvent obj = 所有共享事件[i].共享事件1号; if (obj != null) { obj.Invoke(); } } } if (d == 2) { for (int j = 0; j < 所有共享事件.Length; j++) { UnityEvent obj2 = 所有共享事件[j].共享事件2号; if (obj2 != null) { obj2.Invoke(); } } } if (d == 3) { for (int k = 0; k < 所有共享事件.Length; k++) { UnityEvent obj3 = 所有共享事件[k].共享事件3号; if (obj3 != null) { obj3.Invoke(); } } } if (d != 4) { return; } for (int l = 0; l < 所有共享事件.Length; l++) { UnityEvent obj4 = 所有共享事件[l].共享事件4号; if (obj4 != null) { obj4.Invoke(); } } } public void 激活所有共享事件数组() { for (int i = 0; i < 所有共享事件.Length; i++) { if (所有共享事件[i].共享事件数组 == null) { continue; } for (int j = 0; j < 所有共享事件[i].共享事件数组.Length; j++) { UnityEvent obj = 所有共享事件[i].共享事件数组[j]; if (obj != null) { obj.Invoke(); } } } } public void 激活所有共享事件数组中指定索引(int 索引) { for (int i = 0; i < 所有共享事件.Length; i++) { if (所有共享事件[i].共享事件数组 != null && 索引 >= 0 && 索引 < 所有共享事件[i].共享事件数组.Length) { UnityEvent obj = 所有共享事件[i].共享事件数组[索引]; if (obj != null) { obj.Invoke(); } } } } public void 激活所有共享事件数组中前N个(int 数量) { for (int i = 0; i < 所有共享事件.Length; i++) { if (所有共享事件[i].共享事件数组 == null) { continue; } int num = Mathf.Min(数量, 所有共享事件[i].共享事件数组.Length); for (int j = 0; j < num; j++) { UnityEvent obj = 所有共享事件[i].共享事件数组[j]; if (obj != null) { obj.Invoke(); } } } } } public class 锁定旋转轴asasdasd : MonoBehaviour { public enum LockMode { Local, World } [Header("旋转锁定设置")] public bool lockX = false; public bool lockY = false; public bool lockZ = false; [Header("锁定角度值")] public float lockedXAngle = 0f; public float lockedYAngle = 0f; public float lockedZAngle = 0f; [Header("锁定模式")] public LockMode lockMode = LockMode.Local; [Header("平滑过渡")] public bool useSmoothLock = false; public float smoothTime = 0.3f; private Quaternion targetRotation; private Vector3 currentRotationVelocity; private Quaternion rotationVelocityQuat; private void Start() { //IL_0008: 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) targetRotation = ((Component)this).transform.rotation; } private void LateUpdate() { ApplyRotationLock(); } private void ApplyRotationLock() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0074: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_00de: 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_00b1: 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) Vector3 val = ((lockMode == LockMode.Local) ? ((Component)this).transform.localEulerAngles : ((Component)this).transform.eulerAngles); Vector3 val2 = val; if (lockX) { val2.x = lockedXAngle; } if (lockY) { val2.y = lockedYAngle; } if (lockZ) { val2.z = lockedZAngle; } targetRotation = ((lockMode == LockMode.Local) ? Quaternion.Euler(val2) : Quaternion.Euler(val2)); if (useSmoothLock) { if (lockMode == LockMode.Local) { ((Component)this).transform.localRotation = SmoothRotate(((Component)this).transform.localRotation, targetRotation); } else { ((Component)this).transform.rotation = SmoothRotate(((Component)this).transform.rotation, targetRotation); } } else if (lockMode == LockMode.Local) { ((Component)this).transform.localRotation = targetRotation; } else { ((Component)this).transform.rotation = targetRotation; } } private Quaternion SmoothRotate(Quaternion current, Quaternion target) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //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_0017: Unknown result type (might be due to invalid IL or missing references) return Quaternion.Slerp(current, target, Time.deltaTime / smoothTime); } public void SetLockAxis(bool x, bool y, bool z) { lockX = x; lockY = y; lockZ = z; } public void SetLockedAngles(float x, float y, float z) { lockedXAngle = x; lockedYAngle = y; lockedZAngle = z; } public void LockImmediate() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(lockX ? lockedXAngle : ((Component)this).transform.eulerAngles.x, lockY ? lockedYAngle : ((Component)this).transform.eulerAngles.y, lockZ ? lockedZAngle : ((Component)this).transform.eulerAngles.z); if (lockMode == LockMode.Local) { ((Component)this).transform.localEulerAngles = val; } else { ((Component)this).transform.eulerAngles = val; } } private void OnDrawGizmosSelected() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_006c: 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) //IL_007e: 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_00ac: 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_00b2: 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_00c1: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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) if (!Application.isPlaying) { Vector3 eulerAngles = ((Component)this).transform.eulerAngles; if (lockX) { eulerAngles.x = lockedXAngle; } if (lockY) { eulerAngles.y = lockedYAngle; } if (lockZ) { eulerAngles.z = lockedZAngle; } Quaternion val = Quaternion.Euler(eulerAngles); Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, 0.5f); if (lockX) { Gizmos.color = Color.red; Gizmos.DrawRay(((Component)this).transform.position, val * Vector3.right * 2f); } if (lockY) { Gizmos.color = Color.green; Gizmos.DrawRay(((Component)this).transform.position, val * Vector3.up * 2f); } if (lockZ) { Gizmos.color = Color.blue; Gizmos.DrawRay(((Component)this).transform.position, val * Vector3.forward * 2f); } } } } public class 离开父级1 : MonoBehaviour { private GameObject 原父级; private void Start() { Transform parent = ((Component)this).transform.parent; 原父级 = ((parent != null) ? ((Component)parent).gameObject : null); ((Component)this).transform.SetParent((Transform)null); if ((Object)(object)原父级 != (Object)null) { 父级销毁监听器 父级销毁监听器2 = 原父级.AddComponent<父级销毁监听器>(); 父级销毁监听器2.初始化(this); } } public void 父级被销毁() { Object.Destroy((Object)(object)((Component)this).gameObject); } } public class 父级销毁监听器 : MonoBehaviour { private 离开父级1 目标脚本; public void 初始化(离开父级1 脚本) { 目标脚本 = 脚本; } private void OnDestroy() { if ((Object)(object)目标脚本 != (Object)null) { 目标脚本.父级被销毁(); } } } public class 物体跟随位置 : MonoBehaviour { public Transform 跟随物体; public bool 旋转跟随 = false; public bool 是否跟随父级销毁 = false; private 物体销毁跟随 销毁跟随组件; private void Start() { if (是否跟随父级销毁 && (Object)(object)跟随物体 != (Object)null) { 销毁跟随组件 = ((Component)跟随物体).GetComponent<物体销毁跟随>(); if ((Object)(object)销毁跟随组件 == (Object)null) { 销毁跟随组件 = ((Component)跟随物体).gameObject.AddComponent<物体销毁跟随>(); } 物体销毁跟随 obj = 销毁跟随组件; obj.销毁委托 = (Action)Delegate.Combine(obj.销毁委托, new Action(销毁物体)); } } private void LateUpdate() { //IL_001f: 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) if (!((Object)(object)跟随物体 == (Object)null)) { ((Component)this).transform.position = 跟随物体.position; if (旋转跟随) { ((Component)this).transform.rotation = 跟随物体.rotation; } } } private void 销毁物体() { if ((Object)(object)this != (Object)null && (Object)(object)((Component)this).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void OnDestroy() { if ((Object)(object)销毁跟随组件 != (Object)null) { 物体销毁跟随 obj = 销毁跟随组件; obj.销毁委托 = (Action)Delegate.Remove(obj.销毁委托, new Action(销毁物体)); } } } public class 物体销毁跟随 : MonoBehaviour { public Action 销毁委托; private void OnDestroy() { 销毁委托?.Invoke(); 销毁委托 = null; } } [ExecuteInEditMode] [RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))] public class 刀光拖尾渲染器 : MonoBehaviour { private struct 历史顶点 { public Vector3[] 刀身点位置; public float 创建时间; public 历史顶点(Vector3[] positions, float time) { //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) 刀身点位置 = (Vector3[])(object)new Vector3[positions.Length]; for (int i = 0; i < positions.Length; i++) { 刀身点位置[i] = positions[i]; } 创建时间 = time; } } [Header("位置引用")] public Transform[] 刀身点; [Tooltip("用于检测移动距离的中心点,如果不设置则使用第一个刀身点")] public Transform 拖尾中心点; [Header("材质设置")] public Material 拖尾材质; [Header("时间参数")] public float 每次网格生成间隔时间 = 0.05f; public float 每段网格存在时间 = 0.5f; [Header("距离触发参数")] [Tooltip("基于距离触发时,移动多少距离才生成新顶点")] public float 触发移动距离 = 0.1f; [Tooltip("启用基于距离的触发模式(将忽略时间间隔)")] public bool 使用距离触发 = false; [Header("更新模式")] [Tooltip("开启后每帧更新网格,不受生成间隔时间影响")] public bool 每帧更新 = false; [Header("永久顶点设置")] [Tooltip("是否始终保留当前刀身位置作为最新顶点")] public bool 保留当前帧为永久顶点 = true; [Header("状态控制")] [SerializeField] private bool 是否启用 = true; [Header("编辑器设置")] public bool 编辑器模式下运行 = true; private List<历史顶点> 历史顶点列表 = new List<历史顶点>(); private Mesh 刀光拖尾网格; private MeshFilter 网格过滤器; private float 上次生成时间 = 0f; private float 上次编辑器时间 = 0f; private bool 上次运行状态 = false; private Vector3 上次中心点位置; private bool 首次记录中心点 = true; private Vector3[] 当前帧刀身点位置; public bool 启用状态 { get { return 是否启用; } set { 是否启用 = value; } } private void Start() { 初始化组件(); 上次生成时间 = GetCurrentTime(); 上次编辑器时间 = GetCurrentTime(); 重置中心点记录(); } private void OnEnable() { if ((Object)(object)网格过滤器 == (Object)null || (Object)(object)刀光拖尾网格 == (Object)null) { 初始化组件(); } 上次生成时间 = GetCurrentTime(); 上次编辑器时间 = GetCurrentTime(); 重置中心点记录(); } private void OnDisable() { if ((Object)(object)刀光拖尾网格 != (Object)null) { 刀光拖尾网格.Clear(); } } private void Update() { if (Application.isPlaying != 上次运行状态) { if (!Application.isPlaying) { 上次编辑器时间 = GetCurrentTime(); } 上次运行状态 = Application.isPlaying; } if (!Application.isPlaying && (!编辑器模式下运行 || Application.isPlaying)) { if ((Object)(object)刀光拖尾网格 != (Object)null && 刀光拖尾网格.vertexCount > 0) { 刀光拖尾网格.Clear(); } return; } 更新当前帧位置(); 移除过期顶点对(); if (是否启用) { float currentTime = GetCurrentTime(); bool flag = false; if (每帧更新 || ((!使用距离触发) ? (currentTime - 上次生成时间 >= 每次网格生成间隔时间) : 检查距离触发())) { 添加新顶点对(); 上次生成时间 = currentTime; } } if (刀身点 != null && 刀身点.Length >= 2) { 更新网格(); } else if ((Object)(object)刀光拖尾网格 != (Object)null) { 刀光拖尾网格.Clear(); } } private bool 检查距离触发() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) if (刀身点 == null || 刀身点.Length == 0) { return false; } Vector3 val = ((!((Object)(object)拖尾中心点 != (Object)null)) ? 刀身点[0].position : 拖尾中心点.position); if (首次记录中心点) { 上次中心点位置 = val; 首次记录中心点 = false; return true; } float num = Vector3.Distance(val, 上次中心点位置); if (num >= 触发移动距离) { 上次中心点位置 = val; return true; } return false; } public void 重置中心点记录() { 首次记录中心点 = true; } public void 更新中心点位置() { //IL_0019: 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_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) if ((Object)(object)拖尾中心点 != (Object)null) { 上次中心点位置 = 拖尾中心点.position; } else if (刀身点 != null && 刀身点.Length != 0) { 上次中心点位置 = 刀身点[0].position; } 首次记录中心点 = false; } public Vector3 获取当前中心点位置() { //IL_0018: 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_0052: 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_004f: 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) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)拖尾中心点 != (Object)null) { return 拖尾中心点.position; } if (刀身点 != null && 刀身点.Length != 0) { return 刀身点[0].position; } return Vector3.zero; } public Vector3 获取上次中心点位置() { //IL_0002: 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_000a: Unknown result type (might be due to invalid IL or missing references) return 上次中心点位置; } public float 获取当前移动距离() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (首次记录中心点) { return 0f; } Vector3 position; if ((Object)(object)拖尾中心点 != (Object)null) { position = 拖尾中心点.position; } else { if (刀身点 == null || 刀身点.Length == 0) { return 0f; } position = 刀身点[0].position; } return Vector3.Distance(position, 上次中心点位置); } private void 更新当前帧位置() { //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) if (刀身点 != null && 刀身点.Length >= 2) { if (当前帧刀身点位置 == null || 当前帧刀身点位置.Length != 刀身点.Length) { 当前帧刀身点位置 = (Vector3[])(object)new Vector3[刀身点.Length]; } for (int i = 0; i < 刀身点.Length && (Object)(object)刀身点[i] != (Object)null; i++) { 当前帧刀身点位置[i] = 刀身点[i].position; } } } private void 初始化组件() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown 网格过滤器 = ((Component)this).GetComponent(); if ((Object)(object)网格过滤器 == (Object)null) { 网格过滤器 = ((Component)this).gameObject.AddComponent(); } MeshRenderer val = ((Component)this).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)this).gameObject.AddComponent(); } if ((Object)(object)刀光拖尾网格 == (Object)null) { 刀光拖尾网格 = new Mesh(); ((Object)刀光拖尾网格).name = "刀光拖尾网格"; } 网格过滤器.mesh = 刀光拖尾网格; if ((Object)(object)拖尾材质 != (Object)null && (Object)(object)((Renderer)val).sharedMaterial != (Object)(object)拖尾材质) { ((Renderer)val).sharedMaterial = 拖尾材质; } if (刀身点 == null || 刀身点.Length < 2) { Debug.LogError((object)"刀光拖尾渲染器:需要至少2个刀身点!"); } } private float GetCurrentTime() { if (Application.isPlaying) { return Time.time; } return Time.timeSinceLevelLoad; } public void 启用() { 是否启用 = true; 上次生成时间 = GetCurrentTime(); 重置中心点记录(); } public void 禁用() { 是否启用 = false; } public void 切换启用状态() { 是否启用 = !是否启用; if (是否启用) { 上次生成时间 = GetCurrentTime(); 重置中心点记录(); } } public void 设置启用状态(bool 启用) { 是否启用 = 启用; if (是否启用) { 上次生成时间 = GetCurrentTime(); 重置中心点记录(); } } public void 立即清除拖尾() { 历史顶点列表.Clear(); if ((Object)(object)刀光拖尾网格 != (Object)null) { 刀光拖尾网格.Clear(); } 重置中心点记录(); } public void 设置使用距离触发(bool 启用) { 使用距离触发 = 启用; if (启用) { 重置中心点记录(); } } public void 切换触发模式() { 使用距离触发 = !使用距离触发; if (使用距离触发) { 重置中心点记录(); } } public bool 获取使用距离触发状态() { return 使用距离触发; } public void 设置触发移动距离(float 距离) { 触发移动距离 = Mathf.Max(0.01f, 距离); } public float 获取触发移动距离() { return 触发移动距离; } public void 设置拖尾中心点(Transform 中心点) { 拖尾中心点 = 中心点; 重置中心点记录(); } public void 设置保留当前帧(bool 保留) { 保留当前帧为永久顶点 = 保留; } public bool 获取保留当前帧状态() { return 保留当前帧为永久顶点; } public void 设置生成间隔时间(float 间隔时间) { 每次网格生成间隔时间 = Mathf.Max(0.01f, 间隔时间); } public void 设置拖尾存在时间(float 存在时间) { 每段网格存在时间 = Mathf.Max(0.1f, 存在时间); } public void 设置拖尾持续时间(float 持续时间) { 每段网格存在时间 = Mathf.Max(0.1f, 持续时间); } public void 设置每帧更新(bool 启用每帧更新) { 每帧更新 = 启用每帧更新; } public void 切换每帧更新() { 每帧更新 = !每帧更新; } public bool 获取每帧更新状态() { return 每帧更新; } public void 设置刀身点(Transform[] 新刀身点) { 刀身点 = 新刀身点; } public void 设置刀身点AtIndex(int 索引, Transform 刀身点Transform) { if (刀身点 != null && 索引 >= 0 && 索引 < 刀身点.Length) { 刀身点[索引] = 刀身点Transform; } } public void 清空历史数据() { 历史顶点列表.Clear(); 重置中心点记录(); } public void 设置拖尾材质(Material 新材质) { 拖尾材质 = 新材质; MeshRenderer component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)拖尾材质 != (Object)null) { ((Renderer)component).sharedMaterial = 拖尾材质; } } public void 设置材质颜色(Color 颜色) { //IL_0048: 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_009e: Unknown result type (might be due to invalid IL or missing references) MeshRenderer component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Renderer)component).sharedMaterial != (Object)null) { if (((Renderer)component).sharedMaterial.HasProperty("_Color")) { ((Renderer)component).sharedMaterial.SetColor("_Color", 颜色); } else if (((Renderer)component).sharedMaterial.HasProperty("_TintColor")) { ((Renderer)component).sharedMaterial.SetColor("_TintColor", 颜色); } else if (((Renderer)component).sharedMaterial.HasProperty("_MainColor")) { ((Renderer)component).sharedMaterial.SetColor("_MainColor", 颜色); } } } public void 设置材质透明度(float 透明度) { //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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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) MeshRenderer component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Renderer)component).sharedMaterial != (Object)null) { 透明度 = Mathf.Clamp01(透明度); if (((Renderer)component).sharedMaterial.HasProperty("_Color")) { Color color = ((Renderer)component).sharedMaterial.GetColor("_Color"); color.a = 透明度; ((Renderer)component).sharedMaterial.SetColor("_Color", color); } else if (((Renderer)component).sharedMaterial.HasProperty("_TintColor")) { Color color2 = ((Renderer)component).sharedMaterial.GetColor("_TintColor"); color2.a = 透明度; ((Renderer)component).sharedMaterial.SetColor("_TintColor", color2); } } } public void 设置编辑器模式下运行(bool 运行) { 编辑器模式下运行 = 运行; } public void 重置为默认设置() { 每次网格生成间隔时间 = 0.05f; 每段网格存在时间 = 0.5f; 每帧更新 = false; 保留当前帧为永久顶点 = true; 使用距离触发 = false; 触发移动距离 = 0.1f; 立即清除拖尾(); 重置中心点记录(); } public void 快速设置拖尾(float 持续时间, float 生成间隔 = 0.05f) { 每段网格存在时间 = Mathf.Max(0.1f, 持续时间); 每次网格生成间隔时间 = Mathf.Max(0.01f, 生成间隔); } private void 添加新顶点对() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (刀身点 == null || 刀身点.Length < 2) { return; } Vector3[] array = (Vector3[])(object)new Vector3[刀身点.Length]; for (int i = 0; i < 刀身点.Length; i++) { if ((Object)(object)刀身点[i] != (Object)null) { array[i] = 刀身点[i].position; continue; } return; } 历史顶点列表.Add(new 历史顶点(array, GetCurrentTime())); } private void 移除过期顶点对() { float currentTime = GetCurrentTime(); for (int num = 历史顶点列表.Count - 1; num >= 0; num--) { if (currentTime - 历史顶点列表[num].创建时间 > 每段网格存在时间) { 历史顶点列表.RemoveAt(num); } } } private void 更新网格() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) if (历史顶点列表.Count == 0 && 当前帧刀身点位置 == null) { 刀光拖尾网格.Clear(); return; } int num = 刀身点.Length; int count = 历史顶点列表.Count; int num2 = count; bool flag = 保留当前帧为永久顶点 && 当前帧刀身点位置 != null; if (flag) { num2++; } if (num2 < 2) { 刀光拖尾网格.Clear(); return; } Vector3[] array = (Vector3[])(object)new Vector3[num2 * num]; Vector2[] array2 = (Vector2[])(object)new Vector2[num2 * num]; int[] array3 = new int[(num2 - 1) * (num - 1) * 6]; float currentTime = GetCurrentTime(); Matrix4x4 worldToLocalMatrix = ((Component)this).transform.worldToLocalMatrix; for (int i = 0; i < count; i++) { 历史顶点 历史顶点 = 历史顶点列表[i]; for (int j = 0; j < num; j++) { int num3 = i * num + j; Vector3 val = 历史顶点.刀身点位置[j]; Vector3 val2 = ((Matrix4x4)(ref worldToLocalMatrix)).MultiplyPoint3x4(val); array[num3] = val2; float num4 = (float)i / (float)(num2 - 1); float num5 = (float)j / (float)(num - 1); array2[num3] = new Vector2(num4, num5); } } if (flag) { int num6 = num2 - 1; for (int k = 0; k < num; k++) { int num7 = num6 * num + k; Vector3 val3 = 当前帧刀身点位置[k]; Vector3 val4 = ((Matrix4x4)(ref worldToLocalMatrix)).MultiplyPoint3x4(val3); array[num7] = val4; float num8 = 1f; float num9 = (float)k / (float)(num - 1); array2[num7] = new Vector2(num8, num9); } } int num10 = 0; for (int l = 0; l < num2 - 1; l++) { for (int m = 0; m < num - 1; m++) { int num11 = l * num + m; int num12 = l * num + m + 1; int num13 = (l + 1) * num + m; int num14 = (l + 1) * num + m + 1; array3[num10++] = num11; array3[num10++] = num13; array3[num10++] = num12; array3[num10++] = num13; array3[num10++] = num14; array3[num10++] = num12; } } 刀光拖尾网格.Clear(); 刀光拖尾网格.vertices = array; 刀光拖尾网格.triangles = array3; 刀光拖尾网格.uv = array2; 刀光拖尾网格.RecalculateNormals(); 刀光拖尾网格.RecalculateBounds(); } private void OnDrawGizmosSelected() { //IL_004e: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) if (历史顶点列表 == null) { return; } for (int i = 0; i < 历史顶点列表.Count; i++) { 历史顶点 历史顶点 = 历史顶点列表[i]; float num = 1f - (float)i / (float)历史顶点列表.Count; Gizmos.color = new Color(1f, 0.5f, 0f, num); for (int j = 0; j < 历史顶点.刀身点位置.Length; j++) { Gizmos.DrawSphere(历史顶点.刀身点位置[j], 0.03f); if (j > 0) { Gizmos.DrawLine(历史顶点.刀身点位置[j - 1], 历史顶点.刀身点位置[j]); } } if (i > 0) { 历史顶点 历史顶点2 = 历史顶点列表[i - 1]; Gizmos.color = new Color(0f, 1f, 0f, num * 0.5f); for (int k = 0; k < 历史顶点.刀身点位置.Length; k++) { Gizmos.DrawLine(历史顶点2.刀身点位置[k], 历史顶点.刀身点位置[k]); } } } if (保留当前帧为永久顶点 && 当前帧刀身点位置 != null) { Gizmos.color = Color.red; for (int l = 0; l < 当前帧刀身点位置.Length; l++) { Gizmos.DrawSphere(当前帧刀身点位置[l], 0.05f); if (l > 0) { Gizmos.DrawLine(当前帧刀身点位置[l - 1], 当前帧刀身点位置[l]); } } if (历史顶点列表.Count > 0) { 历史顶点 历史顶点3 = 历史顶点列表[历史顶点列表.Count - 1]; Gizmos.color = Color.yellow; for (int m = 0; m < 当前帧刀身点位置.Length; m++) { Gizmos.DrawLine(历史顶点3.刀身点位置[m], 当前帧刀身点位置[m]); } } } if ((Object)(object)拖尾中心点 != (Object)null) { Gizmos.color = Color.cyan; Gizmos.DrawSphere(拖尾中心点.position, 0.08f); if (刀身点 != null && 刀身点.Length != 0 && (Object)(object)刀身点[0] != (Object)null) { Gizmos.color = new Color(0f, 1f, 1f, 0.5f); Gizmos.DrawLine(拖尾中心点.position, 刀身点[0].position); } } } } public class 地面冲击 : MonoBehaviour { public float 射线距离 = 15f; public LayerMask 检测层级 = LayerMask.op_Implicit(512); private Vector3 检测到的位置; private Vector3 当前物体默认位置; private bool 物体位置保持在地面位置; private void Start() { //IL_0008: 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) 当前物体默认位置 = ((Component)this).transform.localPosition; } private void Update() { //IL_000d: 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) if (物体位置保持在地面位置) { _ = 检测到的位置; if (0 == 0) { ((Component)this).transform.position = 检测到的位置; } } } public void 物体回归原位() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.localPosition = 当前物体默认位置; 物体位置保持在地面位置 = false; } public void 生成地面预制体并使物体在地面(GameObject gameObject1) { 发射射线并生成(gameObject1, d: true); } public void 生成地面预制体(GameObject gameObject1) { 发射射线并生成(gameObject1); } private void 发射射线并生成(GameObject prefabToPlace, bool d = false) { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) Vector3 position = ((Component)this).transform.position; RaycastHit val = default(RaycastHit); if (Physics.Raycast(position, Vector3.down, ref val, 射线距离, LayerMask.op_Implicit(检测层级))) { TeamHolder.AddTeamHolder(Object.Instantiate(prefabToPlace, 检测到的位置 = ((RaycastHit)(ref val)).point + Vector3.up * 0.05f, Quaternion.identity), ((Component)this).gameObject); if (d) { 物体位置保持在地面位置 = true; } } else { 检测到的位置 = ((Component)this).transform.position; Debug.Log((object)"未检测到地面"); } } } public class 战斗开始时事件 : MonoBehaviour { private GameStateManager man; private bool 已开始 = false; public UnityEvent 开始战斗事件; private void Start() { man = ServiceLocator.GetService(); if (man == null) { Debug.LogError((object)"GameStateManager not found in ServiceLocator"); } } private void Update() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 if (!已开始 && (int)man.GameState == 1) { UnityEvent obj = 开始战斗事件; if (obj != null) { obj.Invoke(); } 已开始 = true; ((Behaviour)this).enabled = false; } } } }