Пример #1
0
        static int _m_StartLua(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LuaMain gen_to_be_invoked = (LuaMain)translator.FastGetCSObj(L, 1);



                {
                    string _module   = LuaAPI.lua_tostring(L, 2);
                    string _function = LuaAPI.lua_tostring(L, 3);

                    var gen_ret = gen_to_be_invoked.StartLua(_module, _function);
                    LuaAPI.lua_pushboolean(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        LuaMain luaenv = LuaMain.InitLuaEvn(this.gameObject, OnQuit, 1);

        string[] folds =
        {
            Application.dataPath + "/lualogic/lua/"
            , Application.dataPath + "/ReuseScript/lua/"
        };

        luaenv.InitNormalFileLoader(folds);
        luaenv.StartLua("test_attach", "Main");
        Debug.Log("load ok");
    }
Пример #3
0
    // Start is called before the first frame update
    void Start()
    {
        _logFile = new LogFile();

        LuaMain luaenv = LuaMain.InitLuaEvn(this.gameObject, OnQuit, 1);

        string[] folds =
        {
            Application.dataPath + "/chat_prj/script/"
            , Application.dataPath + "/ReuseScript/lua/"
        };

        luaenv.InitNormalFileLoader(folds);

        luaenv.StartLua("chat_test", "Main");
        Debug.Log("load ok");
    }
Пример #4
0
    // Start is called before the first frame update
    void Start()
    {
        _logFile = new LogFile();

        LuaMain luaenv = LuaMain.InitLuaEvn(this.gameObject, OnQuit, 1);

        if (useZip)
        {
            string luazip = Application.streamingAssetsPath + "/core.zip";
            luaenv.InitZipLoader(luazip);
        }
        else
        {
            string[] folds =
            {
                Application.dataPath + "/lualogic/lua/"
                , Application.dataPath + "/ReuseScript/lua/"
            };

            luaenv.InitNormalFileLoader(folds);
        }
        luaenv.StartLua("main", "Main");
        Debug.Log("load ok");
    }