We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
如果我要用Unilua操作在Scence中已有的对象,就必须把对象传给Unilua。比如我在scene中有个GameObject a, 那么我用Lua.PushLightUserData(a)把东西push到lua里。 lua 函数是这样: local function DisableButton(a) a:SetActive(false) end 这样是不行的,因为a只是一个LightUserData,实际上是一块内存,没有了GameObject的field和method了。而ffi.lua中没有把new_class_mgr暴露出来,造成虽然我可以创建新的Gameobject,但是没法从内存中还原Gameobject。 看了代码后我在resolve_builder()中加了一行 mod.cls_mgr = cls_mgr 把new_class_mgr暴露了出来,才能使用 obj = UnityEngine.cls_mgr.make_instance('GameObject', a) 这样比较丑陋,但是实现了我想要的功能。 请问还有更好的办法吗?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如果我要用Unilua操作在Scence中已有的对象,就必须把对象传给Unilua。比如我在scene中有个GameObject a, 那么我用Lua.PushLightUserData(a)把东西push到lua里。
lua 函数是这样:
local function DisableButton(a)
a:SetActive(false)
end
这样是不行的,因为a只是一个LightUserData,实际上是一块内存,没有了GameObject的field和method了。而ffi.lua中没有把new_class_mgr暴露出来,造成虽然我可以创建新的Gameobject,但是没法从内存中还原Gameobject。
看了代码后我在resolve_builder()中加了一行
mod.cls_mgr = cls_mgr
把new_class_mgr暴露了出来,才能使用
obj = UnityEngine.cls_mgr.make_instance('GameObject', a)
这样比较丑陋,但是实现了我想要的功能。
请问还有更好的办法吗?
The text was updated successfully, but these errors were encountered: