Ejemplo n.º 1
0
        string GetBuyAllText(int amount)
        {
            if (buyAllTranslation == null)
            {
                buyAllTranslation = buyAllText.GetComponent <TranslatedText>();
            }

            try
            {
                return(buyAllTranslation.GetValue());
            }
            catch
            {
                return("Buy All");
            }
        }
Ejemplo n.º 2
0
        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)));
        }
Ejemplo n.º 3
0
        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)));
        }
Ejemplo n.º 4
0
        /// <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));
        }