Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export UnityEngine in a more elegant way #7

Open
vontio opened this issue May 24, 2013 · 6 comments
Open

export UnityEngine in a more elegant way #7

vontio opened this issue May 24, 2013 · 6 comments

Comments

@vontio
Copy link

vontio commented May 24, 2013

maybe using Reflection to export all classes automatically?

@xebecnan
Copy link
Owner

Good idea!
But recently I am busy with other projects. I'll try it some days later.

@acook
Copy link

acook commented Jul 9, 2013

Any progress with this?

@xebecnan
Copy link
Owner

Not yet

On Wed, Jul 10, 2013 at 4:30 AM, Anthony M. Cook
[email protected]:

Any progress with this?


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-20703068
.

@lvzixun
Copy link

lvzixun commented Nov 24, 2013

dofile保证每次都会调用新生成的闭包, require是只保证调用一次,同时记录其第一个返回值; 这个应该算是lua的标准实现吧。
我用lua5.2.2实现你说的问题,大致如下:(不知道理解的对不对)
-- t.lua
print("load t.lua")

-- t2.lua
local t = require "t"
print("load t2.lua")

--- tdofile.C
int main(){
.....
luaL_dofile(L, "t.lua");
luaL_dofile(L, "t2.lua");
return 0;
}


$: gcc -o tdofile tdofile.c --lua
$:./tdofile

---------------output------------
load t.lua
load t.lua
load t2.lua

在 2013年11月24日上午12:05,zmeteor11 [email protected]写道:

英语不太好,就用中文写吧.
发现一个问题.
LuaState.L_DoFile 预加载 lib/ffi.lua
然后 再预加载 lib/unity_engine.lua (在这个脚本里面有 require( "lib.ffi" ) )

我在 lib/ffi.lua 文件中加了一行打印语句

print( "ffi.lua" )

当执行完两个预加载后, 这条打印语句被执行了两次.

随后,我调试了 LuaState.L_DoFile 和 LuaPkgLib.LL_Require
发现 这两个函数 在搜索 注册表 和 搜索路径 , 以及 写入注册表 的 行为不大相同.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-29135063
.

@zmeteor11
Copy link

谢谢你的回答,是我理解错了.
做了实验验证 UniLua 没有问题.
之前的回帖已经删除.

在 2013-11-24 13:52:35,zixun [email protected] 写道:
dofile保证每次都会调用新生成的闭包, require是只保证调用一次,同时记录其第一个返回值; 这个应该算是lua的标准实现吧。
我用lua5.2.2实现你说的问题,大致如下:(不知道理解的对不对)
-- t.lua
print("load t.lua")

-- t2.lua
local t = require "t"
print("load t2.lua")

--- tdofile.C
int main(){
.....
luaL_dofile(L, "t.lua");
luaL_dofile(L, "t2.lua");
return 0;
}


$: gcc -o tdofile tdofile.c --lua
$:./tdofile

---------------output------------
load t.lua
load t.lua
load t2.lua

在 2013年11月24日上午12:05,zmeteor11 [email protected]写道:

英语不太好,就用中文写吧.
发现一个问题.
LuaState.L_DoFile 预加载 lib/ffi.lua
然后 再预加载 lib/unity_engine.lua (在这个脚本里面有 require( "lib.ffi" ) )

我在 lib/ffi.lua 文件中加了一行打印语句

print( "ffi.lua" )

当执行完两个预加载后, 这条打印语句被执行了两次.

随后,我调试了 LuaState.L_DoFile 和 LuaPkgLib.LL_Require
发现 这两个函数 在搜索 注册表 和 搜索路径 , 以及 写入注册表 的 行为不大相同.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-29135063
.


Reply to this email directly or view it on GitHub.

@pillar
Copy link

pillar commented Jun 27, 2014

come on ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants