removeShieldArea() public method

public removeShieldArea ( String name ) : void
name String
return void
        private void updateShieldingStatus()
        {
            SSTUAirstreamShield shield = part.GetComponent <SSTUAirstreamShield>();

            if (shield != null)
            {
                if (currentlyEnabled)
                {
                    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;
                    FairingData 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));
                }
            }
        }
Beispiel #2
0
        private void updateShieldStatus()
        {
            SSTUAirstreamShield shield = part.GetComponent <SSTUAirstreamShield>();

            if (shield != null)
            {
                string name = "InterstageFairingShield" + "" + part.Modules.IndexOf(this);
                if (state == InterstageFairingState.RETRACTED)
                {
                    float top       = currentHeight;;
                    float bottom    = 0f;
                    float topRad    = topDiameter * 0.5f;
                    float botRad    = bottomDiameter * 0.5f;
                    bool  useTop    = true;
                    bool  useBottom = false;
                    shield.addShieldArea(name, topRad, botRad, top, bottom, useTop, useBottom);
                }
                else
                {
                    shield.removeShieldArea(name);
                }
            }
        }