コード例 #1
0
        private void updateAnimation()
        {
            float dir   = state == InterstageFairingState.DEPLOYING ? 1 : -1;
            float delta = TimeWarp.fixedDeltaTime * animationSpeed * dir;

            currentRotation += delta;
            if (state == InterstageFairingState.DEPLOYING && currentRotation >= deployedRotation)
            {
                currentRotation = deployedRotation;
                setPanelRotations(currentRotation);
                state = InterstageFairingState.DEPLOYED;
                if (jettisonPanels)
                {
                    jettisonFairingPanels();
                }
                updateGuiState();
            }
            else if (state == InterstageFairingState.RETRACTING && currentRotation <= 0)
            {
                currentRotation = 0;
                setPanelRotations(currentRotation);
                state = InterstageFairingState.RETRACTED;
                updateShieldStatus();
                updateGuiState();
            }
            else
            {
                setPanelRotations(currentRotation);
            }
            updateDragCube();
        }
コード例 #2
0
 private void onRetractEvent()
 {
     if (state == InterstageFairingState.DEPLOYING || state == InterstageFairingState.DEPLOYED)
     {
         state = InterstageFairingState.RETRACTING;
         updateGuiState();
     }
 }
コード例 #3
0
 private void onDeployEvent()
 {
     if (state == InterstageFairingState.RETRACTED || state == InterstageFairingState.RETRACTING)
     {
         state = InterstageFairingState.DEPLOYING;
         if (autoDecoupleUpper)
         {
             decoupleByModule(topDecouplerModuleIndex);
         }
         updateShieldStatus();
         updateGuiState();
     }
 }
コード例 #4
0
 private void jettisonFairingPanels()
 {
     state = InterstageFairingState.JETTISONED;
     fairingBase.jettisonPanels(part, 10, Vector3.forward, 0.1f);
 }