addShieldArea() публичный Метод

public addShieldArea ( String name, float topRad, float bottomRad, float topY, float bottomY, bool topNode, bool bottomNode ) : void
name String
topRad float
bottomRad float
topY float
bottomY float
topNode bool
bottomNode bool
Результат void
Пример #1
0
        private void updateShielding()
        {
            if (!shieldsParts)
            {
                return;
            }
            SSTUAirstreamShield shield = part.GetComponent <SSTUAirstreamShield>();

            if (shield != null)
            {
                shield.addShieldArea("ISDC-Shielding", currentTopDiameter * 0.5f, currentTopDiameter * 0.5f, currentHeight * 0.5f, -currentHeight * 0.5f, true, true);
            }
        }
Пример #2
0
        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));
                }
            }
        }
Пример #3
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);
                }
            }
        }