예제 #1
0
    public static ModelElement LoadToGame(string mod, object o, Transform parent, string filter = "mod")
    {
        var m = ModelManagerUI.FindModel(mod);

        LoadToGame(m, o, parent, filter);
        return(m);
    }
예제 #2
0
    public override void Initial(ModelElement parent, object dat = null)
    {
        model = ModelManagerUI.FindModel("baseUI", "asd");
        //ModelManagerUI.LoadToGame(model,view,parent.Context);
        view = LoadUI <View>("baseUI", "asd");
        base.Initial(parent, dat);

        //model.SetParent(UIPage.Root);
        view.Rocker.Radius = 100;

        TreeViewNode node = new TreeViewNode();

        node.content = "root";
        for (int i = 0; i < 10; i++)
        {
            TreeViewNode son = new TreeViewNode();
            son.content = i.ToString() + "tss";
            node.child.Add(son);
            for (int j = 0; j < 6; j++)
            {
                TreeViewNode r = new TreeViewNode();
                r.content = j.ToString() + "sdfsdf";
                son.child.Add(r);
            }
        }
        view.TreeView.nodes = node;
        view.TreeView.Refresh();
        view.Log.text = Scale.LayoutWidth.ToString();
        List <int> testData = new List <int>();

        for (int i = 0; i < 166; i++)
        {
            testData.Add(i);
        }
        //view.ScrollX.scroll.BindingData = testData;
        //view.ScrollX.scroll.ItemObject = typeof(Item);
        //view.ScrollX.scroll.ItemUpdate = (o, e, i) => {
        //    (o as Item).Text.text = i.ToString();
        //};
        //view.Scroll.Refresh();

        view.Scroll.BindingData = testData;
        view.Scroll.Column      = 16;
        view.Scroll.SetItemUpdate <Item, int> ((o, e, i) => { o.Text.text = i.ToString(); });
        view.Scroll.Refresh();
    }
예제 #3
0
 public override void Initial(ModelElement parent, object dat = null)
 {
     model = ModelManagerUI.FindModel("baseUI", "Slider");
     base.Initial(parent, dat);
     model.SetParent(parent);
     var view = model.ComponentReflection <View>();
     //view.Slider.SetFillSize(0.5f);
     //List<string> list = new List<string>();
     //for (int i = 0; i < 1000; i++)
     //    list.Add(i.ToString());
     //view.FriendsRanking.BindingData = list;
     //view.FriendsRanking.Refresh();
     //ran = new System.Random();
     //txt.baseEvent.Click = (o, e) =>
     //{
     //    Debug.Log("click");
     //    txt.data.localPosition = new Vector3(ran.Next(-400, 400), 0, 0);
     //    txt.IsChanged = true;
     //};
 }