Exemplo n.º 1
0
        //IHSUIComponent widget;

        // Use this for initialization
        void Start()
        {
            manager = UIManagerFactory.CreateDefaultUIManager();
            manager.Init(this.transform);

            panel  = manager.CreatePanel <DemoPanel1>("panel1", "PANEL 1");
            panel2 = manager.CreatePanel <DemoPanel1>("panel1", "PANEL 2");
            panel3 = manager.CreatePanel <DemoPanel1>("panel1", "PANEL 3");
            panel4 = manager.CreatePanel <DemoPanel1>("panel1", "PANEL 4");

            DemoWidgetSidebar widget = manager.CreateWidget <DemoWidgetSidebar>("sidebar", panel2, panel2.transform);

            widget.Init(DemoWidgetSidebar.WidgetType.Toggle);
            widget.AddItem(new DemoWidgetSidebar.SideBarWidgetSelectItem("签到", () => { Debug.Log("sdf"); }));
            widget.AddItem(new DemoWidgetSidebar.SideBarWidgetSelectItem("抽签", () => { Debug.Log("sdfsdf"); }));
            widget.AddItem(new DemoWidgetSidebar.SideBarWidgetSelectItem("开始", () => { Debug.Log("sdfsdfsdf"); }));
            //manager.CreateWidget<DemoWidgetSidebar>("sidebar", panel3, panel3.transform);
            manager.DestroyPanel(panel4);

            StartCoroutine(Test());
        }