Example #1
0
    private void OnGUI()
    {
        if (GUILayout.Button("Open:MainPanel"))
        {
            var dic = new Dictionary <string, object>();
            dic["title"]       = "我是主面板";
            dic["info"]        = "当传入IDictionary时,会自动填充绑定好的字段或属性";
            dic["method"]      = "可以向方法传递一个参数";
            dic["ondestroy"]   = new Action <string>((x) => { Debug.Log(x); });
            dic["OpenPanel01"] = dic["OpenPanel02"] = dic["OpenPanel03"] = new PanelAction <Button>((context, button) => {
                Debug.Log(button + ": onClicked");
            });


            uiFacade.Open(PanelNames.MainPanel, dic);
        }
        if (GUILayout.Button("Open:MainPanel with viewModel"))
        {
            uiFacade.Open(PanelNames.MainPanel, mainViewModel);
        }
        if (GUILayout.Button("Open:MainPanel with viewModel with id"))
        {
            uiFacade.Open(PanelNames.MainPanel, mainViewModel_withID);
        }
        for (int i = 0; i < 2; i++)
        {
            if (GUILayout.Button("Open:Panel01  " + i))
            {
                OpenPanel01(i);
            }
        }
        if (GUILayout.Button("Close " + pane01))
        {
            uiFacade.Close(pane01);
        }
        if (GUILayout.Button("Hide " + pane01))
        {
            uiFacade.Hide(pane01);
        }
    }
 private void OnGUI()
 {
     if (GUILayout.Button("Open:MainPanel"))
     {
         var dic = new Dictionary <string, object>();
         dic["title"] = "我是主面板";
         uiFacade.Open(PanelNames.MainPanel, dic);
     }
     for (int i = 0; i < 2; i++)
     {
         if (GUILayout.Button("Open:Panel01  " + i))
         {
             OpenPanel01(i);
         }
     }
     if (GUILayout.Button("Close " + pane01))
     {
         uiFacade.Close(pane01);
     }
     if (GUILayout.Button("Hide " + pane01))
     {
         uiFacade.Hide(pane01);
     }
 }