ProductDataをLocalize対応

This commit is contained in:
kimura 2021-12-28 12:56:21 +09:00
parent fa5761f9f8
commit bff7397452
10 changed files with 15 additions and 15 deletions

View File

@ -141,8 +141,8 @@ public class CookingResult : MonoBehaviour
private void SetData(ProductData recipe, RarityData rarity, ProductViewType viewType)
{
// popcornImage
popcornText.text = recipe.name;
popcornTextPerfect.text = recipe.name;
popcornText.text = recipe.Name;
popcornTextPerfect.text = recipe.Name;
quantityText.text = string.Format(QuantityTextFormat, recipe.volume);
coinView.SetPrice(recipe.GetRarityPrice(ProductRarity.Normal), recipe.GetRarityPrice(rarity.Rarity));
var rarityFormat = viewType == ProductViewType.Default ? rarity.Text : ScriptLocalization.UI.CookingResultsBulkOrderPerfect;

View File

@ -33,7 +33,7 @@ public class BulkOrderItemView : MonoBehaviour
public void SetData(ProductData data)
{
stockText.text = data.volume.ToString();
nameText.text = data.name;
nameText.text = data.Name;
cornText.text = string.Format(amountFormat, data.MaterialList[0].amount);
packageIconTarget.DestroyAllChildrens();
Instantiate(data.GetIconPrefab(), packageIconTarget);

View File

@ -39,7 +39,7 @@ public class BulkOrderNotifyView : MonoBehaviour
var productList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
if (productList.FirstOrDefault(data => data.id == orderData.productId1) is ProductData data1)
{
itemView1.SetData(data1.name, orderData.count1, data1.GetIconPrefab());
itemView1.SetData(data1.Name, orderData.count1, data1.GetIconPrefab());
itemView1.SetActive(true);
}
else
@ -48,7 +48,7 @@ public class BulkOrderNotifyView : MonoBehaviour
}
if (productList.FirstOrDefault(data => data.id == orderData.productId2) is ProductData data2)
{
itemView2.SetData(data2.name, orderData.count2, data2.GetIconPrefab());
itemView2.SetData(data2.Name, orderData.count2, data2.GetIconPrefab());
itemView2.SetActive(true);
}
else
@ -57,7 +57,7 @@ public class BulkOrderNotifyView : MonoBehaviour
}
if (productList.FirstOrDefault(data => data.id == orderData.productId3) is ProductData data3)
{
itemView3.SetData(data3.name, orderData.count3, data3.GetIconPrefab());
itemView3.SetData(data3.Name, orderData.count3, data3.GetIconPrefab());
itemView3.SetActive(true);
}
else

View File

@ -14,7 +14,7 @@ public class HasProductItemView : MonoBehaviour
public void SetData(ProductData productData, int amount)
{
amountText.text = $"{amount}{ScriptLocalization.Unit.Amount}";
nameText.text = productData.name;
nameText.text = productData.Name;
productTarget.DestroyAllChildrens();
Instantiate(productData.GetIconPrefab(), productTarget);
}

View File

@ -34,7 +34,7 @@ public class ShopLevelUp : MonoBehaviour
var productData = productList.FirstOrDefault(data => data.shopLevel == shopLevel);
shopLevelText.text = shopLevel.ToString();
achievementText.text = shopLevelList.FirstOrDefault(data => data.shopLevel == shopLevel)?.achievement ?? "";
recipeNameText.text = productData?.name ?? "";
recipeNameText.text = productData?.Name ?? "";
closeButton.OnClickAsObservable().Take(1).Subscribe(_ =>
{

View File

@ -39,8 +39,8 @@ public class TankDetailView : MonoBehaviour
totalStock.text = $"{ScriptLocalization.UI.RecipeChoiceMyStockPrefix}{data.totalStock}";
tankStock.text = string.Format(ScriptLocalization.UI.ManagementTankTankNumber, data.tankNum, data.tankData.Stock);
price.text = $"{data.productData.price}";
name.text = $"{data.productData.name}";
text.text = data.productData.text;
name.text = $"{data.productData.Name}";
text.text = data.productData.Text;
popcornImageTarget.DestroyAllChildrens();
Instantiate(data.productData.GetIconPrefab(), popcornImageTarget);
raritySummaryView.SetHasRarity(data.raritySummaryData);

View File

@ -21,7 +21,7 @@ public class TastingView : MonoBehaviour
var data = LocalCacheManager.Load<(IObservable<(int tankNum, ProductData productData)> selectedObservable, Action closeButtonAction, Action tastingButtonAction)>(TastingDataTag);
data.selectedObservable.Subscribe(x =>
{
popcornName.text = x.productData.name;
popcornName.text = x.productData.Name;
packageImageTarget.DestroyAllChildrens();
Instantiate(x.productData.GetIconPrefab(), packageImageTarget);
}).AddTo(this);

View File

@ -21,7 +21,7 @@ public class RecipeData
return SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet).Select(data => new RecipeData
{
RecipeId = data.id,
Name = data.name,
Name = data.Name,
Price = data.price,
Volume = data.volume,
CornAmount = data.MaterialList[0].amount,

View File

@ -118,10 +118,10 @@ public class RecipeDetailView : MonoBehaviour
var shopStock = gameData.ShopStock.Count(stockData => stockData.FlavorId == data.id);
var tankStock = gameData.StorageTanks.FindAll(x => x.FlavorId == data.id).Sum(x => x.Stock);
flavorStock.text = $"{ScriptLocalization.UI.RecipeChoiceMyStockPrefix}{shopStock + tankStock}";
flavorName.text = data.name;
flavorName.text = data.Name;
flavorPrice.text = data.price.ToString();
flavorVolume.text = data.volume.ToString();
flavorText.text = data.text;
flavorText.text = data.Text;
flavorImageTarget.DestroyAllChildrens();
Instantiate(data.GetIconPrefab(), flavorImageTarget);
cornAmountText.text = string.Format(cornAmountFormat, gameData.CornSeed, data.MaterialList[0].amount);

View File

@ -30,7 +30,7 @@ public class RecipeView : MonoBehaviour
public void SetRecipe(ProductData data)
{
flavorName.text = data.name;
flavorName.text = data.Name;
flavorPrice.text = data.price.ToString();
flavorImageTarget.DestroyAllChildrens();
Instantiate(data.GetIconPrefab(), flavorImageTarget);