예제 #1
0
 public void onUserSizeChange(float newDiameter, bool updateSymmetry)
 {
     if (newDiameter > maxDiameter)
     {
         newDiameter = maxDiameter;
     }
     if (newDiameter > techLimitMaxDiameter)
     {
         newDiameter = techLimitMaxDiameter;
     }
     if (newDiameter < minDiameter)
     {
         newDiameter = minDiameter;
     }
     currentDiameter = newDiameter;
     updateModelScale();
     mpf.DeleteFairing();
     updateNodePositions(true);
     updateEditorFields();
     if (updateSymmetry)
     {
         foreach (Part p in part.symmetryCounterparts)
         {
             p.GetComponent <SSTUResizableFairing>().onUserSizeChange(currentDiameter, false);
         }
     }
 }
        public void RemovePart(GameEvents.HostTargetAction <Part, Part> RemovedPart)
        {
            if (null == FairingModule)
            {
                return;
            }

            if (RemovedPart.target == part)
            {
                if (FairingModule.xSections.Count > 0)
                {
                    Debug.LogWarning("Deleting Fairing");
                    FairingModule.DeleteFairing();
                }
                MethodInfo MPFMethod = FairingModule.GetType().GetMethod("DumpInterstage", BindingFlags.NonPublic | BindingFlags.Instance);

                if (MPFMethod != null)
                {
                    MPFMethod.Invoke(FairingModule, new object[] { });
                }
            }
        }