Beispiel #1
0
 private void UpdateFromExternalData(ROLFairingUpdateData eData)
 {
     //MonoBehaviour.print("Updating fairing from external interaction ");
     if (fairingParts == null)
     {
         MonoBehaviour.print("ERROR: Fairing parts are null for external update");
     }
     foreach (ROLNodeFairingData data in fairingParts)
     {
         if (eData.hasTopY)
         {
             if (eData.topY != data.topY)
             {
                 needsRebuilt = fairingCreated;
             }
             data.topY = eData.topY;
             //MonoBehaviour.print("Set top pos: " + eData.topY);
         }
         if (eData.hasBottomY)
         {
             if (eData.bottomY != data.bottomY)
             {
                 needsRebuilt = fairingCreated;
             }
             data.bottomY = eData.bottomY;
             //MonoBehaviour.print("Set bot pos: " + eData.bottomY);
         }
         if (eData.hasTopRad && data.canAdjustTop)
         {
             if (eData.topRadius != data.topRadius)
             {
                 needsRebuilt = fairingCreated;
             }
             data.topRadius = eData.topRadius;
             guiTopDiameter = data.topRadius * 2f;
             //MonoBehaviour.print("Set top rad: " + eData.topRadius);
         }
         if (eData.hasBottomRad && data.canAdjustBottom)
         {
             if (eData.bottomRadius != data.bottomRadius)
             {
                 needsRebuilt = fairingCreated;
             }
             data.bottomRadius = eData.bottomRadius;
             guiBottomDiameter = data.bottomRadius * 2f;
             //MonoBehaviour.print("Set bot rad: " + eData.bottomRadius);
         }
         if (eData.noseNode != data.noseNode)
         {
             data.noseNode = eData.noseNode;
         }
         if (eData.mountNode != data.mountNode)
         {
             data.mountNode = eData.mountNode;
         }
     }
     if (eData.hasEnable)
     {
         fairingForceDisabled = !eData.enable;
         //MonoBehaviour.print("Set enable: " + eData.enable);
     }
     else
     {
         fairingForceDisabled = false;//default to NOT force disabled
     }
     if (fairingCreated && fairingForceDisabled)
     {
         needsRebuilt = false;
         DestroyFairing();
     }
     else
     {
         needsStatusUpdate = true;
     }
     needsGuiUpdate     = true;
     externalUpdateData = null;
 }
Beispiel #2
0
 public void UpdateExternal(ROLFairingUpdateData data)
 {
     externalUpdateData = data;
 }