レシピスクロールバー改善

This commit is contained in:
kimura 2021-09-24 11:16:50 +09:00
parent dc0abb20ff
commit 4cfbf67415
2 changed files with 29 additions and 9 deletions

View File

@ -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;
}
}

View File

@ -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