Esempio n. 1
0
        public override void HandleTypeAfterParse(BSMLParser.ComponentTypeWithData componentType, BSMLParserParams parserParams)
        {
            BSMLScrollableContainer scrollView = componentType.component as BSMLScrollableContainer;

            if (componentType.data.TryGetValue("id", out string id))
            {
                scrollView.PageUpButton = parserParams.GetObjectsWithTag("PageUpFor:" + id)
                                          .Select(o => o.GetComponent <Button>())
                                          .FirstOrDefault(b => b != null);

                scrollView.PageDownButton = parserParams.GetObjectsWithTag("PageDownFor:" + id)
                                            .Select(o => o.GetComponent <Button>())
                                            .FirstOrDefault(b => b != null);

                scrollView.ScrollIndicator = parserParams.GetObjectsWithTag("IndicatorFor:" + id)
                                             .Select(o => o.GetComponent <VerticalScrollIndicator>() ?? o.GetComponent <BSMLScrollIndicator>())
                                             .FirstOrDefault(i => i != null);
            }

            scrollView.Setup();
            scrollView.RefreshButtonsInteractibility();
            //scrollView.ScrollAt(0, false);
        }