From 4cfbf674153fb12c38360f7975162d198bb23f59 Mon Sep 17 00:00:00 2001 From: kimura Date: Fri, 24 Sep 2021 11:16:50 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AC=E3=82=B7=E3=83=94=E3=82=B9=E3=82=AF?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=AB=E3=83=90=E3=83=BC=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recipe/Scripts/RecipeSelectDialog.cs | 5 ++- .../Assets/MyGame/Scenes/recipe/recipe.unity | 33 ++++++++++++++----- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeSelectDialog.cs b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeSelectDialog.cs index 7e105c48..5825c9d1 100644 --- a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeSelectDialog.cs +++ b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeSelectDialog.cs @@ -7,7 +7,7 @@ using UnityEngine.UI; public class RecipeSelectDialog : MonoBehaviour { - [SerializeField] private GameObject content; + [SerializeField] private ScrollRect scrollRect; [SerializeField] private RecipeView recipePrefab; [SerializeField] private Button closeButton; // Start is called before the first frame update @@ -19,6 +19,7 @@ public class RecipeSelectDialog : MonoBehaviour }).AddTo(this); // レシピ一覧生成 + var content = scrollRect.content; content.transform.DestroyAllChildrens(); foreach (var recipeData in RecipeData.GetAllRecipe()) { @@ -39,5 +40,7 @@ public class RecipeSelectDialog : MonoBehaviour view.SetLockPanel(true); } } + LayoutRebuilder.ForceRebuildLayoutImmediate(content); + scrollRect.verticalNormalizedPosition = 1; } } diff --git a/popcorn/Assets/MyGame/Scenes/recipe/recipe.unity b/popcorn/Assets/MyGame/Scenes/recipe/recipe.unity index dba8adba..2f7efb26 100644 --- a/popcorn/Assets/MyGame/Scenes/recipe/recipe.unity +++ b/popcorn/Assets/MyGame/Scenes/recipe/recipe.unity @@ -654,6 +654,7 @@ GameObject: - component: {fileID: 203586001} - component: {fileID: 203586000} - component: {fileID: 203585999} + - component: {fileID: 203586002} m_Layer: 0 m_Name: Scroll View m_TagString: Untagged @@ -704,7 +705,7 @@ MonoBehaviour: m_ScrollSensitivity: 1 m_Viewport: {fileID: 25421135} m_HorizontalScrollbar: {fileID: 0} - m_VerticalScrollbar: {fileID: 409545283} + m_VerticalScrollbar: {fileID: 0} m_HorizontalScrollbarVisibility: 2 m_VerticalScrollbarVisibility: 0 m_HorizontalScrollbarSpacing: -3 @@ -749,6 +750,20 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 203585997} m_CullTransparentMesh: 0 +--- !u!114 &203586002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203585997} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4c7fb96966974f86a04af9747989d1f9, type: 3} + m_Name: + m_EditorClassIdentifier: + scrollRect: {fileID: 203585999} + verticalSlider: {fileID: 409545283} --- !u!1 &277152052 GameObject: m_ObjectHideFlags: 0 @@ -914,7 +929,7 @@ MonoBehaviour: m_GameObject: {fileID: 409545281} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3} + m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3} m_Name: m_EditorClassIdentifier: m_Navigation: @@ -944,12 +959,14 @@ MonoBehaviour: m_SelectedTrigger: Selected m_DisabledTrigger: Disabled m_Interactable: 1 - m_TargetGraphic: {fileID: 2120123254} + m_TargetGraphic: {fileID: 409545284} + m_FillRect: {fileID: 0} m_HandleRect: {fileID: 2120123253} m_Direction: 2 - m_Value: 1 - m_Size: 1 - m_NumberOfSteps: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 0 m_OnValueChanged: m_PersistentCalls: m_Calls: [] @@ -2821,7 +2838,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2154205f893c042a390e4b410b5b5ea5, type: 3} m_Name: m_EditorClassIdentifier: - content: {fileID: 28991871} + scrollRect: {fileID: 203585999} recipePrefab: {fileID: 5490177795204899762, guid: 2beb2d436ad55734186e797d315796b3, type: 3} closeButton: {fileID: 968322477} @@ -3652,7 +3669,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 127.75} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 52, y: 52} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2120123254