Ejemplo n.º 1
0
        private void SetText(KeyValuePair <SoilType, BuyButtonData> buttonData, AbstractBuildingTile tile)
        {
            SoilTypeData data = tile.GetSoilData(buttonData.Key);

            // Type
            if (typeTextWriter == null)
            {
                typeTextWriter = new StringVariableWriter(buttonData.Value.Text.Type.text);
            }

            string type = LanguageUtil.GetJsonString(buttonData.Key.ToString().ToUpper());

            buttonData.Value.Text.Type.text = typeTextWriter.UpdateText(type);

            // Price
            buttonData.Value.Text.Price.text = string.Format(GetString(priceKey), data.BuildCost);

            // Health
            buttonData.Value.Text.Health.text = string.Format(GetString(healthKey), data.MaxHealth);
        }