视频改为5次配方

This commit is contained in:
xiaohui.wang 2023-02-02 19:17:30 +08:00
parent 8bdb2cb90e
commit 40395bd895
2 changed files with 14 additions and 5 deletions

View File

@ -73,7 +73,7 @@ public class ShopItemView : MonoBehaviour
{
shopData.price = 1;
videoButton.gameObject.SetActive(CryptoPrefs.GetInt("ShowStrawBerryDialog", 0) == 0);
videoButton.gameObject.SetActive(CryptoPrefs.GetInt("ShowStrawBerryDialog", 0) <= 4);
}
if (shopData.id == 13)
@ -113,6 +113,10 @@ public class ShopItemView : MonoBehaviour
{
progressText.text = string.Format(ProgressFormat, "1", "1");
if (shopData.id == 15)
{
progressText.text = string.Format(ProgressFormat, "5", "5");
}
progressBar.value = Mathf.InverseLerp(0, shopData.price, 1);
videoButton.gameObject.SetActive(false);
onObject.SetActive(false);
@ -130,9 +134,9 @@ public class ShopItemView : MonoBehaviour
}
else if(shopData.id == 15 )
{
progressText.text = string.Format(ProgressFormat, CryptoPrefs.GetInt("ShowStrawBerryDialog", 0), "1");
progressText.text = string.Format(ProgressFormat, CryptoPrefs.GetInt("ShowStrawBerryDialog", 0), "5");
progressBar.value = Mathf.InverseLerp(0, shopData.price, CryptoPrefs.GetInt("ShowStrawBerryDialog", 0));
progressBar.value = Mathf.InverseLerp(0, 5, CryptoPrefs.GetInt("ShowStrawBerryDialog", 0));
onObject.SetActive(false);
offObject.SetActive(false);
soldOutObject.SetActive(true);

View File

@ -193,18 +193,23 @@ public class Shopping : MonoBehaviour
else
{
GetRewardDialog.ShowStrawBerryDialog(() =>
{
CryptoPrefs.SetInt("ShowStrawBerryDialog", CryptoPrefs.GetInt("ShowStrawBerryDialog", 0)+1);
if (CryptoPrefs.GetInt("ShowStrawBerryDialog", 0) == 5)
{
ShopItemExchangeView.ShowDialog(shopData, () =>
{
var globalGameData = GameDataManager.GameData;
CryptoPrefs.SetInt("ShowStrawBerryDialog", 1);
// アイテムを増やす
AddItem(shopData, 1,globalGameData.CurrentCityId);
itemView.SetStockCount(GetItemAmount(shopData));
GameDataManager.SaveGameData();
recipeNotifyIcon.SetActive(CheckEarnedRecipe());
listView.RefreshItemviews();
});
}
listView.RefreshItemviews();
});
}