private string UnitToMeter(string text) { try { float worldScale = HLVRSettingsManager.ModSettings.GetWorldScale(); return(I18N.IntToString((int)(I18N.ParseFloat(text) * UNIT_TO_CM * worldScale))); } catch (Exception) { return(""); } }
private string MeterToUnit(string text) { try { float worldScale = HLVRSettingsManager.ModSettings.GetWorldScale(); float invWorldScale = worldScale != 0 ? 1 / worldScale : 0; return(I18N.IntToString((int)(I18N.ParseFloat(text) * CM_TO_UNIT * invWorldScale))); } catch (Exception) { return(""); } }