From 22252e8711e40b96a6dc37500440c95e77bb1299 Mon Sep 17 00:00:00 2001 From: kimura Date: Fri, 15 Apr 2022 13:16:18 +0900 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8B=95=E8=AA=BF=E7=90=86=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E6=99=82=E3=81=AE=E8=A1=A8=E7=A4=BA=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Main/AutomaticCookingComplete.unity | 147 +++++++++++++++++- .../Main/Scripts/AutoCookCompleteView.cs | 38 ++++- 2 files changed, 182 insertions(+), 3 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/Main/AutomaticCookingComplete.unity b/popcorn/Assets/MyGame/Scenes/Main/AutomaticCookingComplete.unity index 92aadd11..64a9cd72 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/AutomaticCookingComplete.unity +++ b/popcorn/Assets/MyGame/Scenes/Main/AutomaticCookingComplete.unity @@ -1035,11 +1035,20 @@ MonoBehaviour: m_GameObject: {fileID: 534902212} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7ac380b2956543a6a6b17c6150b154c0, type: 3} + m_Script: {fileID: 11500000, guid: 3417deb36e014d2d85e22d413fc446ab, type: 3} m_Name: m_EditorClassIdentifier: backgroundAnimator: {fileID: 1090969545} - closeButton: {fileID: 0} + closeButton: {fileID: 1530405766} + getButton: {fileID: 406579702} + popcorns: + - {fileID: 1709089885} + - {fileID: 1709089884} + - {fileID: 1709089883} + - {fileID: 1709089882} + - {fileID: 1709089881} + - {fileID: 1709089880} + - {fileID: 1709089879} --- !u!1 &677856731 GameObject: m_ObjectHideFlags: 0 @@ -2536,16 +2545,66 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 1240257559} m_Modifications: + - target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 329 + objectReference: {fileID: 0} + - target: {fileID: 4223190801597337599, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 329 + objectReference: {fileID: 0} + - target: {fileID: 4223190801737283886, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4223190801807453305, guid: 5f90e42166914c0b83b48c62b7e279e5, type: 3} propertyPath: m_Name @@ -2804,6 +2863,90 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 1709089877} m_PrefabAsset: {fileID: 0} +--- !u!114 &1709089879 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 413027507554482889, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + m_PrefabInstance: {fileID: 1709089877} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1709089880 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 413027506448404572, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + m_PrefabInstance: {fileID: 1709089877} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1709089881 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 413027506772110985, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + m_PrefabInstance: {fileID: 1709089877} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1709089882 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 413027507580250462, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + m_PrefabInstance: {fileID: 1709089877} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1709089883 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 413027507672086750, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + m_PrefabInstance: {fileID: 1709089877} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1709089884 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 413027506800827693, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + m_PrefabInstance: {fileID: 1709089877} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1709089885 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 413027506015082184, guid: 5f90e42166914c0b83b48c62b7e279e5, + type: 3} + m_PrefabInstance: {fileID: 1709089877} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2df417e1f2b649c2bd38ea6627e453f2, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1808585194 GameObject: m_ObjectHideFlags: 0 diff --git a/popcorn/Assets/MyGame/Scenes/Main/Scripts/AutoCookCompleteView.cs b/popcorn/Assets/MyGame/Scenes/Main/Scripts/AutoCookCompleteView.cs index 122b11ab..b56d0416 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/Scripts/AutoCookCompleteView.cs +++ b/popcorn/Assets/MyGame/Scenes/Main/Scripts/AutoCookCompleteView.cs @@ -16,7 +16,7 @@ namespace MyGame.Scenes.Main.Scripts [SerializeField] private Button closeButton; [SerializeField] private Button getButton; - [SerializeField] private Transform[] popcorns; + [SerializeField] private AutoCookPopcornView[] popcorns; private void Start() { var gameData = GameDataManager.GameData; @@ -36,6 +36,42 @@ namespace MyGame.Scenes.Main.Scripts }).AddTo(this); + // アイテムのリスト生成 + var productList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ProductDataSheet); + var earnProductArray = productList + .Where(data => earnIds.Contains(data.id)) + .Select(data => new ProductData(data, 1){volume = Const.TankCapacity}) + .ToArray(); + var lastProductAmount = autoCookData.earnCount % Const.TankCapacity; + if (lastProductAmount == 0) + { + lastProductAmount = Const.TankCapacity; + } + // リストの最後のポップコーン数を上書き + earnProductArray.Last().volume = lastProductAmount; + + for (int i = 0; i < popcorns.Length; i++) + { + if (i < count) + { + popcorns[i].SetView(earnProductArray[i]); + popcorns[i].SetActive(true); + } + else + { + popcorns[i].SetActive(false); + } + } + + // 描画計算 + var rebuildTarget = popcorns[0].transform.parent.parent; + var originalScale = rebuildTarget.localScale; + rebuildTarget.localScale = Vector3.zero; + Observable.TimerFrame(0, FrameCountType.EndOfFrame).Subscribe(_ => + { + LayoutRebuilder.ForceRebuildLayoutImmediate(rebuildTarget as RectTransform); + rebuildTarget.localScale = originalScale; + }).AddTo(this); } public static void ShowDialog(Action onClose = null){