コード例 #1
0
    static int IntToEnum(IntPtr L)
    {
        int        arg0 = (int)LuaDLL.lua_tonumber(L, 1);
        UIOpenType o    = (UIOpenType)arg0;

        ToLua.Push(L, o);
        return(1);
    }
コード例 #2
0
    static int LoadUICallBack(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 9 && TypeChecker.CheckTypes(L, 1, typeof(UIManager), typeof(AssetLoader), typeof(WindowLayer), typeof(UnityEngine.Object), typeof(UIExtendType), typeof(UIOpenType), typeof(bool), typeof(bool), typeof(int)))
            {
                UIManager          obj  = (UIManager)ToLua.ToObject(L, 1);
                AssetLoader        arg0 = (AssetLoader)ToLua.ToObject(L, 2);
                WindowLayer        arg1 = (WindowLayer)ToLua.ToObject(L, 3);
                UnityEngine.Object arg2 = (UnityEngine.Object)ToLua.ToObject(L, 4);
                UIExtendType       arg3 = (UIExtendType)ToLua.ToObject(L, 5);
                UIOpenType         arg4 = (UIOpenType)ToLua.ToObject(L, 6);
                bool arg5 = LuaDLL.lua_toboolean(L, 7);
                bool arg6 = LuaDLL.lua_toboolean(L, 8);
                int  arg7 = (int)LuaDLL.lua_tonumber(L, 9);
                UnityEngine.GameObject o = obj.LoadUICallBack(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 12 && TypeChecker.CheckTypes(L, 1, typeof(UIManager), typeof(UnityEngine.UI.CanvasScaler.ScreenMatchMode), typeof(WindowLayer), typeof(float), typeof(AssetLoader), typeof(UnityEngine.Object), typeof(UIExtendType), typeof(UIOpenType), typeof(UILayerType), typeof(bool), typeof(bool), typeof(int)))
            {
                UIManager obj = (UIManager)ToLua.ToObject(L, 1);
                UnityEngine.UI.CanvasScaler.ScreenMatchMode arg0 = (UnityEngine.UI.CanvasScaler.ScreenMatchMode)ToLua.ToObject(L, 2);
                WindowLayer        arg1 = (WindowLayer)ToLua.ToObject(L, 3);
                float              arg2 = (float)LuaDLL.lua_tonumber(L, 4);
                AssetLoader        arg3 = (AssetLoader)ToLua.ToObject(L, 5);
                UnityEngine.Object arg4 = (UnityEngine.Object)ToLua.ToObject(L, 6);
                UIExtendType       arg5 = (UIExtendType)ToLua.ToObject(L, 7);
                UIOpenType         arg6 = (UIOpenType)ToLua.ToObject(L, 8);
                UILayerType        arg7 = (UILayerType)ToLua.ToObject(L, 9);
                bool arg8  = LuaDLL.lua_toboolean(L, 10);
                bool arg9  = LuaDLL.lua_toboolean(L, 11);
                int  arg10 = (int)LuaDLL.lua_tonumber(L, 12);
                UnityEngine.GameObject o = obj.LoadUICallBack(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UIManager.LoadUICallBack"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #3
0
 static int AddDlg(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 7);
         UIManager obj = (UIManager)ToLua.CheckObject(L, 1, typeof(UIManager));
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.GameObject));
         WindowLayer            arg1 = (WindowLayer)ToLua.CheckObject(L, 3, typeof(WindowLayer));
         UIOpenType             arg2 = (UIOpenType)ToLua.CheckObject(L, 4, typeof(UIOpenType));
         bool    arg3 = LuaDLL.luaL_checkboolean(L, 5);
         bool    arg4 = LuaDLL.luaL_checkboolean(L, 6);
         int     arg5 = (int)LuaDLL.luaL_checknumber(L, 7);
         UILayer o    = obj.AddDlg(arg0, arg1, arg2, arg3, arg4, arg5);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #4
0
    static int CreatePanel(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(PanelManager), typeof(string)))
            {
                PanelManager obj  = (PanelManager)ToLua.ToObject(L, 1);
                string       arg0 = ToLua.ToString(L, 2);
                obj.CreatePanel(arg0);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(PanelManager), typeof(string), typeof(WindowLayer)))
            {
                PanelManager obj  = (PanelManager)ToLua.ToObject(L, 1);
                string       arg0 = ToLua.ToString(L, 2);
                WindowLayer  arg1 = (WindowLayer)ToLua.ToObject(L, 3);
                obj.CreatePanel(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(PanelManager), typeof(string), typeof(object)))
            {
                PanelManager obj  = (PanelManager)ToLua.ToObject(L, 1);
                string       arg0 = ToLua.ToString(L, 2);
                object       arg1 = ToLua.ToVarObject(L, 3);
                obj.CreatePanel(arg0, arg1);
                return(0);
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(PanelManager), typeof(string), typeof(UIExtendType), typeof(object)))
            {
                PanelManager obj  = (PanelManager)ToLua.ToObject(L, 1);
                string       arg0 = ToLua.ToString(L, 2);
                UIExtendType arg1 = (UIExtendType)ToLua.ToObject(L, 3);
                object       arg2 = ToLua.ToVarObject(L, 4);
                obj.CreatePanel(arg0, arg1, arg2);
                return(0);
            }
            else if (count == 5 && TypeChecker.CheckTypes(L, 1, typeof(PanelManager), typeof(string), typeof(UIExtendType), typeof(UIOpenType), typeof(object)))
            {
                PanelManager obj  = (PanelManager)ToLua.ToObject(L, 1);
                string       arg0 = ToLua.ToString(L, 2);
                UIExtendType arg1 = (UIExtendType)ToLua.ToObject(L, 3);
                UIOpenType   arg2 = (UIOpenType)ToLua.ToObject(L, 4);
                object       arg3 = ToLua.ToVarObject(L, 5);
                obj.CreatePanel(arg0, arg1, arg2, arg3);
                return(0);
            }
            else if (count == 8 && TypeChecker.CheckTypes(L, 1, typeof(PanelManager), typeof(string), typeof(WindowLayer), typeof(UIExtendType), typeof(UIOpenType), typeof(LuaInterface.LuaFunction), typeof(object), typeof(int)))
            {
                PanelManager obj  = (PanelManager)ToLua.ToObject(L, 1);
                string       arg0 = ToLua.ToString(L, 2);
                WindowLayer  arg1 = (WindowLayer)ToLua.ToObject(L, 3);
                UIExtendType arg2 = (UIExtendType)ToLua.ToObject(L, 4);
                UIOpenType   arg3 = (UIOpenType)ToLua.ToObject(L, 5);
                LuaFunction  arg4 = ToLua.ToLuaFunction(L, 6);
                object       arg5 = ToLua.ToVarObject(L, 7);
                int          arg6 = (int)LuaDLL.lua_tonumber(L, 8);
                obj.CreatePanel(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: PanelManager.CreatePanel"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #5
0
ファイル: UIHelper.cs プロジェクト: 517752548/EXET
        public static void HandlerUI(UIBase _uibase, UILayerNew layer, UIOpenType openType, Dictionary <UILayerNew, List <UIBase> > ui_base)
        {
            List <UIBase> layerQueue = null;

            if (ui_base.ContainsKey(layer))
            {
                layerQueue = ui_base[layer];
            }
            else
            {
                layerQueue = new List <UIBase>();
                ui_base.Add(layer, layerQueue);
            }

            switch (layer)
            {
            case UILayerNew.GameUI:
                _uibase.GameObject.transform.SetParent(Game.Scene.GetComponent <UIManagerComponent>().GameUI, false);
                break;

            case UILayerNew.Fixed:
                _uibase.GameObject.transform.SetParent(Game.Scene.GetComponent <UIManagerComponent>().Fixed, false);
                break;

            case UILayerNew.Normal:
                _uibase.GameObject.transform.SetParent(Game.Scene.GetComponent <UIManagerComponent>().Normal, false);
                break;

            case UILayerNew.TopBar:
                _uibase.GameObject.transform.SetParent(Game.Scene.GetComponent <UIManagerComponent>().TopBar, false);
                break;

            case UILayerNew.PopUp:
                _uibase.GameObject.transform.SetParent(Game.Scene.GetComponent <UIManagerComponent>().PopUp, false);
                break;

            case UILayerNew.GuideUi:
                _uibase.GameObject.transform.SetParent(Game.Scene.GetComponent <UIManagerComponent>().GuideUI, false);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(layer), layer, null);
            }

            UIBase lastUibase = layerQueue.Count == 0? null : layerQueue[layerQueue.Count - 1];

            if (lastUibase != null)
            {
                switch (openType)
                {
                case UIOpenType.Stack:
                    lastUibase.Hidden();
                    layerQueue.Remove(lastUibase);
                    layerQueue.Add(_uibase);
                    break;

                case UIOpenType.Replace:
                    lastUibase.OnClose();
                    layerQueue.Remove(lastUibase);
                    layerQueue.Add(_uibase);
                    break;
                }
            }
            else
            {
                switch (openType)
                {
                case UIOpenType.Stack:
                    layerQueue.Add(_uibase);
                    break;

                case UIOpenType.Replace:
                    layerQueue.Add(_uibase);
                    break;
                }
            }
        }
コード例 #6
0
ファイル: UIManagerComponent.cs プロジェクト: 517752548/EXET
        public async ETTask OpenUIAsync <T>(string UIName, UILayerNew layer = UILayerNew.Normal, UIOpenType openType = UIOpenType.Stack, params object[] objs) where T : UIBaseComponent, new()
        {
            await ETModel.Game.Scene.GetComponent <ResourcesComponent>().CacheBundleAsync(UIName);

            GameObject obj  = (GameObject)ETModel.Game.Scene.GetComponent <ResourcesComponent>().GetAsset(UIName);
            UIBase     c_ui = UIHelper.Create <T>(UIName, obj, objs);

            UIHelper.HandlerUI(c_ui, layer, openType, this.ui_base);
            c_ui.GetComponent <T>();
        }