Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of Parry v1.3.1
Parry.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using EntityStates; using EntityStates.Merc; using Microsoft.CodeAnalysis; using On.RoR2; using R2API; using RoR2; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Parry")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+454e438b8916d1bf466f0c2d603128b67fb3887b")] [assembly: AssemblyProduct("Parry")] [assembly: AssemblyTitle("Parry")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Parry { [BepInPlugin("com.Nuxlar.Parry", "Parry", "1.3.1")] public class Parry : BaseUnityPlugin { private AssetBundle parryAssets; private Sprite parryIcon; private Sprite parryBuffIcon; private Sprite parryActivatedBuffIcon; public static BuffDef parryBuffDef; public static BuffDef parryActivatedBuffDef; private GameObject merc = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercBody.prefab").WaitForCompletion(); public static GameObject parryImpact = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/ImpactMercFocusedAssault.prefab").WaitForCompletion(); public static GameObject parryFunImpact = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainAirstrikeAltImpact.prefab").WaitForCompletion(); public static SkillDef parrySkillDef = ScriptableObject.CreateInstance<SkillDef>(); private static BodyIndex mercBodyIndex; public static ConfigEntry<float> parryFunDamageMultiplier; public static ConfigEntry<float> parryFunRadius; public static ConfigEntry<bool> parryFunEnabled; private static ConfigFile ParryConfig { get; set; } public void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_00e8: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown ParryConfig = new ConfigFile(Paths.ConfigPath + "\\com.Nuxlar.Parry.cfg", true); parryFunDamageMultiplier = ParryConfig.Bind<float>("General", "Fun Mode Damage Multiplier", 20f, "This number is multiplied by the base 500% damage, so 20 would be 10000% damage."); parryFunRadius = ParryConfig.Bind<float>("General", "Fun Mode Damage Radius", 26f, "How large the retalitory strike radius is in fun mode."); parryFunEnabled = ParryConfig.Bind<bool>("General", "Enable Fun Mode", false, "Parry but fun."); parryAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "parrybundle.bundle")); parryIcon = parryAssets.LoadAsset<Sprite>("Assets/parryIconNux.png"); parryBuffIcon = parryAssets.LoadAsset<Sprite>("Assets/parryBuffIconNux.png"); parryActivatedBuffIcon = parryAssets.LoadAsset<Sprite>("Assets/parryActivatedBuffIconNux.png"); bool flag = default(bool); ContentAddition.AddEntityState<ParryHold>(ref flag); ContentAddition.AddEntityState<ParryStrike>(ref flag); CreateParryBuffs(); CreateParrySkill(); ParryStrike.parrySoundDef = CreateNetworkSoundEventDef("Play_nux_parry"); ParryStrike.evisSoundDef = CreateNetworkSoundEventDef("Play_merc_sword_impact"); HealthComponent.TakeDamage += new hook_TakeDamage(TakeDamageHook); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); } private void OnLoad() { //IL_0005: 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) mercBodyIndex = BodyCatalog.FindBodyIndex("MercBody"); } private void TakeDamageHook(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //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) if (NetworkServer.active && self.body.bodyIndex == mercBodyIndex && self.body.HasBuff(parryBuffDef) && damageInfo.damage > 0f) { HandleParryBuffsServer(self.body); } else { orig.Invoke(self, damageInfo); } } public static void HandleParryBuffsServer(CharacterBody body) { if (body.HasBuff(parryBuffDef)) { body.RemoveBuff(parryBuffDef); } if (!body.HasBuff(parryActivatedBuffDef)) { body.AddBuff(parryActivatedBuffDef); } body.AddTimedBuff(Buffs.Immune, ParryStrike.invulnDuration); } private void CreateParryBuffs() { //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_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) parryBuffDef = ScriptableObject.CreateInstance<BuffDef>(); ((Object)parryBuffDef).name = "ParryBuffNux"; parryBuffDef.canStack = false; parryBuffDef.isCooldown = false; parryBuffDef.isDebuff = false; parryBuffDef.buffColor = Color.cyan; parryBuffDef.iconSprite = parryBuffIcon; ((Object)parryBuffDef).name = ((Object)parryBuffDef).name; parryActivatedBuffDef = ScriptableObject.CreateInstance<BuffDef>(); ((Object)parryActivatedBuffDef).name = "ParryActivatedBuffNux"; parryActivatedBuffDef.canStack = false; parryActivatedBuffDef.isCooldown = false; parryActivatedBuffDef.isDebuff = false; parryActivatedBuffDef.buffColor = Color.cyan; parryActivatedBuffDef.iconSprite = parryActivatedBuffIcon; ((Object)parryActivatedBuffDef).name = ((Object)parryActivatedBuffDef).name; ContentAddition.AddBuffDef(parryBuffDef); ContentAddition.AddBuffDef(parryActivatedBuffDef); } private void CreateParrySkill() { //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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_018f: Expected O, but got Unknown //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) parrySkillDef.skillName = "FocusedStrike"; ((Object)parrySkillDef).name = "FocusedStrike"; parrySkillDef.skillNameToken = "Focused Strike"; parrySkillDef.skillDescriptionToken = "Ready your blade, release before an incoming strike to <style=cIsUtility>parry</style> enemy attacks for <style=cIsDamage>500%-1500% damage to all nearby enemies.</style>"; parrySkillDef.icon = parryIcon; parrySkillDef.activationState = new SerializableEntityStateType(typeof(ParryHold)); parrySkillDef.activationStateMachineName = "Body"; parrySkillDef.interruptPriority = (InterruptPriority)2; parrySkillDef.baseMaxStock = 1; parrySkillDef.baseRechargeInterval = 5f; parrySkillDef.rechargeStock = 1; parrySkillDef.requiredStock = 1; parrySkillDef.stockToConsume = 1; parrySkillDef.dontAllowPastMaxStocks = false; parrySkillDef.beginSkillCooldownOnSkillEnd = false; parrySkillDef.canceledFromSprinting = false; parrySkillDef.forceSprintDuringState = false; parrySkillDef.fullRestockOnAssign = true; parrySkillDef.resetCooldownTimerOnUse = false; parrySkillDef.isCombatSkill = true; parrySkillDef.mustKeyPress = false; parrySkillDef.cancelSprintingOnActivation = true; ContentAddition.AddSkillDef(parrySkillDef); SkillFamily skillFamily = merc.GetComponent<SkillLocator>().secondary.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = parrySkillDef }; ((Variant)(ref val)).viewableNode = new Node(parrySkillDef.skillNameToken, false, (Node)null); variants[num] = val; } public static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef obj = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); obj.akId = AkSoundEngine.GetIDFromString(eventName); obj.eventName = eventName; ContentAddition.AddNetworkSoundEventDef(obj); return obj; } } public class ParryHold : BaseState { public static float baseMinDuration = 0f; public static string readySoundString = "Play_merc_sword_impact"; private bool playedSound; private float minDuration; public override void OnEnter() { ((BaseState)this).OnEnter(); playedSound = false; minDuration = baseMinDuration / base.attackSpeedStat; ((EntityState)this).PlayCrossfade("FullBody, Override", "GroundLight2", "GroundLight.playbackRate", 999f, 0.05f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); bool flag = ((EntityState)this).fixedAge >= minDuration; if (flag && !playedSound) { playedSound = true; Util.PlaySound(readySoundString, ((EntityState)this).gameObject); } if (((EntityState)this).isAuthority && (!Object.op_Implicit((Object)(object)((EntityState)this).inputBank) || !((EntityState)this).inputBank.skill2.down) && flag) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ParryStrike()); } } } public class ParryStrike : BaseState { public static NetworkSoundEventDef parrySoundDef; public static NetworkSoundEventDef evisSoundDef; public static float totalDuration = 0.35f; public static float attackDelay = 0.3f; public static float invulnDuration = 1f; public static float blastAttackDamageCoefficient = 5f; public static float projectileGrazeRadius = 3f; private bool hasFiredServer; private bool hasFiredClient; public override void OnEnter() { ((BaseState)this).OnEnter(); if (NetworkServer.active) { CleanBuffsServer(); if (!((EntityState)this).characterBody.HasBuff(Parry.parryBuffDef)) { ((EntityState)this).characterBody.AddBuff(Parry.parryBuffDef); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= attackDelay) { if (!hasFiredClient) { DoAttackClient(); } if (NetworkServer.active && !hasFiredServer) { DoAttackServer(); } } else { CheckProjectileGrazeServer(); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= totalDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (NetworkServer.active) { if (!hasFiredServer) { DoAttackServer(); } CleanBuffsServer(); } ((EntityState)this).PlayAnimation("FullBody, Override", "UppercutExit"); ((EntityState)this).OnExit(); } private void CleanBuffsServer() { if (NetworkServer.active) { if (((EntityState)this).characterBody.HasBuff(Parry.parryActivatedBuffDef)) { ((EntityState)this).characterBody.RemoveBuff(Parry.parryActivatedBuffDef); } if (((EntityState)this).characterBody.HasBuff(Parry.parryBuffDef)) { ((EntityState)this).characterBody.RemoveBuff(Parry.parryBuffDef); } } } private void DoAttackClient() { hasFiredClient = true; ((EntityState)this).PlayCrossfade("FullBody, Override", "Uppercut", "Uppercut.playbackRate", 1f, totalDuration - attackDelay); Util.PlaySound("Play_merc_m2_uppercut", ((EntityState)this).gameObject); } private void DoAttackServer() { //IL_002e: 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_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_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_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_01ef: 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_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_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0210: 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_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: 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_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0272: 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_0278: 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_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_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_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_015b: 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_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_017f: 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_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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01ca: 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_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01df: 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_028a: 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_00a2: 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_00b5: 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_02a4: 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) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { return; } hasFiredServer = true; bool num = ((EntityState)this).characterBody.HasBuff(Parry.parryActivatedBuffDef); DamageType val = (DamageType)32; float num2 = blastAttackDamageCoefficient; float num3 = 13f; if (num) { if (Parry.parryFunEnabled.Value) { DeleteProjectilesServer(((EntityState)this).characterBody.radius + Parry.parryFunRadius.Value); num2 *= Parry.parryFunDamageMultiplier.Value; } else { DeleteProjectilesServer(((EntityState)this).characterBody.radius + 13f); num2 *= 3f; num3 = 24f; } val = (DamageType)(val | 0x800000); if (Object.op_Implicit((Object)(object)parrySoundDef)) { EffectManager.SimpleSoundEffect(parrySoundDef.index, ((EntityState)this).characterBody.corePosition, true); } } EffectManager.SimpleImpactEffect(Evis.hitEffectPrefab, ((EntityState)this).characterBody.corePosition, Vector3.one, true); EffectManager.SimpleImpactEffect(Evis.hitEffectPrefab, ((EntityState)this).characterBody.corePosition, Vector3.zero, true); EffectManager.SimpleImpactEffect(Evis.hitEffectPrefab, ((EntityState)this).characterBody.corePosition, Vector3.left, true); EffectManager.SimpleImpactEffect(Evis.hitEffectPrefab, ((EntityState)this).characterBody.corePosition, Vector3.right, true); Result val2 = ((!Parry.parryFunEnabled.Value) ? new BlastAttack { impactEffect = EffectCatalog.FindEffectIndexFromPrefab(Evis.hitEffectPrefab), attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject), baseDamage = base.damageStat * num2, baseForce = 250f, position = ((EntityState)this).characterBody.corePosition, radius = ((EntityState)this).characterBody.radius + num3, falloffModel = (FalloffModel)0, damageType = DamageTypeCombo.op_Implicit(val), attackerFiltering = (AttackerFiltering)2 }.Fire() : new BlastAttack { impactEffect = EffectCatalog.FindEffectIndexFromPrefab(Parry.parryFunImpact), attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject), baseDamage = base.damageStat * num2, baseForce = 10000f, position = ((EntityState)this).characterBody.corePosition, radius = ((EntityState)this).characterBody.radius + Parry.parryFunRadius.Value, falloffModel = (FalloffModel)0, damageType = DamageTypeCombo.op_Implicit(val), attackerFiltering = (AttackerFiltering)2 }.Fire()); if (val2.hitCount > 0 && Object.op_Implicit((Object)(object)evisSoundDef)) { EffectManager.SimpleSoundEffect(evisSoundDef.index, ((EntityState)this).characterBody.corePosition, true); } CleanBuffsServer(); } private void CheckProjectileGrazeServer() { //IL_0039: 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_00b0: 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) if (!NetworkServer.active || projectileGrazeRadius <= 0f || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || !((EntityState)this).characterBody.HasBuff(Parry.parryBuffDef)) { return; } Collider[] array = Physics.OverlapSphere(((EntityState)this).characterBody.corePosition, projectileGrazeRadius + ((EntityState)this).characterBody.radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.projectile)).mask)); for (int i = 0; i < array.Length; i++) { ProjectileController componentInParent = ((Component)array[i]).GetComponentInParent<ProjectileController>(); if (Object.op_Implicit((Object)(object)componentInParent) && !componentInParent.cannotBeDeleted && (Object)(object)componentInParent.owner != (Object)(object)((EntityState)this).gameObject && (!Object.op_Implicit((Object)(object)componentInParent.teamFilter) || componentInParent.teamFilter.teamIndex != ((BaseState)this).GetTeam())) { bool flag = false; ProjectileSimple component = ((Component)componentInParent).gameObject.GetComponent<ProjectileSimple>(); ProjectileCharacterController component2 = ((Component)componentInParent).gameObject.GetComponent<ProjectileCharacterController>(); if ((!Object.op_Implicit((Object)(object)component) || (Object.op_Implicit((Object)(object)component) && component.desiredForwardSpeed == 0f)) && !Object.op_Implicit((Object)(object)component2)) { flag = true; } if (!flag) { Parry.HandleParryBuffsServer(((EntityState)this).characterBody); break; } } } } private void DeleteProjectilesServer(float radius) { //IL_000c: 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_007c: 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) List<ProjectileController> list = new List<ProjectileController>(); Collider[] array = Physics.OverlapSphere(((EntityState)this).characterBody.corePosition, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.projectile)).mask)); for (int i = 0; i < array.Length; i++) { ProjectileController componentInParent = ((Component)array[i]).GetComponentInParent<ProjectileController>(); if (Object.op_Implicit((Object)(object)componentInParent) && !componentInParent.cannotBeDeleted && (Object)(object)componentInParent.owner != (Object)(object)((EntityState)this).gameObject && (!Object.op_Implicit((Object)(object)componentInParent.teamFilter) || componentInParent.teamFilter.teamIndex != ((BaseState)this).GetTeam())) { bool flag = false; ProjectileSimple component = ((Component)componentInParent).gameObject.GetComponent<ProjectileSimple>(); ProjectileCharacterController component2 = ((Component)componentInParent).gameObject.GetComponent<ProjectileCharacterController>(); if ((!Object.op_Implicit((Object)(object)component) || (Object.op_Implicit((Object)(object)component) && component.desiredForwardSpeed == 0f)) && !Object.op_Implicit((Object)(object)component2)) { flag = true; } if (!flag && !list.Contains(componentInParent)) { list.Add(componentInParent); } } } int count = list.Count; for (int j = 0; j < count; j++) { GameObject gameObject = ((Component)list[j]).gameObject; if (Object.op_Implicit((Object)(object)gameObject)) { EntityState.Destroy((Object)(object)gameObject); } } } } }