Ejemplo n.º 1
0
 private void StartHorizontalScroll()
 {
     switch (MenuContent)
     {
     case 1:        //Build map type
         currenthorizontalscroll = buildmaptypemanager.horizontalscroll;
         break;
     }
     horizontalscrolluimanager.HorizontalScrollUIStart(currenthorizontalscroll);
     horizontalscrolluimanager.IsMenuCreated = true;
 }
    //public List< List<ScrollPanel>> CurrentLevelList = new List< List<ScrollPanel>> ();


    public void HorizontalScrollUIStart(HorizontalScrollUI horizontalscroll)
    {
        ParentPanel          = this.transform.parent.gameObject;
        menuuimanager        = ParentPanel.GetComponent <MenuUIManager> ();
        CurrentSelectionList = new List <int> ();
        Currentscroll        = horizontalscroll;


        if (IsMenuCreated == true)
        {
            UpdateHorizontalScrollMenu();
        }
        else
        {
            LoadMenuElement();
        }
    }
    public void LoadBuildMapTypeMenuData()
    {
        string             menutitle       = "Map Logic";
        int                currentdepth    = 3;
        List <ScrollPanel> scrollpanellist = new List <ScrollPanel> ();
        List <int>         currentposition = new List <int> ();

        for (int i = 0; i < maindatabase.DatabaseMapLogic.Count; i++)
        {
            List <List <int> > currentchildlist1 = new List <List <int> > ();

            for (int x = 0; x < maindatabase.DatabaseMapLogic[i].Content.Count; x++)
            {
                List <List <int> > currentchildlist2 = new List <List <int> > ();

                for (int y = 0; y < maindatabase.DatabaseMapLogic[i].Content[x].SubtypeList.Count; y++)
                {
                    currentposition = new List <int> ()
                    {
                        i, x, y
                    };
                    List <List <int> > currentchildlist3 = new List <List <int> > ();
                    BuildCurrentPanel(currentposition, currentchildlist3);
                    scrollpanellist.Add(currentscrollpanel);
                    currentchildlist2.Add(currentposition);
                }
                currentposition = new List <int> ()
                {
                    i, x
                };
                BuildCurrentPanel(currentposition, currentchildlist2);
                scrollpanellist.Add(currentscrollpanel);
                currentchildlist1.Add(currentposition);
            }
            currentposition = new List <int> ()
            {
                i
            };
            BuildCurrentPanel(currentposition, currentchildlist1);
            scrollpanellist.Add(currentscrollpanel);
        }

        horizontalscroll = new HorizontalScrollUI(menutitle, currentdepth, scrollpanellist);
        menuuimanager.UpdateMenu();
    }