Implemented PageHandler proof of concept, fixed something with scrollviews

This commit is contained in:
sinaioutlander
2020-10-24 00:41:55 +11:00
parent 76c578a9ea
commit 25747503cc
5 changed files with 202 additions and 19 deletions

View File

@ -55,9 +55,11 @@ namespace ExplorerBeta.UI
private static void SetDefaultColorTransitionValues(Selectable slider)
{
ColorBlock colors = slider.colors;
colors.highlightedColor = new Color(0.4f, 0.4f, 0.4f);
colors.pressedColor = new Color(0.05f, 0.05f, 0.05f);
colors.normalColor = new Color(0.3f, 0.3f, 0.3f);
colors.highlightedColor = new Color(0.45f, 0.45f, 0.45f);
colors.pressedColor = new Color(0.1f, 0.1f, 0.1f);
colors.disabledColor = new Color(0.7f, 0.7f, 0.7f);
slider.colors = colors;
}
private static void SetParentAndAlign(GameObject child, GameObject parent)
@ -530,6 +532,12 @@ namespace ExplorerBeta.UI
{
GameObject scrollObj = CreateUIObject("Scroll View", parent);
var mainLayout = scrollObj.AddComponent<LayoutElement>();
mainLayout.flexibleWidth = 999;
mainLayout.flexibleHeight = 999;
mainLayout.preferredHeight = 200;
mainLayout.preferredWidth = 200;
GameObject viewportObj = CreateUIObject("Viewport", scrollObj);
var viewportGroup = viewportObj.AddComponent<VerticalLayoutGroup>();