private void updateShieldingStatus() { ModuleROTAirstreamShield shield = part.GetComponent <ModuleROTAirstreamShield>(); if (shield != null) { if (fairingCreated) { string name = fairingName + "" + part.Modules.IndexOf(this); float top = float.NegativeInfinity, bottom = float.PositiveInfinity, topRad = 0, botRad = 0; bool useTop = false, useBottom = false; if (!string.IsNullOrEmpty(nodeName)) { useTop = nodeName == "top"; useBottom = nodeName == "bottom"; } int len = fairingParts.Length; ROTFairingData fp; for (int i = 0; i < len; i++) { fp = fairingParts[i]; if (fp.topY > top) { top = fp.topY; } if (fp.bottomY < bottom) { bottom = fp.bottomY; } if (fp.topRadius > topRad) { topRad = fp.topRadius; } if (fp.bottomRadius > botRad) { botRad = fp.bottomRadius; } } shield.addShieldArea(name, topRad, botRad, top, bottom, useTop, useBottom); } else { shield.removeShieldArea(fairingName + "" + part.Modules.IndexOf(this)); } } }
public void updateShieldStatus(Part p, List <Part> shieldedParts) { ModuleROTAirstreamShield.findShieldedPartsCylinder(p, shieldedParts, topY, bottomY, topRadius, bottomRadius); }