private void updateEngineThrust() { float currentScale = getScale(); float thrustScalar = Mathf.Pow(currentScale, thrustScalePower); float maxThrust = engineThrust * thrustScalar; guiEngineThrust = maxThrust; ModuleEngines[] engines = part.GetComponents <ModuleEngines>(); foreach (ModuleEngines engine in engines) { SSTUStockInterop.updateEngineThrust(engine, engine.minThrust, maxThrust); } }
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 * numberOfEngines; guiEngineThrust = totalThrust; SSTUStockInterop.updateEngineThrust(engine, engine.minThrust, totalThrust); } else { print("Cannot update engine thrust -- no engine module found!"); guiEngineThrust = 0; } }