public GetModuleCost ( float defaultCost, ModifierStagingSituation sit ) : float | ||
defaultCost | float | |
sit | ModifierStagingSituation | |
return | float |
public float GetModuleCost(float defaultCost, ModifierStagingSituation sit)
{
double cst = 0;
if (baseCostPV >= 0) {
cst = volume * baseCostPV;
if (PartResourceLibrary.Instance != null && tankList != null) {
for (int i = 0; i < tankList.Count; i++) {
FuelTank t = tankList[i];
if (t.resource != null) {
PartResourceDefinition d = PartResourceLibrary.Instance.GetDefinition (t.resource.resourceName);
if (d != null) {
cst += t.maxAmount * (d.unitCost + t.cost / t.utilization);
}
}
}
}
}
return (float)cst;
}
void DisplayMass() { GUILayout.BeginHorizontal(); GUILayout.Label("Mass: " + tank_module.massDisplay + ", Cst " + tank_module.GetModuleCost(0).ToString("N1")); GUILayout.EndHorizontal(); }