ProductDataをLocalize対応
This commit is contained in:
parent
fa5761f9f8
commit
bff7397452
|
|
@ -141,8 +141,8 @@ public class CookingResult : MonoBehaviour
|
||||||
private void SetData(ProductData recipe, RarityData rarity, ProductViewType viewType)
|
private void SetData(ProductData recipe, RarityData rarity, ProductViewType viewType)
|
||||||
{
|
{
|
||||||
// popcornImage
|
// popcornImage
|
||||||
popcornText.text = recipe.name;
|
popcornText.text = recipe.Name;
|
||||||
popcornTextPerfect.text = recipe.name;
|
popcornTextPerfect.text = recipe.Name;
|
||||||
quantityText.text = string.Format(QuantityTextFormat, recipe.volume);
|
quantityText.text = string.Format(QuantityTextFormat, recipe.volume);
|
||||||
coinView.SetPrice(recipe.GetRarityPrice(ProductRarity.Normal), recipe.GetRarityPrice(rarity.Rarity));
|
coinView.SetPrice(recipe.GetRarityPrice(ProductRarity.Normal), recipe.GetRarityPrice(rarity.Rarity));
|
||||||
var rarityFormat = viewType == ProductViewType.Default ? rarity.Text : ScriptLocalization.UI.CookingResultsBulkOrderPerfect;
|
var rarityFormat = viewType == ProductViewType.Default ? rarity.Text : ScriptLocalization.UI.CookingResultsBulkOrderPerfect;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ public class BulkOrderItemView : MonoBehaviour
|
||||||
public void SetData(ProductData data)
|
public void SetData(ProductData data)
|
||||||
{
|
{
|
||||||
stockText.text = data.volume.ToString();
|
stockText.text = data.volume.ToString();
|
||||||
nameText.text = data.name;
|
nameText.text = data.Name;
|
||||||
cornText.text = string.Format(amountFormat, data.MaterialList[0].amount);
|
cornText.text = string.Format(amountFormat, data.MaterialList[0].amount);
|
||||||
packageIconTarget.DestroyAllChildrens();
|
packageIconTarget.DestroyAllChildrens();
|
||||||
Instantiate(data.GetIconPrefab(), packageIconTarget);
|
Instantiate(data.GetIconPrefab(), packageIconTarget);
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class BulkOrderNotifyView : MonoBehaviour
|
||||||
var productList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
|
var productList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
|
||||||
if (productList.FirstOrDefault(data => data.id == orderData.productId1) is ProductData data1)
|
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);
|
itemView1.SetActive(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -48,7 +48,7 @@ public class BulkOrderNotifyView : MonoBehaviour
|
||||||
}
|
}
|
||||||
if (productList.FirstOrDefault(data => data.id == orderData.productId2) is ProductData data2)
|
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);
|
itemView2.SetActive(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -57,7 +57,7 @@ public class BulkOrderNotifyView : MonoBehaviour
|
||||||
}
|
}
|
||||||
if (productList.FirstOrDefault(data => data.id == orderData.productId3) is ProductData data3)
|
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);
|
itemView3.SetActive(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ public class HasProductItemView : MonoBehaviour
|
||||||
public void SetData(ProductData productData, int amount)
|
public void SetData(ProductData productData, int amount)
|
||||||
{
|
{
|
||||||
amountText.text = $"{amount}{ScriptLocalization.Unit.Amount}";
|
amountText.text = $"{amount}{ScriptLocalization.Unit.Amount}";
|
||||||
nameText.text = productData.name;
|
nameText.text = productData.Name;
|
||||||
productTarget.DestroyAllChildrens();
|
productTarget.DestroyAllChildrens();
|
||||||
Instantiate(productData.GetIconPrefab(), productTarget);
|
Instantiate(productData.GetIconPrefab(), productTarget);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class ShopLevelUp : MonoBehaviour
|
||||||
var productData = productList.FirstOrDefault(data => data.shopLevel == shopLevel);
|
var productData = productList.FirstOrDefault(data => data.shopLevel == shopLevel);
|
||||||
shopLevelText.text = shopLevel.ToString();
|
shopLevelText.text = shopLevel.ToString();
|
||||||
achievementText.text = shopLevelList.FirstOrDefault(data => data.shopLevel == shopLevel)?.achievement ?? "";
|
achievementText.text = shopLevelList.FirstOrDefault(data => data.shopLevel == shopLevel)?.achievement ?? "";
|
||||||
recipeNameText.text = productData?.name ?? "";
|
recipeNameText.text = productData?.Name ?? "";
|
||||||
|
|
||||||
closeButton.OnClickAsObservable().Take(1).Subscribe(_ =>
|
closeButton.OnClickAsObservable().Take(1).Subscribe(_ =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ public class TankDetailView : MonoBehaviour
|
||||||
totalStock.text = $"{ScriptLocalization.UI.RecipeChoiceMyStockPrefix}{data.totalStock}";
|
totalStock.text = $"{ScriptLocalization.UI.RecipeChoiceMyStockPrefix}{data.totalStock}";
|
||||||
tankStock.text = string.Format(ScriptLocalization.UI.ManagementTankTankNumber, data.tankNum, data.tankData.Stock);
|
tankStock.text = string.Format(ScriptLocalization.UI.ManagementTankTankNumber, data.tankNum, data.tankData.Stock);
|
||||||
price.text = $"{data.productData.price}";
|
price.text = $"{data.productData.price}";
|
||||||
name.text = $"{data.productData.name}";
|
name.text = $"{data.productData.Name}";
|
||||||
text.text = data.productData.text;
|
text.text = data.productData.Text;
|
||||||
popcornImageTarget.DestroyAllChildrens();
|
popcornImageTarget.DestroyAllChildrens();
|
||||||
Instantiate(data.productData.GetIconPrefab(), popcornImageTarget);
|
Instantiate(data.productData.GetIconPrefab(), popcornImageTarget);
|
||||||
raritySummaryView.SetHasRarity(data.raritySummaryData);
|
raritySummaryView.SetHasRarity(data.raritySummaryData);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ public class TastingView : MonoBehaviour
|
||||||
var data = LocalCacheManager.Load<(IObservable<(int tankNum, ProductData productData)> selectedObservable, Action closeButtonAction, Action tastingButtonAction)>(TastingDataTag);
|
var data = LocalCacheManager.Load<(IObservable<(int tankNum, ProductData productData)> selectedObservable, Action closeButtonAction, Action tastingButtonAction)>(TastingDataTag);
|
||||||
data.selectedObservable.Subscribe(x =>
|
data.selectedObservable.Subscribe(x =>
|
||||||
{
|
{
|
||||||
popcornName.text = x.productData.name;
|
popcornName.text = x.productData.Name;
|
||||||
packageImageTarget.DestroyAllChildrens();
|
packageImageTarget.DestroyAllChildrens();
|
||||||
Instantiate(x.productData.GetIconPrefab(), packageImageTarget);
|
Instantiate(x.productData.GetIconPrefab(), packageImageTarget);
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ public class RecipeData
|
||||||
return SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet).Select(data => new RecipeData
|
return SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet).Select(data => new RecipeData
|
||||||
{
|
{
|
||||||
RecipeId = data.id,
|
RecipeId = data.id,
|
||||||
Name = data.name,
|
Name = data.Name,
|
||||||
Price = data.price,
|
Price = data.price,
|
||||||
Volume = data.volume,
|
Volume = data.volume,
|
||||||
CornAmount = data.MaterialList[0].amount,
|
CornAmount = data.MaterialList[0].amount,
|
||||||
|
|
|
||||||
|
|
@ -118,10 +118,10 @@ public class RecipeDetailView : MonoBehaviour
|
||||||
var shopStock = gameData.ShopStock.Count(stockData => stockData.FlavorId == data.id);
|
var shopStock = gameData.ShopStock.Count(stockData => stockData.FlavorId == data.id);
|
||||||
var tankStock = gameData.StorageTanks.FindAll(x => x.FlavorId == data.id).Sum(x => x.Stock);
|
var tankStock = gameData.StorageTanks.FindAll(x => x.FlavorId == data.id).Sum(x => x.Stock);
|
||||||
flavorStock.text = $"{ScriptLocalization.UI.RecipeChoiceMyStockPrefix}{shopStock + tankStock}";
|
flavorStock.text = $"{ScriptLocalization.UI.RecipeChoiceMyStockPrefix}{shopStock + tankStock}";
|
||||||
flavorName.text = data.name;
|
flavorName.text = data.Name;
|
||||||
flavorPrice.text = data.price.ToString();
|
flavorPrice.text = data.price.ToString();
|
||||||
flavorVolume.text = data.volume.ToString();
|
flavorVolume.text = data.volume.ToString();
|
||||||
flavorText.text = data.text;
|
flavorText.text = data.Text;
|
||||||
flavorImageTarget.DestroyAllChildrens();
|
flavorImageTarget.DestroyAllChildrens();
|
||||||
Instantiate(data.GetIconPrefab(), flavorImageTarget);
|
Instantiate(data.GetIconPrefab(), flavorImageTarget);
|
||||||
cornAmountText.text = string.Format(cornAmountFormat, gameData.CornSeed, data.MaterialList[0].amount);
|
cornAmountText.text = string.Format(cornAmountFormat, gameData.CornSeed, data.MaterialList[0].amount);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ public class RecipeView : MonoBehaviour
|
||||||
|
|
||||||
public void SetRecipe(ProductData data)
|
public void SetRecipe(ProductData data)
|
||||||
{
|
{
|
||||||
flavorName.text = data.name;
|
flavorName.text = data.Name;
|
||||||
flavorPrice.text = data.price.ToString();
|
flavorPrice.text = data.price.ToString();
|
||||||
flavorImageTarget.DestroyAllChildrens();
|
flavorImageTarget.DestroyAllChildrens();
|
||||||
Instantiate(data.GetIconPrefab(), flavorImageTarget);
|
Instantiate(data.GetIconPrefab(), flavorImageTarget);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue