Example #1
0
    static int RemoveSysWindow(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                CFramework.BaseScene obj = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                obj.RemoveSysWindow(arg0);
                return(0);
            }
            else if (count == 3)
            {
                CFramework.BaseScene obj = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                bool   arg1 = LuaDLL.luaL_checkboolean(L, 3);
                obj.RemoveSysWindow(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: CFramework.BaseScene.RemoveSysWindow"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #2
0
    static int _CreateCFramework_BaseScene(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 6)
            {
                string   arg0 = ToLua.CheckString(L, 1);
                string[] arg1 = ToLua.CheckStringArray(L, 2);
                System.Action <CFramework.BaseScene> arg2 = (System.Action <CFramework.BaseScene>)ToLua.CheckDelegate <System.Action <CFramework.BaseScene> >(L, 3);
                System.Action <int> arg3 = (System.Action <int>)ToLua.CheckDelegate <System.Action <int> >(L, 4);
                bool arg4 = LuaDLL.luaL_checkboolean(L, 5);
                UnityEngine.Transform arg5 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 6);
                CFramework.BaseScene  obj  = new CFramework.BaseScene(arg0, arg1, arg2, arg3, arg4, arg5);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: CFramework.BaseScene.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #3
0
    static int RemoveAllModule(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                CFramework.BaseScene obj = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
                obj.RemoveAllModule();
                return(0);
            }
            else if (count == 2)
            {
                CFramework.BaseScene obj = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
                bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
                obj.RemoveAllModule(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: CFramework.BaseScene.RemoveAllModule"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #4
0
 static int Dispose(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         CFramework.BaseScene obj = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
         obj.Dispose();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #5
0
 static int GetTopWindow(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         CFramework.BaseScene  obj = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
         CFramework.BaseWindow o   = obj.GetTopWindow();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #6
0
 static int RemoveTip(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         CFramework.BaseScene   obj  = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject));
         obj.RemoveTip(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #7
0
 static int IsTopWindow(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         CFramework.BaseScene obj = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         bool   o    = obj.IsTopWindow(arg0);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #8
0
 static int GetModule(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         CFramework.BaseScene obj = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
         string arg0             = ToLua.CheckString(L, 2);
         CFramework.BaseModule o = obj.GetModule(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #9
0
    static int get_CompleteCallback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.BaseScene obj = (CFramework.BaseScene)o;
            System.Action <CFramework.BaseScene> ret = obj.CompleteCallback;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index CompleteCallback on a nil value"));
        }
    }
Example #10
0
    static int get_SysLayer(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.BaseScene  obj = (CFramework.BaseScene)o;
            UnityEngine.Transform ret = obj.SysLayer;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index SysLayer on a nil value"));
        }
    }
Example #11
0
    static int set_SysLayer(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.BaseScene  obj  = (CFramework.BaseScene)o;
            UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 2);
            obj.SysLayer = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index SysLayer on a nil value"));
        }
    }
Example #12
0
    static int get_LoadingId(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.BaseScene obj = (CFramework.BaseScene)o;
            string ret = obj.LoadingId;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index LoadingId on a nil value"));
        }
    }
Example #13
0
    static int set_CurrScene(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.SceneManagerEx obj  = (CFramework.SceneManagerEx)o;
            CFramework.BaseScene      arg0 = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 2);
            obj.CurrScene = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index CurrScene on a nil value"));
        }
    }
Example #14
0
    static int get_CurrScene(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.SceneManagerEx obj = (CFramework.SceneManagerEx)o;
            CFramework.BaseScene      ret = obj.CurrScene;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index CurrScene on a nil value"));
        }
    }
Example #15
0
    static int set_CompleteCallback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.BaseScene obj = (CFramework.BaseScene)o;
            System.Action <CFramework.BaseScene> arg0 = (System.Action <CFramework.BaseScene>)ToLua.CheckDelegate <System.Action <CFramework.BaseScene> >(L, 2);
            obj.CompleteCallback = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index CompleteCallback on a nil value"));
        }
    }
Example #16
0
    static int set_LoadingId(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            CFramework.BaseScene obj = (CFramework.BaseScene)o;
            string arg0 = ToLua.CheckString(L, 2);
            obj.LoadingId = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index LoadingId on a nil value"));
        }
    }
Example #17
0
 static int AddModule(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 6);
         CFramework.BaseScene   obj  = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject));
         string arg1 = ToLua.CheckString(L, 3);
         string arg2 = ToLua.CheckString(L, 4);
         string arg3 = ToLua.CheckString(L, 5);
         System.Action <CFramework.BaseModule> arg4 = (System.Action <CFramework.BaseModule>)ToLua.CheckDelegate <System.Action <CFramework.BaseModule> >(L, 6);
         obj.AddModule(arg0, arg1, arg2, arg3, arg4);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #18
0
 static int AddWindow(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 10);
         CFramework.BaseScene obj = (CFramework.BaseScene)ToLua.CheckObject <CFramework.BaseScene>(L, 1);
         string   arg0            = ToLua.CheckString(L, 2);
         string   arg1            = ToLua.CheckString(L, 3);
         string   arg2            = ToLua.CheckString(L, 4);
         string[] arg3            = ToLua.CheckStringArray(L, 5);
         bool     arg4            = LuaDLL.luaL_checkboolean(L, 6);
         bool     arg5            = LuaDLL.luaL_checkboolean(L, 7);
         bool     arg6            = LuaDLL.luaL_checkboolean(L, 8);
         System.Action <CFramework.BaseWindow> arg7 = (System.Action <CFramework.BaseWindow>)ToLua.CheckDelegate <System.Action <CFramework.BaseWindow> >(L, 9);
         System.Action <int, int> arg8 = (System.Action <int, int>)ToLua.CheckDelegate <System.Action <int, int> >(L, 10);
         obj.AddWindow(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #19
0
        /// <summary>
        /// 加载场景
        /// </summary>
        /// <param name="loadingWindowClass"></param>
        /// <returns></returns>
        private IEnumerator LoadingScene(LuaTable loadingWindowClass)
        {
            int showProgress = 80;

            while (showProgress < 100)
            {
                if (showProgress < 30)
                {
                    showProgress++;

                    if (_progressCallback != null)
                    {
                        _progressCallback(showProgress);
                        loadingWindowClass.Call("OnProgress", loadingWindowClass, showProgress);
                        yield return(new WaitForEndOfFrame()); //等待一帧
                    }
                }
                else if (showProgress < 90)
                {
                    yield return(new WaitUntil(delegate()
                    {
                        return _preloadIsEnd;
                    }));

                    showProgress++;

                    if (_progressCallback != null)
                    {
                        _progressCallback(showProgress);
                        loadingWindowClass.Call("OnProgress", loadingWindowClass, showProgress);
                        yield return(new WaitForEndOfFrame()); //等待一帧
                    }
                }
                else
                {
                    yield return(new WaitUntil(delegate()
                    {
                        return _prog.progress >= 0.9f;
                    }));

                    showProgress++;
                    if (_progressCallback != null)
                    {
                        _progressCallback(showProgress);
                        loadingWindowClass.Call("OnProgress", loadingWindowClass, showProgress);
                        yield return(new WaitForEndOfFrame()); //等待一帧
                    }
                }
            }

            //-----------------------------预加载资源加载完成,进入场景------------------------------
            _prog.allowSceneActivation = true;  //如果加载完成,可以进入场景

            Scene scene = SceneManager.GetSceneByName(_id);

            yield return(new WaitUntil(delegate() {
                return scene.isLoaded;
            }));

            DebugManager.Log("enter scene:" + scene.name);

            GameObject[] objs = scene.GetRootGameObjects();

            foreach (GameObject go in objs)
            {
                DebugManager.Log("go.name:" + go.name);
                if (go.name.Equals("Canvas"))
                {
                    _loadBaseScene = new BaseScene(_id, _preloadList, _completeCallback, _progressCallback, _isCache, go.transform);
                    LuaComponent luaComponent = go.AddComponent <LuaComponent>();

                    luaComponent.New(_luaSceneClass, _loadBaseScene);

                    _completeCallback(_loadBaseScene);

                    this.CurrScene = _loadBaseScene;

                    _loadBaseScene = null;
                    _id            = null;
                    break;
                }
            }
        }