Esempio n. 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();
        }
        protected void updateCompressorStates(LiftCapacityStates liftCapacityState)
        {
            int count = liftModules.Count;

            for (int index = 0; index < count; index++)
            {
                liftModules[index].liftCapacityState = liftCapacityState;
            }
        }
Esempio n. 3
0
 public void StopLiftCapacityChange()
 {
     liftCapacityState = LiftCapacityStates.Stopped;
 }
Esempio n. 4
0
 public void DecreaseLiftCapacity()
 {
     liftCapacityState = LiftCapacityStates.Decreasing;
 }
Esempio n. 5
0
 public void IncreaseLiftCapacity()
 {
     liftCapacityState = LiftCapacityStates.Increasing;
 }