CreateUI() public method

public CreateUI ( ) : void
return void
示例#1
0
 static public int CreateUI(IntPtr l)
 {
     try {
         FairyGUI.UIPanel self = (FairyGUI.UIPanel)checkSelf(l);
         self.CreateUI();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#2
0
        private void CreateWindowAsync(string packageName, string name)
        {
            GameObject win = new GameObject(name);

            Utils.NormalizeTransform(win.transform);
            if (!win.activeSelf)
            {
                win.SetActive(true);
            }

            FairyGUI.UIPanel panel = win.AddComponent <FairyGUI.UIPanel>();
            panel.container.renderMode    = RenderMode.ScreenSpaceOverlay;
            panel.container.fairyBatching = true;
            panel.container.SetChildrenLayer(uiMrg.windowRoot.gameObject.layer);
            panel.packageName   = packageName;
            panel.componentName = name;

            LuaWindow window = win.AddComponent <LuaWindow>();

            window.Setup(uiMrg, this, name);
            panel.CreateUI();
            Utils.AttachChild(uiMrg.windowRoot, win.transform, true);

            //UIPackage.CreateObjectAsync(packageName, name, (GObject result) =>
            //{
            //    GameObject winObj = result.displayObject.gameObject;
            //    if (!winObj)
            //    {
            //        LOG.Debug(string.Format("load window '{0}' fail.", name));
            //        return;
            //    }

            //    CClientCommon.AttachChild(uiMrg.windowRoot, winObj.transform);
            //    CClientCommon.NormalizeTransform(winObj.transform);
            //    if (!winObj.activeSelf)
            //        winObj.SetActive(true);

            //    Type winType = uiMrg.GetWindowType(name);
            //    if (winType == null)
            //    {
            //        return;
            //    }

            //    FairyGUI.UIPanel panel = winObj.AddComponent<FairyGUI.UIPanel>();
            //    panel.container.renderMode = RenderMode.ScreenSpaceOverlay;
            //    panel.container.fairyBatching = true;

            //    UIWindow window = winObj.AddComponent(winType) as UIWindow;
            //    window.Setup(uiMrg, name);
            //});
        }
示例#3
0
 static int CreateUI(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         FairyGUI.UIPanel obj = (FairyGUI.UIPanel)ToLua.CheckObject(L, 1, typeof(FairyGUI.UIPanel));
         obj.CreateUI();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }