updateEngineThrust() public static method

public static updateEngineThrust ( ModuleEngines engine, float minThrust, float maxThrust ) : void
engine ModuleEngines
minThrust float
maxThrust float
return void
Beispiel #1
0
        private void updateEngineThrust()
        {
            ModuleEngines engine = part.GetComponent <ModuleEngines>();

            if (engine != null)
            {
                float scale           = getEngineScale();
                float thrustScalar    = Mathf.Pow(scale, thrustScalePower);
                float thrustPerEngine = engineThrust * thrustScalar;
                float totalThrust     = thrustPerEngine * engineModels.model.numberOfEngines;
                guiEngineThrust = totalThrust;
                SSTUStockInterop.updateEngineThrust(engine, engine.minThrust, totalThrust);
            }
            else
            {
                print("Cannot update engine thrust -- no engine module found!");
                guiEngineThrust = 0;
            }
        }