From 96cc78c671b116745e803b18d70f65701611e0ce Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 13 Sep 2021 09:49:30 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=E7=B4=A0=E6=9D=90=E3=83=AA=E3=82=BB?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/DebugOption/DebugOption.unity | 4 ++-- .../DebugOption/Scripts/DebugOptionManager.cs | 3 ++- .../MyGame/Scenes/Main/Scripts/KitchenManager.cs | 15 +++++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/DebugOption/DebugOption.unity b/popcorn/Assets/MyGame/Scenes/DebugOption/DebugOption.unity index 34a802b5..7c402c11 100644 --- a/popcorn/Assets/MyGame/Scenes/DebugOption/DebugOption.unity +++ b/popcorn/Assets/MyGame/Scenes/DebugOption/DebugOption.unity @@ -1490,12 +1490,12 @@ PrefabInstance: - target: {fileID: 5062447477614030396, guid: f19992fe2069b4e16b2f83277fb189cb, type: 3} propertyPath: m_Text - value: "\u7D20\u6750\n\u88DC\u5145" + value: "\u7D20\u6750\u30EA\n\u30BB\u30C3\u30C8" objectReference: {fileID: 0} - target: {fileID: 5850834825256791800, guid: f19992fe2069b4e16b2f83277fb189cb, type: 3} propertyPath: m_Name - value: RefillButton + value: ResetMaterialButton objectReference: {fileID: 0} - target: {fileID: 5850834825256791800, guid: f19992fe2069b4e16b2f83277fb189cb, type: 3} diff --git a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs index 91961272..6cc4ce43 100644 --- a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs +++ b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs @@ -49,9 +49,10 @@ public class DebugOptionManager : MonoBehaviour refillMaterialButton.OnClickAsObservable().Subscribe(_ => { // 所持素材 + gameData.Material = new List{new MaterialData{Id = 2}}; foreach (var material in gameData.Material) { - material.Amount = 10; + material.Amount = 5; } }).AddTo(this); diff --git a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs index 763fc876..4b62046a 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs @@ -33,13 +33,16 @@ public class KitchenManager : MonoBehaviour { var gameData = GameDataManager.GameData; // 所持レシピ - gameData.MyRecipes = new[] + if (gameData.MyRecipes == null || gameData.MyRecipes.Length == 0) { - 1, - 2, - 13, - }; - + gameData.MyRecipes = new[] + { + 1, + 2, + 13, + }; + } + // 所持素材 if (gameData.Material == null || gameData.Material.Count == 0) { From 7d770e166cf646f448becb15990f11f4ee275d57 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 13 Sep 2021 09:51:14 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/shopping/Scripts/ShopListView.cs | 10 +--------- .../Assets/MyGame/Scenes/shopping/Scripts/Shopping.cs | 11 ++++++++++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopListView.cs b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopListView.cs index 3662790f..fd4c679d 100644 --- a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopListView.cs +++ b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopListView.cs @@ -46,15 +46,7 @@ public class ShopListView : MonoBehaviour index = tabs.Count; tabs.Add((tabCategory, Instantiate(scrollRect.content, scrollRect.content.parent))); } - var itemView = Instantiate(itemViewPrefab, tabs[index].content); - itemView.SetData(shopData); - // show detail view - itemView.DetailButtonObservable.Subscribe(_ => - { - LocalCacheManager.Save(ShopItemDetailView.ItemDetailTag, shopData); - TransitionManager.Instance.LoadSceneAdditive(GameScenes.ShoppingExplanation); - }).AddTo(itemView); - return itemView; + return Instantiate(itemViewPrefab, tabs[index].content); } private ItemCategory GetTabCategory(ItemCategory category) diff --git a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/Shopping.cs b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/Shopping.cs index aeecafa4..46d55e8c 100644 --- a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/Shopping.cs +++ b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/Shopping.cs @@ -9,18 +9,21 @@ public class Shopping : MonoBehaviour { [SerializeField] private ShopListView listView; // Start is called before the first frame update + private Subject changeCoinSubject = new Subject(); void Start() { + changeCoinSubject.AddTo(this); + var gameData = GameDataManager.GameData; CoinManager.Instance.ChangeCoin(gameData.coin); HeartMeter.Instance.SetHeart(gameData.Heart); - var changeCoinSubject = new Subject().AddTo(this); // 一覧データ var shopDataList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ShopDataSheet); foreach (var shopData in shopDataList) { var itemView = listView.AddItemView(shopData); + itemView.SetData(shopData); itemView.SetStockCount(GetItemAmount(shopData)); // コインを監視して購入可能状態を切り替え changeCoinSubject.Subscribe(ownCoin => @@ -47,6 +50,12 @@ public class Shopping : MonoBehaviour LocalCacheManager.Save(ShopItemPurchaseView.ItemPurchaseTag, (shopData, GetItemAmount(shopData), new Action(x => purchaseSubject.OnNext(x)))); TransitionManager.Instance.LoadSceneAdditive(GameScenes.Purchase); }).AddTo(itemView); + // show detail view + itemView.DetailButtonObservable.Subscribe(_ => + { + LocalCacheManager.Save(ShopItemDetailView.ItemDetailTag, shopData); + TransitionManager.Instance.LoadSceneAdditive(GameScenes.ShoppingExplanation); + }).AddTo(itemView); } changeCoinSubject.OnNext(CoinManager.Instance.OwnCoin); } From 61fe85a481621d82f673c6d86a26449159491cfb Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 13 Sep 2021 09:52:18 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=82=B7=E3=83=BC=E3=83=B3=E3=81=AE=E9=81=B7=E7=A7=BB=E5=91=A8?= =?UTF-8?q?=E3=82=8A=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/marketing/Scripts/ProductManagement.cs | 13 ------------- popcorn/Assets/MyGame/Scripts/FooterManager.cs | 1 - 2 files changed, 14 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs index 9c60742b..311d19ea 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs @@ -5,20 +5,7 @@ using UnityEngine.UI; public class ProductManagement : MonoBehaviour { - public static readonly string PrevSceneNameTag = "ProductManagementPrevSceneName"; - - [SerializeField] private Button prevButton; - private void Start() { - var prevGameScene = GameScenes.Main; - if (LocalCacheManager.Exists(PrevSceneNameTag)) - { - prevGameScene = LocalCacheManager.Load(PrevSceneNameTag); - } - prevButton.OnClickAsObservable().Subscribe(_ => - { - TransitionManager.Instance.LoadScene(prevGameScene); - }).AddTo(this); } } diff --git a/popcorn/Assets/MyGame/Scripts/FooterManager.cs b/popcorn/Assets/MyGame/Scripts/FooterManager.cs index 4a98e135..119c9d39 100644 --- a/popcorn/Assets/MyGame/Scripts/FooterManager.cs +++ b/popcorn/Assets/MyGame/Scripts/FooterManager.cs @@ -36,7 +36,6 @@ public class FooterManager : MonoBehaviour }).AddTo(this); productManagementButton.BindToOnClick(shareGate, _ => { - LocalCacheManager.Save(ProductManagement.PrevSceneNameTag, Enum.Parse(typeof(GameScenes), gameObject.scene.name)); TransitionManager.Instance.LoadScene(GameScenes.ProductManagement); return Observable.Timer(TimeSpan.FromSeconds(.5f)).AsUnitObservable(); }).AddTo(this); From 7d6f00927ce6f94261e168c456c2c48228e36825 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 13 Sep 2021 11:19:06 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=E7=B4=A0=E6=9D=90=E3=83=AA=E3=82=BB?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=81=AB=E3=83=AC=E3=82=B7=E3=83=94=E3=81=A8?= =?UTF-8?q?=E3=83=95=E3=83=A9=E3=82=A4=E3=83=91=E3=83=B3=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/MyGame/Scenes/DebugOption/DebugOption.unity | 2 +- .../Scenes/DebugOption/Scripts/DebugOptionManager.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/DebugOption/DebugOption.unity b/popcorn/Assets/MyGame/Scenes/DebugOption/DebugOption.unity index 7c402c11..ed2e7c65 100644 --- a/popcorn/Assets/MyGame/Scenes/DebugOption/DebugOption.unity +++ b/popcorn/Assets/MyGame/Scenes/DebugOption/DebugOption.unity @@ -1548,7 +1548,7 @@ MonoBehaviour: resetButton: {fileID: 785180941} backButton: {fileID: 785180940} resetFieldButton: {fileID: 450754452} - refillMaterialButton: {fileID: 1767352104} + resetMaterialButton: {fileID: 1767352104} refillManyProductButton: {fileID: 1651104560} refillLittleProductButton: {fileID: 153639484} fastGrowingToggle: {fileID: 1998240841} diff --git a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs index 6cc4ce43..23c6f422 100644 --- a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs +++ b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs @@ -13,7 +13,7 @@ public class DebugOptionManager : MonoBehaviour [SerializeField] private Button resetButton; [SerializeField] private Button backButton; [SerializeField] private Button resetFieldButton; - [SerializeField] private Button refillMaterialButton; + [SerializeField] private Button resetMaterialButton; [SerializeField] private Button refillManyProductButton; [SerializeField] private Button refillLittleProductButton; [SerializeField] private Toggle fastGrowingToggle; @@ -46,7 +46,7 @@ public class DebugOptionManager : MonoBehaviour gameData.SeedlingDataList = null; }).AddTo(this); - refillMaterialButton.OnClickAsObservable().Subscribe(_ => + resetMaterialButton.OnClickAsObservable().Subscribe(_ => { // 所持素材 gameData.Material = new List{new MaterialData{Id = 2}}; @@ -54,6 +54,10 @@ public class DebugOptionManager : MonoBehaviour { material.Amount = 5; } + // レシピ + gameData.MyRecipes = new[] {1, 2, 13}; + // フライパン + gameData.Pans = new[] {Const.DefaultPanId}; }).AddTo(this); refillManyProductButton.OnClickAsObservable().Subscribe(_ => From 91534c927216d362631152161b968a75ea235abb Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 13 Sep 2021 11:20:24 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=E9=9D=9E=E6=B6=88=E8=B2=BB=E3=82=A2?= =?UTF-8?q?=E3=82=A4=E3=83=86=E3=83=A0=E3=81=AE=E8=B3=BC=E5=85=A5=E3=83=9D?= =?UTF-8?q?=E3=83=83=E3=83=97=E3=82=A2=E3=83=83=E3=83=97=E6=8C=99=E5=8B=95?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/shopping/Prefabs/PurchaseView.prefab | 3 +++ .../Scenes/shopping/Scripts/ShopItemPurchaseView.cs | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/popcorn/Assets/MyGame/Scenes/shopping/Prefabs/PurchaseView.prefab b/popcorn/Assets/MyGame/Scenes/shopping/Prefabs/PurchaseView.prefab index 882adf81..9b541f06 100644 --- a/popcorn/Assets/MyGame/Scenes/shopping/Prefabs/PurchaseView.prefab +++ b/popcorn/Assets/MyGame/Scenes/shopping/Prefabs/PurchaseView.prefab @@ -277,6 +277,7 @@ MonoBehaviour: name: {fileID: 9133304336883555433} icon: {fileID: 9133304335605570096} price: {fileID: 9133304336128604254} + text: {fileID: 9133304336181127572} stockCount: {fileID: 9133304336153810480} totalPrice: {fileID: 9133304335494687832} purchaseCount: {fileID: 9133304336756314526} @@ -285,6 +286,8 @@ MonoBehaviour: closeButton: {fileID: 9133304335940276437} purchaseOnButton: {fileID: 9133304335268316946} purchaseOffButton: {fileID: 7845949066005219734} + quantitySelectObject: {fileID: 9133304337054428179} + explanationObject: {fileID: 9133304336181127570} --- !u!1 &9133304335268316944 GameObject: m_ObjectHideFlags: 0 diff --git a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopItemPurchaseView.cs b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopItemPurchaseView.cs index 54366a58..e757cbc9 100644 --- a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopItemPurchaseView.cs +++ b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopItemPurchaseView.cs @@ -6,6 +6,7 @@ using UnityEngine.UI; public class ShopItemPurchaseView : MonoBehaviour { public static readonly string ItemPurchaseTag = "ItemPurcahse"; + private static readonly string redColorString= "fb6346"; private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger"); private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger"); private static readonly int MaxPurchaseCount = 999; @@ -15,6 +16,7 @@ public class ShopItemPurchaseView : MonoBehaviour [SerializeField] private Text name; [SerializeField] private Transform icon; [SerializeField] private Text price; + [SerializeField] private Text text; [SerializeField] private Text stockCount; [SerializeField] private Text totalPrice; [SerializeField] private Text purchaseCount; @@ -23,13 +25,18 @@ public class ShopItemPurchaseView : MonoBehaviour [SerializeField] private Button closeButton; [SerializeField] private Button purchaseOnButton; [SerializeField] private GameObject purchaseOffButton; + [SerializeField] private GameObject quantitySelectObject; + [SerializeField] private GameObject explanationObject; + private Color redColor; private Color defaultColor; private readonly IntReactiveProperty currentCount = new IntReactiveProperty(); private void Start() { currentCount.AddTo(this); defaultColor = totalPrice.color; + ColorUtility.TryParseHtmlString(redColorString, out redColor); + // 表示データを受け取る var data = LocalCacheManager.Load<(ShopData shopData, int stockCount, Action callback)>(ItemPurchaseTag); LocalCacheManager.Remove(ItemPurchaseTag); SetData(data.shopData, data.stockCount); @@ -58,10 +65,12 @@ public class ShopItemPurchaseView : MonoBehaviour { var total = data.shopData.price * x; SetButtonActive(total <= CoinManager.Instance.OwnCoin); - totalPrice.color = total <= CoinManager.Instance.OwnCoin ? defaultColor : Color.red; + totalPrice.color = total <= CoinManager.Instance.OwnCoin ? defaultColor : redColor; totalPrice.text = $"{total}"; purchaseCount.text = $"{x}"; }).AddTo(this); + quantitySelectObject.SetActive(data.shopData.ConsumeType == ShopItemType.Consumable); + explanationObject.SetActive(data.shopData.ConsumeType == ShopItemType.NonConsumable); if (data.shopData.ConsumeType == ShopItemType.Consumable) { addCountButton.OnClickAsObservable().Select(_ => 1) @@ -82,6 +91,7 @@ public class ShopItemPurchaseView : MonoBehaviour name.text = shopData.name; price.text = $"{shopData.price}"; stockCount.text = $"所持数 :{count}"; + text.text = shopData.text; } private void SetButtonActive(bool active) From 0bd6fd44ab2068d59b2f0e05b54857f9f1410609 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 13 Sep 2021 11:27:54 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=E8=89=B2=E6=8C=87=E5=AE=9A=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/shopping/Scripts/ShopItemPurchaseView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopItemPurchaseView.cs b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopItemPurchaseView.cs index e757cbc9..f164fdec 100644 --- a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopItemPurchaseView.cs +++ b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/ShopItemPurchaseView.cs @@ -6,7 +6,7 @@ using UnityEngine.UI; public class ShopItemPurchaseView : MonoBehaviour { public static readonly string ItemPurchaseTag = "ItemPurcahse"; - private static readonly string redColorString= "fb6346"; + private static readonly string redColorString= "#fb6346"; private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger"); private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger"); private static readonly int MaxPurchaseCount = 999;