setEnable() public method

public setEnable ( bool val ) : void
val bool
return void
示例#1
0
        private void updateFairing(bool userInput)
        {
            if (!standAlonePart)
            {
                return;
            }
            SSTUNodeFairing fairing = part.GetComponent <SSTUNodeFairing>();

            if (fairing == null)
            {
                return;
            }
            fairing.canDisableInEditor = true;
            FairingUpdateData data = new FairingUpdateData();

            data.setTopY(model.fairingTop);
            //bottom-y set by 'snap to node' functionality in nodefairing
            data.setTopRadius(currentDiameter * 0.5f);
            if (userInput)
            {
                data.setBottomRadius(currentDiameter * 0.5f);
            }
            data.setEnable(true);
            fairing.updateExternal(data);
        }
示例#2
0
        protected virtual void updateFairing()
        {
            SSTUNodeFairing fairing = part.GetComponent <SSTUNodeFairing>();

            if (fairing == null)
            {
                return;
            }
            float             pos  = currentMountModule.currentVerticalPosition + (currentMountModule.currentHeightScale * currentMountModule.modelDefinition.fairingTopOffset);
            FairingUpdateData data = new FairingUpdateData();

            data.setTopY(pos);
            data.setTopRadius(currentTankDiameter * 0.5f);
            if (currentMountModule.modelDefinition.fairingDisabled)
            {
                data.setEnable(false);
            }
            fairing.updateExternal(data);
        }
        private void updateFairing(bool userInput)
        {
            SSTUNodeFairing fairing = part.GetComponent <SSTUNodeFairing>();

            if (fairing == null)
            {
                return;
            }
            fairing.canDisableInEditor = true;
            FairingUpdateData data = new FairingUpdateData();

            data.setTopY(model.model.currentHeight * 0.5f + model.model.getFairingOffset());
            data.setTopRadius(currentDiameter * 0.5f);
            if (userInput)
            {
                data.setBottomRadius(currentDiameter * 0.5f);
            }
            data.setEnable(true);
            fairing.updateExternal(data);
        }
 /// <summary>
 /// Updates the position and enable/disable status of the SSTUNodeFairing (if present). <para/>
 /// </summary>
 private void updateFairing(bool userInput)
 {
     SSTUNodeFairing fairing = part.GetComponent<SSTUNodeFairing>();
     if (fairing == null) { return; }
     bool enable = !currentMountData.modelDefinition.fairingDisabled;
     AttachNode node = part.FindAttachNode("top");
     // this was an attempt to fix fairing interaction between tanks and engines;
     // unfortunately it results in the engine fairing being permanently disabled
     // whenever it is mounted below a tank regardless of the tanks current fairing
     // status; rendering the fairings completely unusable for the engines even when
     // they are using a mount that should have fairings enabled.
     //if (node != null && node.attachedPart != null)
     //{
     //    Part p = node.attachedPart;
     //    SSTUNodeFairing[] fs = p.GetComponents<SSTUNodeFairing>();
     //    int len = fs.Length;
     //    for (int i = 0; i < len; i++)
     //    {
     //        //TODO find lowest node and check for that rather than static bottom reference ?
     //        if (fs[i].nodeName == "bottom" && fs[i].snapToSecondNode)//if it watches bottom node and is set to snap to second node; i.e. it would shroud this engine, so disable the engines' own shroud.
     //        {
     //            enable = false;
     //            break;
     //        }
     //    }
     //}
     fairing.canDisableInEditor = enable;
     FairingUpdateData data = new FairingUpdateData();
     data.setTopY(fairingTopY);
     data.setTopRadius(currentMountDiameter * 0.5f);
     if (userInput)
     {
         data.setBottomRadius(currentMountDiameter * 0.5f);
     }
     data.setEnable(enable);
     fairing.updateExternal(data);
 }
 private void updateFairing(bool userInput)
 {
     SSTUNodeFairing fairing = part.GetComponent<SSTUNodeFairing>();
     if (fairing == null) { return; }
     fairing.canDisableInEditor = true;
     FairingUpdateData data = new FairingUpdateData();
     data.setTopY(mainModelData.currentHeight * 0.5f);
     data.setTopRadius(currentDiameter * 0.5f);
     if (userInput)
     {
         data.setBottomRadius(currentDiameter * 0.5f);
     }
     data.setEnable(true);
     fairing.updateExternal(data);
 }