string GetBuyAllText(int amount) { if (buyAllTranslation == null) { buyAllTranslation = buyAllText.GetComponent <TranslatedText>(); } try { return(buyAllTranslation.GetValue()); } catch { return("Buy All"); } }
string GetRepairText(int price) { if (repairTranslation == null) { repairTranslation = repairText.GetComponent <TranslatedText>(); } string translated; try { translated = repairTranslation.GetValue(); } catch { translated = "Repair {0}"; } return(string.Format(translated, MoneyFormatter.FormatMoney(price))); }
string GetBuyText(int price) { if (buyTranslation == null) { buyTranslation = buyText.GetComponent <TranslatedText>(); } string translated; try { translated = buyTranslation.GetValue(); } catch { translated = "Buy {0}"; } return(string.Format(translated, MoneyFormatter.FormatMoney(price))); }
/// <summary> /// Get translated text for buying button /// </summary> /// <param name="amount">how many </param> /// <returns> /// Example result: "Buy x14" /// </returns> string GetBuyText(int amount) { if (buyTranslation == null) { buyTranslation = buyText.GetComponent <TranslatedText>(); } string translated; try { translated = buyTranslation.GetValue(); } catch { return(string.Format("Buy x{0}", amount)); } return(string.Format(translated, amount)); }