Пример #1
0
        public void FixedUpdate()
        {
            if (!HighLogic.LoadedSceneIsFlight)
            {
                return;
            }

            //Run compressor/decompressor
            if (liftCapacityState == LiftCapacityStates.Decreasing && currentVolume > 0)
            {
                currentVolume -= (compressorRate * envelopeVolume) * TimeWarp.fixedDeltaTime;
                if (currentVolume < 0)
                {
                    currentVolume     = 0;
                    liftCapacityState = LiftCapacityStates.Empty;
                }
            }
            else if (liftCapacityState == LiftCapacityStates.Increasing && currentVolume < envelopeVolume)
            {
                currentVolume += (compressorRate * envelopeVolume) * TimeWarp.fixedDeltaTime;
                if (currentVolume >= envelopeVolume)
                {
                    currentVolume     = envelopeVolume;
                    liftCapacityState = LiftCapacityStates.Maximum;
                }
            }

            //Apply lift
            applyPerPartLift();
        }
Пример #2
0
        protected void updateCompressorStates(LiftCapacityStates liftCapacityState)
        {
            int count = liftModules.Count;

            for (int index = 0; index < count; index++)
            {
                liftModules[index].liftCapacityState = liftCapacityState;
            }
        }
Пример #3
0
 public void StopLiftCapacityChange()
 {
     liftCapacityState = LiftCapacityStates.Stopped;
 }
Пример #4
0
 public void DecreaseLiftCapacity()
 {
     liftCapacityState = LiftCapacityStates.Decreasing;
 }
Пример #5
0
 public void IncreaseLiftCapacity()
 {
     liftCapacityState = LiftCapacityStates.Increasing;
 }