Ejemplo n.º 1
0
    public static UIWindowBase CreateUIWindow(string UIName)
    {
        Debug.Log("CreateUIWindow " + UIName);

        GameObject   UItmp        = GameObjectManager.CreateGameObjectByPool(UIName, UIManagerGo);
        UIWindowBase UIWIndowBase = UItmp.GetComponent <UIWindowBase>();

        UISystemEvent.Dispatch(UIWIndowBase, UIEvent.OnInit);  //派发OnInit事件

        UIWIndowBase.windowStatus = UIWindowBase.WindowStatus.Create;

        try
        {
            UIWIndowBase.InitWindow(GetUIID(UIName));
        }
        catch (Exception e)
        {
            Debug.LogError(UIName + "OnInit Exception: " + e.ToString());
        }

        AddHideUI(UIWIndowBase);

        UILayerManager.SetLayer(UIWIndowBase);      //设置层级

        return(UIWIndowBase);
    }
Ejemplo n.º 2
0
 static int InitWindow(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UIWindowBase obj  = (UIWindowBase)ToLua.CheckObject(L, 1, typeof(UIWindowBase));
         int          arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         obj.InitWindow(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }